From 9ec6d45e99f259716bd957a09ec3c86c9479ccfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 2 Sep 2024 12:41:05 +0200 Subject: [PATCH] Fix code style (for real this time, hopefully) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For some reason I didn't think about other files in the previous commit. Signed-off-by: Manuel Pégourié-Gonnard --- tests/include/test/bignum_codepath_check.h | 10 ++++++---- tests/src/bignum_codepath_check.c | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/include/test/bignum_codepath_check.h b/tests/include/test/bignum_codepath_check.h index 34dfc5651c..2f954e94fa 100644 --- a/tests/include/test/bignum_codepath_check.h +++ b/tests/include/test/bignum_codepath_check.h @@ -59,11 +59,12 @@ static inline void mbedtls_codepath_reset(void) */ #define ASSERT_BIGNUM_CODEPATH(path, ret, E) \ do { \ - if((ret)!=0 || (E).n == 0) \ + if ((ret) != 0 || (E).n == 0) { \ TEST_ASSERT(mbedtls_codepath_check == (path) || \ mbedtls_codepath_check == MBEDTLS_MPI_IS_TEST); \ - else \ + } else { \ TEST_EQUAL(mbedtls_codepath_check, (path)); \ + } \ } while (0) /** Check the codepath taken and fail if it doesn't match. @@ -80,11 +81,12 @@ static inline void mbedtls_codepath_reset(void) */ #define ASSERT_RSA_CODEPATH(path, ret) \ do { \ - if((ret)!=0) \ + if ((ret) != 0) { \ TEST_ASSERT(mbedtls_codepath_check == (path) || \ mbedtls_codepath_check == MBEDTLS_MPI_IS_TEST); \ - else \ + } else { \ TEST_EQUAL(mbedtls_codepath_check, (path)); \ + } \ } while (0) #endif /* MBEDTLS_TEST_HOOKS && !MBEDTLS_THREADING_C */ diff --git a/tests/src/bignum_codepath_check.c b/tests/src/bignum_codepath_check.c index b6b85d9aba..b752d13f82 100644 --- a/tests/src/bignum_codepath_check.c +++ b/tests/src/bignum_codepath_check.c @@ -13,7 +13,7 @@ int mbedtls_codepath_check = MBEDTLS_MPI_IS_TEST; void mbedtls_codepath_take_safe(void) { - if(mbedtls_codepath_check == MBEDTLS_MPI_IS_TEST) { + if (mbedtls_codepath_check == MBEDTLS_MPI_IS_TEST) { mbedtls_codepath_check = MBEDTLS_MPI_IS_SECRET; } } @@ -36,4 +36,3 @@ void mbedtls_codepath_test_hooks_teardown(void) } #endif /* MBEDTLS_TEST_HOOKS && !MBEDTLS_THREADING_C */ -