Skip to content

Commit 6cb3557

Browse files
committed
feat(linux): allow the tester to use linux's own result
1 parent 79c3dc6 commit 6cb3557

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

src/tests.c

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ int run_tests(int test_cat)
7777

7878
char *mallocked = malloc(2);
7979
PRINTF(("This %p is an address from the heap", mallocked); free(mallocked);); free(mallocked);
80-
PRINTF_EXPECTED(("%p", NULL), /* expected: */ ("0x0"));
81-
PRINTF_EXPECTED(("The NULL macro represents the %p address", NULL), ("The NULL macro represents the 0x0 address"));
80+
PRINTF(("%p", NULL));
81+
PRINTF(("The NULL macro represents the %p address", NULL));
8282
PRINTF(("This %p is even stranger", (void *)-1));
8383

8484
right_cat = test_cat ? test_cat & (CAT_D | CAT_MANDATORY) : 1;
@@ -164,8 +164,7 @@ int run_tests(int test_cat)
164164
PRINTF(("%c - %s - %p %d - %i - %u - %x %X %%", '\0', "test", (void *)-1, 20, -20, -1, -1, 200000000));
165165
PRINTF(("%c - %s - %p %d - %i - %u - %x %X %%", 'c', "", (void *)-1, 20, -20, -1, -1, 200000000));
166166
PRINTF(("%i - %s - %p %d - %c - %u - %x %X %%", 20, "", (void *)-1, '\0', -20, -1, -1, 200000000));
167-
PRINTF_EXPECTED(("%c - %s - %p %d - %i - %u - %x %X %%", 'b', null_str, NULL, 20, -20, -1, -1, 200000000),
168-
("b - (null) - 0x0 20 - -20 - 4294967295 - ffffffff BEBC200 %%"));
167+
PRINTF(("%c - %s - %p %d - %i - %u - %x %X %%", 'b', null_str, NULL, 20, -20, -1, -1, 200000000));
169168
PRINTF(("%c %s - %p - %d - %i %u - %x - %X %%", '\0', null_str, (void *)0xdeadc0de, 0, (int)-2147483648, -1, -1, 200000000));
170169

171170
right_cat = (g_all_bonus & CAT_BONUS_1) ? 1
@@ -223,19 +222,19 @@ int run_tests(int test_cat)
223222
PRINTF(("the address is %12p", (void *)0x7ffe6b8e60c7));
224223
PRINTF(("the address is %13p", (void *)0x7ffe6b8e60c8));
225224
PRINTF(("the address is %14p", (void *)0x7ffe6b8e60c9));
226-
PRINTF_EXPECTED(("the address is %1p", (void *)0), /* expected: */ ("the address is 0x0"));
227-
PRINTF_EXPECTED(("the address is %2p", (void *)0), /* expected: */ ("the address is 0x0"));
228-
PRINTF_EXPECTED(("the address is %3p", (void *)0), /* expected: */ ("the address is 0x0"));
229-
PRINTF_EXPECTED(("the address is %4p", (void *)0), /* expected: */ ("the address is 0x0"));
230-
PRINTF_EXPECTED(("the address is %8p", (void *)0), /* expected: */ ("the address is 0x0"));
225+
PRINTF(("the address is %1p", (void *)0));
226+
PRINTF(("the address is %2p", (void *)0));
227+
PRINTF(("the address is %3p", (void *)0));
228+
PRINTF(("the address is %4p", (void *)0));
229+
PRINTF(("the address is %8p", (void *)0));
231230
PRINTF(("%12p is the address", (void *)0x7ffe6b8e60c7));
232231
PRINTF(("%13p is the address", (void *)0x7ffe6b8e60c8));
233232
PRINTF(("%14p is the address", (void *)0x7ffe6b8e60c9));
234-
PRINTF_EXPECTED(("%1p is the address", (void *)0), /* expected: */ ("0x0 is the address"));
235-
PRINTF_EXPECTED(("%2p is the address", (void *)0), /* expected: */ ("0x0 is the address"));
236-
PRINTF_EXPECTED(("%3p is the address", (void *)0), /* expected: */ ("0x0 is the address"));
237-
PRINTF_EXPECTED(("%4p is the address", (void *)0), /* expected: */ (" 0x0 is the address"));
238-
PRINTF_EXPECTED(("%8p is the address", (void *)0), /* expected: */ (" 0x0 is the address"));
233+
PRINTF(("%1p is the address", (void *)0));
234+
PRINTF(("%2p is the address", (void *)0));
235+
PRINTF(("%3p is the address", (void *)0));
236+
PRINTF(("%4p is the address", (void *)0));
237+
PRINTF(("%8p is the address", (void *)0));
239238

240239
right_cat = (g_all_bonus & CAT_BONUS_1) ? 1
241240
: test_cat ? (test_cat & CAT_D && test_cat & CAT_BONUS_1)
@@ -381,9 +380,9 @@ int run_tests(int test_cat)
381380
PRINTF(("%.3s", "-42"));
382381
PRINTF(("%.4s", "-42"));
383382
PRINTF(("%.7s", "-42"));
384-
PRINTF_EXPECTED(("%.1s", null_str), /* expected: */ ("("));
385-
PRINTF_EXPECTED(("%.2s", null_str), /* expected: */ ("(n"));
386-
PRINTF_EXPECTED(("%.5s", null_str), /* expected: */ ("(null"));
383+
PRINTF(("%.1s", null_str));
384+
PRINTF(("%.2s", null_str));
385+
PRINTF(("%.5s", null_str));
387386
PRINTF(("%.6s", null_str));
388387
PRINTF(("%.7s", null_str));
389388
PRINTF(("%.2s, motherfucker", "hi there"));

0 commit comments

Comments
 (0)