From 562ffa391e80720126bd124ae58c5deeddb3c962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Thu, 11 May 2017 00:04:54 +0200 Subject: [PATCH] Slight cleanup. --- include/cryb/test.h | 4 ++-- lib/test/cryb_t_main.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/cryb/test.h b/include/cryb/test.h index 340d7f8..2b94ccd 100644 --- a/include/cryb/test.h +++ b/include/cryb/test.h @@ -75,7 +75,7 @@ void t_printv_hex(const uint8_t *, size_t); void t_printv(const char *, ...) CRYB_PRINTF(1, 2); -#ifdef _IONBF /* proxy for */ +#if CRYB_TEST_HAVE_STDIO /* * Convenience functions for temp files */ @@ -164,7 +164,7 @@ void t_assertion_failed(const char *, const char *, unsigned int, t_assertion_failed(__func__, __FILE__, \ __LINE__, "%s", #exp); \ } while (0) - + CRYB_END #endif diff --git a/lib/test/cryb_t_main.c b/lib/test/cryb_t_main.c index 3a4f528..993e0f9 100644 --- a/lib/test/cryb_t_main.c +++ b/lib/test/cryb_t_main.c @@ -317,11 +317,15 @@ t_main(t_prepare_func t_prepare, t_cleanup_func t_cleanup, } free(t_plan); setvbuf(stdout, NULL, _IONBF, 0); + + /* check for memory leaks */ if (leaktest) { if (t_verbose) t_malloc_printstats(stderr); t_run_test(&t_memory_leak, nt) ? ++pass : ++fail; } + + /* result */ t_printv("%d out of %zd tests passed\n", pass, nt); exit(fail > 0 ? 1 : 0); }