Skip to content

Commit 07c0033

Browse files
Use TEST_FAIL rather than a TEST_ASSERT(!"...") hack
This gets rid of a warning from IAR. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
1 parent c86e2ba commit 07c0033

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

tests/suites/test_suite_psa_crypto.function

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,8 @@ static void ecjpake_do_round(psa_algorithm_t alg, unsigned int primitive,
832832

833833
/* Error didn't trigger, make test fail */
834834
if (inject_error == 1) {
835-
TEST_ASSERT(
836-
!"One of the last psa_pake_input() calls should have returned the expected error.");
835+
TEST_FAIL(
836+
"One of the last psa_pake_input() calls should have returned the expected error.");
837837
}
838838
}
839839

@@ -938,8 +938,8 @@ static void ecjpake_do_round(psa_algorithm_t alg, unsigned int primitive,
938938

939939
/* Error didn't trigger, make test fail */
940940
if (inject_error == 1) {
941-
TEST_ASSERT(
942-
!"One of the last psa_pake_input() calls should have returned the expected error.");
941+
TEST_FAIL(
942+
"One of the last psa_pake_input() calls should have returned the expected error.");
943943
}
944944
}
945945

@@ -1006,8 +1006,8 @@ static void ecjpake_do_round(psa_algorithm_t alg, unsigned int primitive,
10061006

10071007
/* Error didn't trigger, make test fail */
10081008
if (inject_error == 2) {
1009-
TEST_ASSERT(
1010-
!"One of the last psa_pake_input() calls should have returned the expected error.");
1009+
TEST_FAIL(
1010+
"One of the last psa_pake_input() calls should have returned the expected error.");
10111011
}
10121012

10131013
break;
@@ -1073,8 +1073,8 @@ static void ecjpake_do_round(psa_algorithm_t alg, unsigned int primitive,
10731073

10741074
/* Error didn't trigger, make test fail */
10751075
if (inject_error == 3) {
1076-
TEST_ASSERT(
1077-
!"One of the last psa_pake_input() calls should have returned the expected error.");
1076+
TEST_FAIL(
1077+
"One of the last psa_pake_input() calls should have returned the expected error.");
10781078
}
10791079
}
10801080

@@ -1133,8 +1133,8 @@ static void ecjpake_do_round(psa_algorithm_t alg, unsigned int primitive,
11331133

11341134
/* Error didn't trigger, make test fail */
11351135
if (inject_error == 3) {
1136-
TEST_ASSERT(
1137-
!"One of the last psa_pake_input() calls should have returned the expected error.");
1136+
TEST_FAIL(
1137+
"One of the last psa_pake_input() calls should have returned the expected error.");
11381138
}
11391139
}
11401140

@@ -1173,8 +1173,8 @@ static void ecjpake_do_round(psa_algorithm_t alg, unsigned int primitive,
11731173

11741174
/* Error didn't trigger, make test fail */
11751175
if (inject_error == 4) {
1176-
TEST_ASSERT(
1177-
!"One of the last psa_pake_input() calls should have returned the expected error.");
1176+
TEST_FAIL(
1177+
"One of the last psa_pake_input() calls should have returned the expected error.");
11781178
}
11791179

11801180
break;

tests/suites/test_suite_psa_crypto_pake.function

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ static void ecjpake_do_round(psa_algorithm_t alg, unsigned int primitive,
254254
/* Error didn't trigger, make test fail */
255255
if ((err_stage >= ERR_INJECT_ROUND1_SERVER_KEY_SHARE_PART1) &&
256256
(err_stage <= ERR_INJECT_ROUND1_SERVER_ZK_PROOF_PART2)) {
257-
TEST_ASSERT(
258-
!"One of the last psa_pake_input() calls should have returned the expected error.");
257+
TEST_FAIL(
258+
"One of the last psa_pake_input() calls should have returned the expected error.");
259259
}
260260
}
261261

@@ -348,8 +348,8 @@ static void ecjpake_do_round(psa_algorithm_t alg, unsigned int primitive,
348348
/* Error didn't trigger, make test fail */
349349
if ((err_stage >= ERR_INJECT_ROUND1_SERVER_KEY_SHARE_PART1) &&
350350
(err_stage <= ERR_INJECT_ROUND1_SERVER_ZK_PROOF_PART2)) {
351-
TEST_ASSERT(
352-
!"One of the last psa_pake_input() calls should have returned the expected error.");
351+
TEST_FAIL(
352+
"One of the last psa_pake_input() calls should have returned the expected error.");
353353
}
354354
}
355355

@@ -381,8 +381,8 @@ static void ecjpake_do_round(psa_algorithm_t alg, unsigned int primitive,
381381
/* Error didn't trigger, make test fail */
382382
if ((err_stage >= ERR_INJECT_ROUND1_CLIENT_KEY_SHARE_PART1) &&
383383
(err_stage <= ERR_INJECT_ROUND1_CLIENT_ZK_PROOF_PART2)) {
384-
TEST_ASSERT(
385-
!"One of the last psa_pake_input() calls should have returned the expected error.");
384+
TEST_FAIL(
385+
"One of the last psa_pake_input() calls should have returned the expected error.");
386386
}
387387

388388
break;
@@ -437,8 +437,8 @@ static void ecjpake_do_round(psa_algorithm_t alg, unsigned int primitive,
437437
/* Error didn't trigger, make test fail */
438438
if ((err_stage >= ERR_INJECT_ROUND2_SERVER_KEY_SHARE) &&
439439
(err_stage <= ERR_INJECT_ROUND2_SERVER_ZK_PROOF)) {
440-
TEST_ASSERT(
441-
!"One of the last psa_pake_input() calls should have returned the expected error.");
440+
TEST_FAIL(
441+
"One of the last psa_pake_input() calls should have returned the expected error.");
442442
}
443443
}
444444

@@ -501,8 +501,8 @@ static void ecjpake_do_round(psa_algorithm_t alg, unsigned int primitive,
501501
/* Error didn't trigger, make test fail */
502502
if ((err_stage >= ERR_INJECT_ROUND2_SERVER_KEY_SHARE) &&
503503
(err_stage <= ERR_INJECT_ROUND2_SERVER_ZK_PROOF)) {
504-
TEST_ASSERT(
505-
!"One of the last psa_pake_input() calls should have returned the expected error.");
504+
TEST_FAIL(
505+
"One of the last psa_pake_input() calls should have returned the expected error.");
506506
}
507507
}
508508

@@ -528,8 +528,8 @@ static void ecjpake_do_round(psa_algorithm_t alg, unsigned int primitive,
528528
/* Error didn't trigger, make test fail */
529529
if ((err_stage >= ERR_INJECT_ROUND2_CLIENT_KEY_SHARE) &&
530530
(err_stage <= ERR_INJECT_ROUND2_CLIENT_ZK_PROOF)) {
531-
TEST_ASSERT(
532-
!"One of the last psa_pake_input() calls should have returned the expected error.");
531+
TEST_FAIL(
532+
"One of the last psa_pake_input() calls should have returned the expected error.");
533533
}
534534

535535
break;

0 commit comments

Comments
 (0)