summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMitya Selivanov <0x7fffff@guattari.ru>2022-08-21 11:23:55 +0400
committerMitya Selivanov <0x7fffff@guattari.ru>2022-08-21 11:23:55 +0400
commitc870f5ab6271d2d1a52d170f740d96b259d1cb9a (patch)
tree636ac79ff8784f2417bb601f85b530d06c80be69 /source
parent2e7e1db63c5496e0de1cdcb8ed23e614acfd562a (diff)
downloadkit-c870f5ab6271d2d1a52d170f740d96b259d1cb9a.zip
Style
Diffstat (limited to 'source')
-rw-r--r--source/kit_test/test.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/kit_test/test.c b/source/kit_test/test.c
index 8e385f0..5e10021 100644
--- a/source/kit_test/test.c
+++ b/source/kit_test/test.c
@@ -119,8 +119,7 @@ int kit_run_tests(int argc, char **argv) {
no_color || print_color(yellow);
quiet ||
printf("[ RUN... ] %s ", kit_tests_list.tests[i].test_name);
- if (!carriage_return)
- quiet || printf("\n");
+ carriage_return || quiet || printf("\n");
no_color || print_color(white);
quiet || fflush(stdout);
@@ -133,8 +132,7 @@ int kit_run_tests(int argc, char **argv) {
int duration = (int) (ns_to_ms(end.tv_nsec - begin.tv_nsec) +
sec_to_ms(end.tv_sec - begin.tv_sec));
- if (carriage_return)
- quiet || printf("\r");
+ !carriage_return || quiet || printf("\r");
for (int j = 0; j < kit_tests_list.tests[i].assertions; j++)
if (kit_tests_list.tests[i].status[j] == 0) {
@@ -155,8 +153,7 @@ int kit_run_tests(int argc, char **argv) {
quiet ||
printf("[ FAILED ] %s", kit_tests_list.tests[i].test_name);
no_color || print_color(white);
- if (duration > 0)
- quiet || printf(" - %d ms", duration);
+ duration == 0 || quiet || printf(" - %d ms", duration);
quiet || printf("\n");
status = 1;
} else {
@@ -166,8 +163,7 @@ int kit_run_tests(int argc, char **argv) {
quiet ||
printf("[ OK ] %s", kit_tests_list.tests[i].test_name);
no_color || print_color(white);
- if (duration > 0)
- quiet || printf(" - %d ms", duration);
+ duration == 0 || quiet || printf(" - %d ms", duration);
quiet || printf("\n");
success_count++;
}