From acfdc623d2d47457a1f4c98bc4db373b5d143e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 11 Dec 2018 10:36:21 +0100 Subject: [PATCH] Fix test macro that was too lenient Previously, one could change the definition of AES_VALIDATE_RET() to return some other code than MBEDTLS_ERR_AES_BAD_INPUT_DATA, and the test suite wouldn't notice. Now this modification would make the suite fail as expected. --- tests/suites/helpers.function | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/suites/helpers.function b/tests/suites/helpers.function index 57bc25913..b5bd31e74 100644 --- a/tests/suites/helpers.function +++ b/tests/suites/helpers.function @@ -133,7 +133,7 @@ typedef enum #define TEST_INVALID_PARAM_RET( PARAM_ERR_VALUE, TEST ) \ do { \ test_info.paramfail_test_state = PARAMFAIL_TESTSTATE_PENDING; \ - if( (TEST) != (PARAM_ERR_VALUE) && \ + if( (TEST) != (PARAM_ERR_VALUE) || \ test_info.paramfail_test_state != PARAMFAIL_TESTSTATE_CALLED ) \ { \ test_fail( #TEST, __LINE__, __FILE__ ); \