Fix to make sure API unit test always calls init/cleanup when not running all tests.

This commit is contained in:
David Garske
2023-02-15 14:24:22 -08:00
parent 6ea3fe2f7a
commit 47801107da

View File

@ -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;