add custom print to test.c for PB

pull/1686/head
Chris Conlon 2017-04-07 14:10:28 -06:00
parent eeb50099d9
commit f59fb0df8e
1 changed files with 22 additions and 0 deletions

View File

@ -201,6 +201,11 @@
void BSP_Ser_Printf (CPU_CHAR* format, ...);
#undef printf
#define printf BSP_Ser_Printf
#elif defined(WOLFSSL_PB)
#include <stdarg.h>
int wolfssl_pb_print(const char*, ...);
#undef printf
#define printf wolfssl_pb_print
#endif
#include "wolfcrypt/test/test.h"
@ -400,6 +405,23 @@ static void myFipsCb(int ok, int err, const char* hash)
#endif
#endif
#ifdef WOLFSSL_PB
int wolfssl_pb_print(const char* msg, ...)
{
int ret;
va_list args;
char tmpBuf[80];
va_start(args, msg);
ret = vsprint(tmpBuf, msg, args);
va_end(args);
fnDumpStringToSystemLog(tmpBuf);
return ret;
}
#endif /* WOLFSSL_PB */
#ifdef HAVE_STACK_SIZE
THREAD_RETURN WOLFSSL_THREAD wolfcrypt_test(void* args)
#else