From ebc2478e064a7941f4c19c359e1f5666fe073cf3 Mon Sep 17 00:00:00 2001 From: Xiaokang Qian Date: Thu, 25 May 2023 06:22:29 +0000 Subject: [PATCH] Move const result to the first parameter Signed-off-by: Xiaokang Qian --- tests/suites/test_suite_ecp.function | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/suites/test_suite_ecp.function b/tests/suites/test_suite_ecp.function index 7675fd9b2..2e2605bfd 100644 --- a/tests/suites/test_suite_ecp.function +++ b/tests/suites/test_suite_ecp.function @@ -1579,7 +1579,7 @@ void ecp_mod_read_write(char *input_A, int id, int ctype) TEST_EQUAL(0, mbedtls_ecp_modulus_setup(&m, id, ctype)); - TEST_EQUAL(mbedtls_test_read_mpi_core(&A, &limbs, input_A), 0); + TEST_EQUAL(0, mbedtls_test_read_mpi_core(&A, &limbs, input_A)); TEST_EQUAL(0, mbedtls_mpi_mod_residue_setup(&rA, &m, A, limbs)); /* Test for limb sizes */ @@ -1589,11 +1589,12 @@ void ecp_mod_read_write(char *input_A, int id, int ctype) TEST_EQUAL(0, mbedtls_mpi_mod_residue_setup(&rX, &m, rX_raw, limbs)); ASSERT_ALLOC(bufx, limbs); - TEST_EQUAL(mbedtls_mpi_mod_write(&rA, &m, (unsigned char *) bufx, - limbs * ciL, - MBEDTLS_MPI_MOD_EXT_REP_LE), 0); + TEST_EQUAL(0, mbedtls_mpi_mod_write(&rA, &m, (unsigned char *) bufx, + limbs * ciL, + MBEDTLS_MPI_MOD_EXT_REP_LE)); - TEST_EQUAL(0, mbedtls_mpi_mod_read(&rX, &m, (unsigned char *) bufx, limbs * ciL, + TEST_EQUAL(0, mbedtls_mpi_mod_read(&rX, &m, (unsigned char *) bufx, + limbs * ciL, MBEDTLS_MPI_MOD_EXT_REP_LE)); TEST_EQUAL(rA.limbs, rX.limbs); @@ -1625,8 +1626,8 @@ void ecp_mod_random(int id, int ctype) ASSERT_ALLOC(rX_raw, limbs); TEST_EQUAL(0, mbedtls_mpi_mod_residue_setup(&rX, &m, rX_raw, limbs)); - TEST_EQUAL(mbedtls_mpi_mod_random(&rX, 1, &m, - mbedtls_test_rnd_std_rand, NULL), 0); + TEST_EQUAL(0, mbedtls_mpi_mod_random(&rX, 1, &m, + mbedtls_test_rnd_std_rand, NULL)); TEST_ASSERT(mbedtls_mpi_core_lt_ct(rX.p, m.p, limbs) == 1);