1
1
// SPDX-License-Identifier: GPL-2.0
2
+ #define USE_GUEST_ASSERT_PRINTF 1
3
+
2
4
#include <fcntl.h>
3
5
#include <stdio.h>
4
6
#include <stdlib.h>
@@ -20,8 +22,8 @@ static void guest_ins_port80(uint8_t *buffer, unsigned int count)
20
22
end = (unsigned long )buffer + 8192 ;
21
23
22
24
asm volatile ("cld; rep; insb" : "+D" (buffer ), "+c" (count ) : "d" (0x80 ) : "memory" );
23
- GUEST_ASSERT_1 (count == 0 , count );
24
- GUEST_ASSERT_2 ((unsigned long )buffer == end , buffer , end );
25
+ GUEST_ASSERT_EQ (count , 0 );
26
+ GUEST_ASSERT_EQ ((unsigned long )buffer , end );
25
27
}
26
28
27
29
static void guest_code (void )
@@ -43,7 +45,9 @@ static void guest_code(void)
43
45
memset (buffer , 0 , sizeof (buffer ));
44
46
guest_ins_port80 (buffer , 8192 );
45
47
for (i = 0 ; i < 8192 ; i ++ )
46
- GUEST_ASSERT_2 (buffer [i ] == 0xaa , i , buffer [i ]);
48
+ __GUEST_ASSERT (buffer [i ] == 0xaa ,
49
+ "Expected '0xaa', got '0x%x' at buffer[%u]" ,
50
+ buffer [i ], i );
47
51
48
52
GUEST_DONE ();
49
53
}
@@ -91,7 +95,7 @@ int main(int argc, char *argv[])
91
95
case UCALL_DONE :
92
96
break ;
93
97
case UCALL_ABORT :
94
- REPORT_GUEST_ASSERT_2 (uc , "argN+1 = 0x%lx, argN+2 = 0x%lx" );
98
+ REPORT_GUEST_ASSERT (uc );
95
99
default :
96
100
TEST_FAIL ("Unknown ucall %lu" , uc .cmd );
97
101
}
0 commit comments