From a98d4798b16a0d2afefe143a4e8fce70f4b209b9 Mon Sep 17 00:00:00 2001 From: rizlik Date: Tue, 12 May 2026 18:54:55 +0200 Subject: [PATCH] tests: swdev: api: init/deinit swdev in TestSetup/TestCleanup --- tests/api.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/api.c b/tests/api.c index 699d72e19f..7c143077b9 100644 --- a/tests/api.c +++ b/tests/api.c @@ -40799,7 +40799,11 @@ TEST_CASE testCases[] = { static void TestSetup(void) { -/* Stub, for now. Add common test setup code here. */ +#ifdef WOLFSSL_SWDEV + /* Re-arm the swdev cryptocb registration in case the previous test + * tore down wolfCrypt and wiped gCryptoDev. */ + (void)wc_SwDev_Init(); +#endif } static void TestCleanup(void) @@ -40808,6 +40812,9 @@ static void TestCleanup(void) /* Clear any errors added to the error queue during the test run. */ wolfSSL_ERR_clear_error(); #endif /* OPENSSL_EXTRA || DEBUG_WOLFSSL_VERBOSE */ +#ifdef WOLFSSL_SWDEV + wc_SwDev_Cleanup(); +#endif } void ApiTest_StopOnFail(void)