Allow multiple return statuses where reasonable
psa_aead_verify always outputs 0 bytes in Mbed TLS, so accept
PSA_SUCCESS as well in the small buffer test.
Allow psa_aead_setup to return PSA_ERROR_NOT_SUPPORTED for incompatible
algorithm / key type pairs in addition to PSA_ERROR_INVALID_ARGUMENT.
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
diff --git a/api-tests/val/common/val.h b/api-tests/val/common/val.h
index 88bab7b..31b425c 100644
--- a/api-tests/val/common/val.h
+++ b/api-tests/val/common/val.h
@@ -138,8 +138,15 @@
{ \
val->print(PRINT_ERROR, "\tFailed at Checkpoint: %d\n", checkpoint); \
val->print(PRINT_ERROR, "\tActual: %d\n", arg1); \
- val->print(PRINT_ERROR, "\tExpected: %d", status1); \
- val->print(PRINT_ERROR, "or %d\n", status2); \
+ if ((status1) != (status2)) \
+ { \
+ val->print(PRINT_ERROR, "\tExpected: %d", status1); \
+ val->print(PRINT_ERROR, "or %d\n", status2); \
+ } \
+ else \
+ { \
+ val->print(PRINT_ERROR, "\tExpected: %d\n", status1); \
+ } \
return 1; \
} \
} while (0)