From 0d4425260811ae4b3f33d9d598013628f539dbe8 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Sat, 8 Sep 2018 10:19:31 +0900 Subject: [PATCH] error pass though build flag WOLFSSL_PASSTHRU_ERR --- tests/api.c | 2 -- tests/unit.h | 12 +++++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/api.c b/tests/api.c index df537745f..86240138f 100644 --- a/tests/api.c +++ b/tests/api.c @@ -442,8 +442,6 @@ static int test_wolfCrypt_Init(void) static int test_fileAccess() { - if(unit_PassThrough == 1)XABORT(); /* do nothing. use the flag at least once. */ - #if defined(WOLFSSL_TEST_PLATFORMDEPEND) && !defined(NO_FILESYSTEM) const char *fname[] = { diff --git a/tests/unit.h b/tests/unit.h index 20dc47965..ee13c756f 100644 --- a/tests/unit.h +++ b/tests/unit.h @@ -33,14 +33,20 @@ #endif -static int unit_PassThrough = 0; - +#ifndef WOLFSSL_PASSTHRU_ERR #define Fail(description, result) do { \ printf("\nERROR - %s line %d failed with:", __FILE__, __LINE__); \ printf("\n expected: "); printf description; \ printf("\n result: "); printf result; printf("\n\n"); \ - if(unit_PassThrough == 0)XABORT(); \ + XABORT(); \ } while(0) +#else +#define Fail(description, result) do { \ + printf("\nERROR - %s line %d failed with:", __FILE__, __LINE__); \ + printf("\n expected: ");printf description; \ + printf("\n result: "); printf result; printf("\n\n"); \ +} while (0) +#endif #define Assert(test, description, result) if (!(test)) Fail(description, result)