Slight cleanup.

This commit is contained in:
Dag-Erling Smørgrav 2017-05-11 00:04:54 +02:00
parent 8e0f4a293e
commit 562ffa391e
2 changed files with 6 additions and 2 deletions

View file

@ -75,7 +75,7 @@ void t_printv_hex(const uint8_t *, size_t);
void t_printv(const char *, ...) void t_printv(const char *, ...)
CRYB_PRINTF(1, 2); CRYB_PRINTF(1, 2);
#ifdef _IONBF /* proxy for <stdio.h> */ #if CRYB_TEST_HAVE_STDIO
/* /*
* Convenience functions for temp files * Convenience functions for temp files
*/ */

View file

@ -317,11 +317,15 @@ t_main(t_prepare_func t_prepare, t_cleanup_func t_cleanup,
} }
free(t_plan); free(t_plan);
setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0);
/* check for memory leaks */
if (leaktest) { if (leaktest) {
if (t_verbose) if (t_verbose)
t_malloc_printstats(stderr); t_malloc_printstats(stderr);
t_run_test(&t_memory_leak, nt) ? ++pass : ++fail; t_run_test(&t_memory_leak, nt) ? ++pass : ++fail;
} }
/* result */
t_printv("%d out of %zd tests passed\n", pass, nt); t_printv("%d out of %zd tests passed\n", pass, nt);
exit(fail > 0 ? 1 : 0); exit(fail > 0 ? 1 : 0);
} }