KVM: selftests: Make TEST_ASSERT_EQ() output look like normal TEST_ASSERT()
authorSean Christopherson <seanjc@google.com>
Sat, 29 Jul 2023 00:36:11 +0000 (17:36 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 2 Aug 2023 21:41:58 +0000 (14:41 -0700)
commitb145c58d95fff280c2726d0024005ae0a4ec378d
treebd0d8a54bc4098d6f9d76d9413a4dab9ee69498a
parent6d85f51a1f08411617d0bfe12c537ed6eba7f0f4
KVM: selftests: Make TEST_ASSERT_EQ() output look like normal TEST_ASSERT()

Clean up TEST_ASSERT_EQ() so that the (mostly) raw code is captured in the
main assert message, not the helper macro's code.  E.g. make this:

  x86_64/tsc_msrs_test.c:106: __a == __b
  pid=40470 tid=40470 errno=0 - Success
     1 0x000000000040170e: main at tsc_msrs_test.c:106
     2 0x0000000000416f23: __libc_start_call_main at libc-start.o:?
     3 0x000000000041856f: __libc_start_main_impl at ??:?
     4 0x0000000000401ef0: _start at ??:?
  TEST_ASSERT_EQ(rounded_host_rdmsr(MSR_IA32_TSC), val + 1) failed.
rounded_host_rdmsr(MSR_IA32_TSC) is 0
val + 1 is 0x1

look like this:

  x86_64/tsc_msrs_test.c:106: rounded_host_rdmsr(MSR_IA32_TSC) == val + 1
  pid=5737 tid=5737 errno=0 - Success
     1 0x0000000000401714: main at tsc_msrs_test.c:106
     2 0x0000000000415c23: __libc_start_call_main at libc-start.o:?
     3 0x000000000041726f: __libc_start_main_impl at ??:?
     4 0x0000000000401e60: _start at ??:?
  0 != 0x1 (rounded_host_rdmsr(MSR_IA32_TSC) != val + 1)

Opportunstically clean up the formatting of the entire macro.

Link: https://lore.kernel.org/r/20230729003643.1053367-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/test_util.h