forked from wolfSSL/wolfssl
Fix to make sure API unit test always calls init/cleanup when not running all tests.
This commit is contained in:
17
tests/api.c
17
tests/api.c
@ -62942,6 +62942,15 @@ void ApiTest(void)
|
||||
printf(" Begin API Tests\n");
|
||||
fflush(stdout);
|
||||
|
||||
/* we must perform init and cleanup if not all tests are running */
|
||||
if (!testAll) {
|
||||
#ifdef WOLFCRYPT_ONLY
|
||||
wolfCrypt_Init();
|
||||
#else
|
||||
wolfSSL_Init();
|
||||
#endif
|
||||
}
|
||||
|
||||
for (i = 0; i < TEST_CASE_CNT; ++i) {
|
||||
/* When not testing all cases then skip if not marked for running. */
|
||||
if (!testAll && !testCases[i].run) {
|
||||
@ -62983,7 +62992,13 @@ void ApiTest(void)
|
||||
wc_ecc_fp_free(); /* free per thread cache */
|
||||
#endif
|
||||
|
||||
wolfSSL_Cleanup();
|
||||
if (!testAll) {
|
||||
#ifdef WOLFCRYPT_ONLY
|
||||
wolfCrypt_Cleanup();
|
||||
#else
|
||||
wolfSSL_Cleanup();
|
||||
#endif
|
||||
}
|
||||
|
||||
(void)testDevId;
|
||||
|
||||
|
Reference in New Issue
Block a user