Skip to content

Commit 48922a8

Browse files
committed
Minor readability improvement for code reporting the failed tests.
1 parent b0a64bb commit 48922a8

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

tst_tests.c

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,23 +1730,22 @@ int tst_test_get_failed_num (void)
17301730
int tst_test_print_failed (void)
17311731
{
17321732
int i;
1733-
printf ("Number of failed tests:%d%s",
1734-
tst_tests_failed_num,
1735-
(tst_tests_failed_num > 0) ? " summary of failed tests:\n" : "\n");
1736-
1737-
for (i = 0; i < tst_tests_failed_num; i++)
1738-
{
1739-
const int test = tst_tests_failed[i].test;
1740-
const int comm = tst_tests_failed[i].comm;
1741-
const int type = tst_tests_failed[i].type;
1742-
const int values_num= tst_tests_failed[i].values_num;
1743-
1744-
printf ("ERROR class:%s test:%s (%d), comm %s (%d), type %s (%d) number of values:%d\n",
1745-
tst_test_getclass_string (test),
1746-
tst_test_getdescription (test), test+1,
1747-
tst_comm_getdescription (comm), comm+1,
1748-
tst_type_getdescription (type), type+1, values_num);
1749-
}
1733+
printf ("Number of failed tests: %d\n", tst_tests_failed_num);
1734+
if (tst_tests_failed_num > 0) {
1735+
printf ("Summary of failed tests:\n");
1736+
for (i = 0; i < tst_tests_failed_num; i++) {
1737+
const int test = tst_tests_failed[i].test;
1738+
const int comm = tst_tests_failed[i].comm;
1739+
const int type = tst_tests_failed[i].type;
1740+
const int values_num= tst_tests_failed[i].values_num;
1741+
1742+
printf ("ERROR class:%s test:%s (%d), comm %s (%d), type %s (%d) number of values:%d\n",
1743+
tst_test_getclass_string (test),
1744+
tst_test_getdescription (test), test+1,
1745+
tst_comm_getdescription (comm), comm+1,
1746+
tst_type_getdescription (type), type+1, values_num);
1747+
}
1748+
}
17501749
return 0;
17511750
}
17521751

0 commit comments

Comments
 (0)