Update WolfSSL library to the latest version.

This commit is contained in:
Richard Barry 2015-08-28 13:46:22 +00:00
parent 8af1ad9bac
commit 5a6242fbd0
443 changed files with 70230 additions and 45414 deletions

View file

@ -1,9 +1,12 @@
/* unit.c unit tests driver */
/* Name change compatibility layer no longer need to be included here */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <stdio.h>
#include <tests/unit.h>
@ -11,9 +14,16 @@
int myoptind = 0;
char* myoptarg = NULL;
int unit_test(int argc, char** argv);
#ifndef NO_TESTSUITE_MAIN_DRIVER
int main(int argc, char** argv)
{
return unit_test(argc, argv);
}
#endif
int unit_test(int argc, char** argv)
{
int ret;
@ -27,15 +37,14 @@ int main(int argc, char** argv)
err_sys("Cavium OpenNitroxDevice failed");
#endif /* HAVE_CAVIUM */
#ifndef WOLFSSL_TIRTOS
if (CurrentDir("tests") || CurrentDir("_build"))
ChangeDirBack(1);
else if (CurrentDir("Debug") || CurrentDir("Release"))
ChangeDirBack(3);
#endif
if ( (ret = ApiTest()) != 0) {
printf("api test failed with %d\n", ret);
return ret;
}
ApiTest();
if ( (ret = HashTest()) != 0){
printf("hash test failed with %d\n", ret);
@ -85,6 +94,17 @@ void start_thread(THREAD_FUNC fun, func_args* args, THREAD_TYPE* thread)
#elif defined(_POSIX_THREADS) && !defined(__MINGW32__)
pthread_create(thread, 0, fun, args);
return;
#elif defined (WOLFSSL_TIRTOS)
/* Initialize the defaults and set the parameters. */
Task_Params taskParams;
Task_Params_init(&taskParams);
taskParams.arg0 = (UArg)args;
taskParams.stackSize = 65535;
*thread = Task_create((Task_FuncPtr)fun, &taskParams, NULL);
if (*thread == NULL) {
printf("Failed to create new Task\n");
}
Task_yield();
#else
*thread = (THREAD_TYPE)_beginthreadex(0, 0, fun, args, 0, 0);
#endif
@ -97,6 +117,14 @@ void join_thread(THREAD_TYPE thread)
(void)thread;
#elif defined(_POSIX_THREADS) && !defined(__MINGW32__)
pthread_join(thread, 0);
#elif defined (WOLFSSL_TIRTOS)
while(1) {
if (Task_getMode(thread) == Task_Mode_TERMINATED) {
Task_sleep(5);
break;
}
Task_yield();
}
#else
int res = WaitForSingleObject((HANDLE)thread, INFINITE);
assert(res == WAIT_OBJECT_0);