Skip to content

Commit a465871

Browse files
author
Andras Fekete
committed
Print the error code in case of failure
1 parent 7ed71da commit a465871

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test/unit.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static int run_tests(int runAll)
399399
if (!test_case[i].err)
400400
fprintf(stderr, "PASSED\n");
401401
else
402-
fprintf(stderr, "FAILED\n");
402+
fprintf(stderr, "FAILED (err: %d)\n", test_case[i].err);
403403
}
404404

405405
LockFree();
@@ -418,7 +418,7 @@ static int run_tests(int runAll)
418418
else {
419419
for (i = 0; i < TEST_CASE_CNT; i++) {
420420
if (test_case[i].err) {
421-
printf("## FAIL: %d: %s\n", i + 1, test_case[i].name);
421+
printf("## FAIL: %d: %s (err: %d)\n", i + 1, test_case[i].name, test_case[i].err);
422422
}
423423
}
424424
printf("###### TESTSUITE FAILED\n");
@@ -454,7 +454,7 @@ static int run_tests(int runAll)
454454
if (!test_case[i].err)
455455
printf("#### SUCCESS: %d - %s\n", i + 1, test_case[i].name);
456456
else
457-
printf("#### FAILED: %d - %s\n", i + 1, test_case[i].name);
457+
printf("#### FAILED: %d - %s (err: %d)\n", i + 1, test_case[i].name, test_case[i].err);
458458
printf("\n");
459459
}
460460

@@ -471,7 +471,7 @@ static int run_tests(int runAll)
471471
else {
472472
for (i = 0; i < TEST_CASE_CNT; i++) {
473473
if (test_case[i].err) {
474-
printf("## FAIL: %d: %s\n", i + 1, test_case[i].name);
474+
printf("## FAIL: %d: %s (err: %d)\n", i + 1, test_case[i].name, test_case[i].err);
475475
}
476476
}
477477
printf("###### TESTSUITE FAILED\n");

0 commit comments

Comments
 (0)