Clean up debug logging story.

This commit is contained in:
Ian Gulliver
2015-06-20 15:32:57 +00:00
parent 7ab52899de
commit a994c7e7ec
3 changed files with 31 additions and 19 deletions

View File

@@ -147,11 +147,11 @@ json_t *random_message() {
void run_test(const char *func_name, bool (*test)(test_state *)) {
test_state *state = create_test_state();
fprintf(stderr, ANSI_COLOR_YELLOW "%50s" ANSI_COLOR_RESET ": ", func_name);
fprintf(stderr, ANSI_COLOR_YELLOW "%s" ANSI_COLOR_RESET ":\n", func_name);
if (test(state)) {
fprintf(stderr, ANSI_COLOR_GREEN "PASS" ANSI_COLOR_RESET "\n");
fprintf(stderr, ANSI_COLOR_GREEN "PASS" ANSI_COLOR_RESET "\n\n");
} else {
fprintf(stderr, ANSI_COLOR_RED "FAIL" ANSI_COLOR_RESET "\n");
fprintf(stderr, ANSI_COLOR_RED "FAIL" ANSI_COLOR_RESET "\n\n");
}
destroy_test_state(state);
}