KVM: selftests: Use TEST_ASSERT_EQ() in test_vmx_nested_state()

The assert messages do not add much value, so use TEST_ASSERT_EQ(),
which also nicely displays the addresses in hex. While at it, also
assert the values of state->flags.

Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Link: https://patch.msgid.link/20251121204803.991707-4-yosry.ahmed@linux.dev
Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
Yosry Ahmed 2025-11-21 20:48:02 +00:00 committed by Sean Christopherson
parent 6f4d3ebc24
commit bda6ae6f29

View File

@ -241,8 +241,10 @@ void test_vmx_nested_state(struct kvm_vcpu *vcpu)
TEST_ASSERT(state->size >= sizeof(*state) && state->size <= state_sz,
"Size must be between %ld and %d. The size returned was %d.",
sizeof(*state), state_sz, state->size);
TEST_ASSERT(state->hdr.vmx.vmxon_pa == -1ull, "vmxon_pa must be -1ull.");
TEST_ASSERT(state->hdr.vmx.vmcs12_pa == -1ull, "vmcs_pa must be -1ull.");
TEST_ASSERT_EQ(state->hdr.vmx.vmxon_pa, -1ull);
TEST_ASSERT_EQ(state->hdr.vmx.vmcs12_pa, -1ull);
TEST_ASSERT_EQ(state->flags, 0);
free(state);
}