Ensure tests expected to fail actually fail

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function
index 7c3e990..f9f013a 100644
--- a/tests/suites/test_suite_psa_crypto.function
+++ b/tests/suites/test_suite_psa_crypto.function
@@ -524,16 +524,18 @@
                                      ( input_data->x + data_true_size ),
                                      tag_length );
 
-        if( status != PSA_SUCCESS )
+        if( expect_valid_signature )
+            PSA_ASSERT( status );
+        else
         {
-            if( !expect_valid_signature )
+            TEST_ASSERT( status != PSA_SUCCESS );
+
+            if( status != PSA_SUCCESS )
             {
                 /* Expected failure. */
                 test_ok = 1;
                 goto exit;
             }
-            else
-                PSA_ASSERT( status );
         }
     }