From: Niels Möller Date: Sun, 6 Jan 2019 10:11:15 +0000 (+0100) Subject: tests: Fix assert call with side effects. X-Git-Tag: nettle_3.5rc1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f5b9812dec00811344ab080444c0582f6405533;p=thirdparty%2Fnettle.git tests: Fix assert call with side effects. (cherry picked from commit 73d3c6d5586cc0fd81eab081078144d621de07b4) --- diff --git a/ChangeLog b/ChangeLog index cdf215bd..d7dac085 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,11 @@ * sha512-compress.c: Add missing include of sha2-internal.h. +2019-01-06 Niels Möller + + * testsuite/rsa-compute-root-test.c (generate_keypair): Fix assert + call with side-effects. + 2018-12-26 Niels Möller * examples/hogweed-benchmark.c (make_openssl_rsa_ctx): New helper diff --git a/testsuite/rsa-compute-root-test.c b/testsuite/rsa-compute-root-test.c index e7bdb1f8..42ea0af7 100644 --- a/testsuite/rsa-compute-root-test.c +++ b/testsuite/rsa-compute-root-test.c @@ -86,6 +86,7 @@ generate_keypair (gmp_randstate_t rands, mpz_t q1; mpz_t phi; mpz_t tmp; + int res; mpz_init (p1); mpz_init (q1); @@ -124,7 +125,8 @@ generate_keypair (gmp_randstate_t rands, } mpz_mul(phi, p1, q1); - assert (mpz_invert(key->d, pub->e, phi)); + res = mpz_invert(key->d, pub->e, phi); + assert (res); mpz_fdiv_r (key->a, key->d, p1); mpz_fdiv_r (key->b, key->d, q1);