From 2bd761bb4cb6766dbd90b637718d7633ef5a9343 Mon Sep 17 00:00:00 2001 From: Ethan Looney Date: Thu, 22 Oct 2020 14:51:07 -0600 Subject: [PATCH] Added a case for logging.c unit test with debug not enabled --- tests/api.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/api.c b/tests/api.c index d51d17e3c..18dc22b6a 100644 --- a/tests/api.c +++ b/tests/api.c @@ -29171,8 +29171,8 @@ static void Logging_cb(const int logLevel, const char *const logMessage) static int test_wolfSSL_GetLoggingCb (void) { int ret = 0; -#ifdef DEBUG_WOLFSSL printf(testingFmt, "wolfSSL_GetLoggingCb()"); +#ifdef DEBUG_WOLFSSL /* Testing without wolfSSL_SetLoggingCb() */ if (ret == 0) { @@ -29200,8 +29200,23 @@ static int test_wolfSSL_GetLoggingCb (void) wolfSSL_SetLoggingCb(NULL); } } - printf(resultFmt, ret == 0 ? passed : failed); #endif + if (ret == 0) { + //ret = wolfSSL_SetLoggingCb(Logging_cb); + if (ret == 0) { + if (wolfSSL_GetLoggingCb() == NULL) { + ret = 0; + } + if (wolfSSL_GetLoggingCb() != NULL) { + ret = -1; + } + } + } + + + + printf(resultFmt, ret == 0 ? passed : failed); + return ret; }/*End test_wolfSSL_GetLoggingCb*/