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");
|
printf(" Begin API Tests\n");
|
||||||
fflush(stdout);
|
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) {
|
for (i = 0; i < TEST_CASE_CNT; ++i) {
|
||||||
/* When not testing all cases then skip if not marked for running. */
|
/* When not testing all cases then skip if not marked for running. */
|
||||||
if (!testAll && !testCases[i].run) {
|
if (!testAll && !testCases[i].run) {
|
||||||
@ -62983,7 +62992,13 @@ void ApiTest(void)
|
|||||||
wc_ecc_fp_free(); /* free per thread cache */
|
wc_ecc_fp_free(); /* free per thread cache */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wolfSSL_Cleanup();
|
if (!testAll) {
|
||||||
|
#ifdef WOLFCRYPT_ONLY
|
||||||
|
wolfCrypt_Cleanup();
|
||||||
|
#else
|
||||||
|
wolfSSL_Cleanup();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
(void)testDevId;
|
(void)testDevId;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user