summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/mpc-tests.h3
-rw-r--r--tests/random.c2
-rw-r--r--tests/tpow_si.c7
-rw-r--r--tests/tpow_ui.c7
-rw-r--r--tests/tsqr.c3
5 files changed, 7 insertions, 15 deletions
diff --git a/tests/mpc-tests.h b/tests/mpc-tests.h
index 1111d92..2ca9232 100644
--- a/tests/mpc-tests.h
+++ b/tests/mpc-tests.h
@@ -57,13 +57,10 @@ along with this program. If not, see http://www.gnu.org/licenses/ .
gmp_randstate_t rands) in your tests
- add test_end at the end the test function */
extern gmp_randstate_t rands;
-extern char rands_initialized;
extern void test_start (void);
extern void test_end (void);
-
extern void test_default_random (mpc_ptr, mp_exp_t, mp_exp_t, unsigned int, unsigned int);
-extern unsigned long urandomm_ui (unsigned long);
/** COMPARISON FUNCTIONS **/
diff --git a/tests/random.c b/tests/random.c
index 8acae3b..1c5cdb5 100644
--- a/tests/random.c
+++ b/tests/random.c
@@ -40,7 +40,7 @@ along with this program. If not, see http://www.gnu.org/licenses/ .
#endif
gmp_randstate_t rands;
-char rands_initialized;
+static char rands_initialized;
void
test_start (void)
diff --git a/tests/tpow_si.c b/tests/tpow_si.c
index 3c3131d..a3cbfb7 100644
--- a/tests/tpow_si.c
+++ b/tests/tpow_si.c
@@ -29,10 +29,8 @@ compare_mpc_pow (mpfr_prec_t pmax, int iter, unsigned long nbits)
mpc_t x, y, z, t;
long n;
int i, inex_pow, inex_pow_si;
- gmp_randstate_t state;
mpc_rnd_t rnd;
- gmp_randinit_default (state);
mpc_init3 (y, sizeof (unsigned long) * CHAR_BIT, MPFR_PREC_MIN);
for (p = MPFR_PREC_MIN; p <= pmax; p++)
for (i = 0; i < iter; i++)
@@ -40,8 +38,8 @@ compare_mpc_pow (mpfr_prec_t pmax, int iter, unsigned long nbits)
mpc_init2 (x, p);
mpc_init2 (z, p);
mpc_init2 (t, p);
- mpc_urandom (x, state);
- n = (signed long) gmp_urandomb_ui (state, nbits);
+ mpc_urandom (x, rands);
+ n = (signed long) gmp_urandomb_ui (rands, nbits);
mpc_set_si (y, n, MPC_RNDNN);
for (rnd = 0; rnd < 16; rnd ++)
{
@@ -74,7 +72,6 @@ compare_mpc_pow (mpfr_prec_t pmax, int iter, unsigned long nbits)
mpc_clear (t);
}
mpc_clear (y);
- gmp_randclear (state);
}
int
diff --git a/tests/tpow_ui.c b/tests/tpow_ui.c
index 0c58117..4e8cd31 100644
--- a/tests/tpow_ui.c
+++ b/tests/tpow_ui.c
@@ -28,10 +28,8 @@ compare_mpc_pow (mpfr_prec_t pmax, int iter, unsigned long nbits)
mpc_t x, y, z, t;
unsigned long n;
int i, inex_pow, inex_pow_ui;
- gmp_randstate_t state;
mpc_rnd_t rnd;
- gmp_randinit_default (state);
mpc_init3 (y, sizeof (unsigned long) * CHAR_BIT, MPFR_PREC_MIN);
for (p = MPFR_PREC_MIN; p <= pmax; p++)
for (i = 0; i < iter; i++)
@@ -39,8 +37,8 @@ compare_mpc_pow (mpfr_prec_t pmax, int iter, unsigned long nbits)
mpc_init2 (x, p);
mpc_init2 (z, p);
mpc_init2 (t, p);
- mpc_urandom (x, state);
- n = gmp_urandomb_ui (state, nbits); /* 0 <= n < 2^nbits */
+ mpc_urandom (x, rands);
+ n = gmp_urandomb_ui (rands, nbits); /* 0 <= n < 2^nbits */
mpc_set_ui (y, n, MPC_RNDNN);
for (rnd = 0; rnd < 16; rnd ++)
{
@@ -73,7 +71,6 @@ compare_mpc_pow (mpfr_prec_t pmax, int iter, unsigned long nbits)
mpc_clear (t);
}
mpc_clear (y);
- gmp_randclear (state);
}
int
diff --git a/tests/tsqr.c b/tests/tsqr.c
index 897cbd1..4c5003a 100644
--- a/tests/tsqr.c
+++ b/tests/tsqr.c
@@ -22,7 +22,8 @@ along with this program. If not, see http://www.gnu.org/licenses/ .
#include <stdlib.h>
#include "mpc-tests.h"
-static void cmpsqr (mpc_srcptr x, mpc_rnd_t rnd)
+static void
+cmpsqr (mpc_srcptr x, mpc_rnd_t rnd)
/* computes the square of x with the specific function or by simple */
/* multiplication using the rounding mode rnd and compares the results */
/* and return values. */