Prepare codepath tests for early termination

Signed-off-by: Janos Follath <janos.follath@arm.com>
diff --git a/tests/suites/test_suite_rsa.function b/tests/suites/test_suite_rsa.function
index 75f3f42..98ea9ef 100644
--- a/tests/suites/test_suite_rsa.function
+++ b/tests/suites/test_suite_rsa.function
@@ -496,7 +496,7 @@
 #endif
     TEST_ASSERT(mbedtls_rsa_public(&ctx, message_str->x, output) == result);
 #if defined(MBEDTLS_TEST_HOOKS) && !defined(MBEDTLS_THREADING_C)
-    TEST_EQUAL(mbedtls_codepath_check, MBEDTLS_MPI_IS_PUBLIC);
+    ASSERT_RSA_CODEPATH(MBEDTLS_MPI_IS_PUBLIC, result);
 #endif
     if (result == 0) {
 
@@ -569,7 +569,7 @@
                                         &rnd_info, message_str->x,
                                         output) == result);
 #if defined(MBEDTLS_TEST_HOOKS) && !defined(MBEDTLS_THREADING_C)
-        TEST_EQUAL(mbedtls_codepath_check, MBEDTLS_MPI_IS_SECRET);
+        ASSERT_RSA_CODEPATH(MBEDTLS_MPI_IS_SECRET, result);
 #endif
         if (result == 0) {