Skip to content

Commit 5f82bba

Browse files
committed
KVM: selftests: Convert s390's tprot test to printf style GUEST_ASSERT
Convert s390's tprot test to printf-based GUEST_ASSERT. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 428c76c commit 5f82bba

File tree

1 file changed

+5
-2
lines changed
  • tools/testing/selftests/kvm/s390x

1 file changed

+5
-2
lines changed

tools/testing/selftests/kvm/s390x/tprot.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
* Copyright IBM Corp. 2021
66
*/
7+
#define USE_GUEST_ASSERT_PRINTF 1
78

89
#include <sys/mman.h>
910
#include "test_util.h"
@@ -156,7 +157,9 @@ static enum stage perform_next_stage(int *i, bool mapped_0)
156157
!mapped_0;
157158
if (!skip) {
158159
result = test_protection(tests[*i].addr, tests[*i].key);
159-
GUEST_ASSERT_2(result == tests[*i].expected, *i, result);
160+
__GUEST_ASSERT(result == tests[*i].expected,
161+
"Wanted %u, got %u, for i = %u",
162+
tests[*i].expected, result, *i);
160163
}
161164
}
162165
return stage;
@@ -190,7 +193,7 @@ static void guest_code(void)
190193
vcpu_run(__vcpu); \
191194
get_ucall(__vcpu, &uc); \
192195
if (uc.cmd == UCALL_ABORT) \
193-
REPORT_GUEST_ASSERT_2(uc, "hints: %lu, %lu"); \
196+
REPORT_GUEST_ASSERT(uc); \
194197
TEST_ASSERT_EQ(uc.cmd, UCALL_SYNC); \
195198
TEST_ASSERT_EQ(uc.args[1], __stage); \
196199
})

0 commit comments

Comments
 (0)