Skip to content

Commit bda6ae6

Browse files
yosrym93sean-jc
authored andcommitted
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>
1 parent 6f4d3eb commit bda6ae6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tools/testing/selftests/kvm/x86/vmx_set_nested_state_test.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,10 @@ void test_vmx_nested_state(struct kvm_vcpu *vcpu)
241241
TEST_ASSERT(state->size >= sizeof(*state) && state->size <= state_sz,
242242
"Size must be between %ld and %d. The size returned was %d.",
243243
sizeof(*state), state_sz, state->size);
244-
TEST_ASSERT(state->hdr.vmx.vmxon_pa == -1ull, "vmxon_pa must be -1ull.");
245-
TEST_ASSERT(state->hdr.vmx.vmcs12_pa == -1ull, "vmcs_pa must be -1ull.");
244+
245+
TEST_ASSERT_EQ(state->hdr.vmx.vmxon_pa, -1ull);
246+
TEST_ASSERT_EQ(state->hdr.vmx.vmcs12_pa, -1ull);
247+
TEST_ASSERT_EQ(state->flags, 0);
246248

247249
free(state);
248250
}

0 commit comments

Comments
 (0)