summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-01-27 00:20:16 +0100
committerKevin Ryde <user42@zip.com.au>2001-01-27 00:20:16 +0100
commitad695831d6a2a6e08188ee156f2fbe75d10b86fd (patch)
tree963adae7ed4dbf50b99ad0e8fefdb0422bec2f40
parentd58e4bc3d03c5ebd833c72d86fd1b8d60b7d84c6 (diff)
downloadgmp-ad695831d6a2a6e08188ee156f2fbe75d10b86fd.tar.gz
* tests/mpz/*.c, tests/mpq/*.c, tests/mpf/*.c: Uses tests_start and
tests_end.
-rw-r--r--tests/mpz/bit.c10
-rw-r--r--tests/mpz/dive.c12
-rw-r--r--tests/mpz/io-binary.c7
-rw-r--r--tests/mpz/io.c8
-rw-r--r--tests/mpz/logic.c14
-rw-r--r--tests/mpz/reuse.c17
-rw-r--r--tests/mpz/t-2exp.c15
-rw-r--r--tests/mpz/t-bin.c3
-rw-r--r--tests/mpz/t-fdiv.c15
-rw-r--r--tests/mpz/t-fdiv_ui.c14
-rw-r--r--tests/mpz/t-fib_ui.c8
-rw-r--r--tests/mpz/t-gcd.c17
-rw-r--r--tests/mpz/t-get_si.c4
-rw-r--r--tests/mpz/t-jac.c9
-rw-r--r--tests/mpz/t-misc.c3
-rw-r--r--tests/mpz/t-mul.c14
-rw-r--r--tests/mpz/t-pow_ui.c12
-rw-r--r--tests/mpz/t-powm.c16
-rw-r--r--tests/mpz/t-powm_ui.c14
-rw-r--r--tests/mpz/t-root.c12
-rw-r--r--tests/mpz/t-scan.c5
-rw-r--r--tests/mpz/t-sqrtrem.c13
-rw-r--r--tests/mpz/t-tdiv.c15
-rw-r--r--tests/mpz/t-tdiv_ui.c14
24 files changed, 270 insertions, 1 deletions
diff --git a/tests/mpz/bit.c b/tests/mpz/bit.c
index 0421fed08..c93afd295 100644
--- a/tests/mpz/bit.c
+++ b/tests/mpz/bit.c
@@ -101,6 +101,8 @@ main (int argc, char *argv[])
unsigned long int bitindex;
const char *s = "";
+ tests_start ();
+
if (argc == 2)
reps = atoi (argv[1]);
@@ -174,6 +176,14 @@ main (int argc, char *argv[])
abort ();
}
+ mpz_clear (x);
+ mpz_clear (s0);
+ mpz_clear (s1);
+ mpz_clear (s2);
+ mpz_clear (s3);
+ mpz_clear (m);
+
+ tests_end ();
exit (0);
diff --git a/tests/mpz/dive.c b/tests/mpz/dive.c
index 32ce48bee..8e16ef6ec 100644
--- a/tests/mpz/dive.c
+++ b/tests/mpz/dive.c
@@ -25,10 +25,12 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void dump_abort _PROTO ((mpz_t, mpz_t));
void debug_mp _PROTO ((mpz_t, int));
+int
main (int argc, char **argv)
{
mpz_t op1, op2;
@@ -41,6 +43,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -95,6 +99,14 @@ main (int argc, char **argv)
dump_abort (quot, op1);
}
+ mpz_clear (bs);
+ mpz_clear (op1);
+ mpz_clear (op2);
+ mpz_clear (prod);
+ mpz_clear (quot);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/io-binary.c b/tests/mpz/io-binary.c
index d0c4b6c75..3a7e364d4 100644
--- a/tests/mpz/io-binary.c
+++ b/tests/mpz/io-binary.c
@@ -28,9 +28,11 @@ MA 02111-1307, USA.
#include <stdio.h>
#include "gmp.h"
+#include "tests.h"
FILE *file;
+void
test (char *str, int binary_len, char *binary_str)
{
mpz_t x, y;
@@ -59,10 +61,14 @@ test (char *str, int binary_len, char *binary_str)
abort ();
mpz_clear (x);
+ mpz_clear (y);
}
+int
main ()
{
+ tests_start ();
+
file = fopen ("xtmpfile", "w+");
test ("0", 4,
@@ -90,5 +96,6 @@ main ()
test ("-0x123456789facade0", 12,
"\377\377\377\370\022\064\126\170\237\254\255\340");
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/io.c b/tests/mpz/io.c
index 134eecf67..6e65f0ad6 100644
--- a/tests/mpz/io.c
+++ b/tests/mpz/io.c
@@ -30,6 +30,7 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
#define FILENAME "io.tmp"
@@ -53,6 +54,7 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -128,5 +130,11 @@ main (int argc, char **argv)
unlink (FILENAME);
+ mpz_clear (bs);
+ mpz_clear (op1);
+ mpz_clear (op2);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/logic.c b/tests/mpz/logic.c
index 3b8cc324d..7e12f024b 100644
--- a/tests/mpz/logic.c
+++ b/tests/mpz/logic.c
@@ -25,10 +25,12 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void dump_abort _PROTO (());
void debug_mp _PROTO ((mpz_t, int));
+int
main (int argc, char **argv)
{
mpz_t x, y, r1, r2;
@@ -41,6 +43,7 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -142,6 +145,17 @@ main (int argc, char **argv)
dump_abort ();
}
+ mpz_clear (bs);
+ mpz_clear (x);
+ mpz_clear (y);
+ mpz_clear (r1);
+ mpz_clear (r2);
+ mpz_clear (t1);
+ mpz_clear (t2);
+ mpz_clear (t3);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/reuse.c b/tests/mpz/reuse.c
index 4fb8e6641..78f27103b 100644
--- a/tests/mpz/reuse.c
+++ b/tests/mpz/reuse.c
@@ -30,6 +30,7 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void dump (char *, mpz_t, mpz_t, mpz_t);
@@ -161,6 +162,7 @@ char *ds_func_names[] =
#endif
+int
main (int argc, char **argv)
{
int i;
@@ -178,6 +180,7 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -546,6 +549,20 @@ main (int argc, char **argv)
exit (1);
}
+ mpz_clear (bs);
+ mpz_clear (in1);
+ mpz_clear (in2);
+ mpz_clear (in3);
+ mpz_clear (ref1);
+ mpz_clear (ref2);
+ mpz_clear (ref3);
+ mpz_clear (res1);
+ mpz_clear (res2);
+ mpz_clear (res3);
+ mpz_clear (t);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-2exp.c b/tests/mpz/t-2exp.c
index 519a48ea9..3fdc9ebc6 100644
--- a/tests/mpz/t-2exp.c
+++ b/tests/mpz/t-2exp.c
@@ -26,7 +26,9 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
+int
main (int argc, char **argv)
{
mpz_t x, r1, r2, q1, q2, d, t;
@@ -39,6 +41,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -99,5 +103,16 @@ main (int argc, char **argv)
abort ();
}
+ mpz_clear (bs);
+ mpz_clear (x);
+ mpz_clear (q1);
+ mpz_clear (q2);
+ mpz_clear (r1);
+ mpz_clear (r2);
+ mpz_clear (d);
+ mpz_clear (t);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-bin.c b/tests/mpz/t-bin.c
index 3d28a6a20..ee21f6120 100644
--- a/tests/mpz/t-bin.c
+++ b/tests/mpz/t-bin.c
@@ -211,8 +211,11 @@ twos (void)
int
main (void)
{
+ tests_start ();
+
samples ();
twos ();
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-fdiv.c b/tests/mpz/t-fdiv.c
index e87df3d97..4a681298b 100644
--- a/tests/mpz/t-fdiv.c
+++ b/tests/mpz/t-fdiv.c
@@ -26,10 +26,12 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void dump_abort _PROTO ((mpz_t, mpz_t));
void debug_mp _PROTO ((mpz_t, int));
+int
main (int argc, char **argv)
{
mpz_t dividend, divisor;
@@ -44,6 +46,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -130,6 +134,17 @@ main (int argc, char **argv)
dump_abort (dividend, divisor);
}
+ mpz_clear (bs);
+ mpz_clear (dividend);
+ mpz_clear (divisor);
+ mpz_clear (quotient);
+ mpz_clear (remainder);
+ mpz_clear (quotient2);
+ mpz_clear (remainder2);
+ mpz_clear (temp);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-fdiv_ui.c b/tests/mpz/t-fdiv_ui.c
index 985f91aa2..7dfa5fec1 100644
--- a/tests/mpz/t-fdiv_ui.c
+++ b/tests/mpz/t-fdiv_ui.c
@@ -26,10 +26,12 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void dump_abort _PROTO ((mpz_t, mp_limb_t));
void debug_mp _PROTO ((mpz_t, int));
+int
main (int argc, char **argv)
{
mpz_t dividend;
@@ -45,6 +47,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -126,6 +130,16 @@ main (int argc, char **argv)
dump_abort (dividend, divisor);
}
+ mpz_clear (bs);
+ mpz_clear (dividend);
+ mpz_clear (quotient);
+ mpz_clear (remainder);
+ mpz_clear (quotient2);
+ mpz_clear (remainder2);
+ mpz_clear (temp);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-fib_ui.c b/tests/mpz/t-fib_ui.c
index b59039513..a76201243 100644
--- a/tests/mpz/t-fib_ui.c
+++ b/tests/mpz/t-fib_ui.c
@@ -23,6 +23,7 @@ MA 02111-1307, USA. */
#include <stdlib.h>
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
/* Usage: t-fib_ui [x|num]
@@ -47,6 +48,8 @@ main (int argc, char *argv[])
unsigned long limit = MAX (2000, 32*FIB_THRESHOLD);
mpz_t fn, fn1, r;
+ tests_start ();
+
if (argc > 1 && argv[1][0] == 'x')
limit = ULONG_MAX;
else if (argc > 1)
@@ -99,5 +102,10 @@ main (int argc, char *argv[])
mpz_swap (fn1, fn);
}
+ mpz_clear (fn1);
+ mpz_clear (fn);
+ mpz_clear (r);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-gcd.c b/tests/mpz/t-gcd.c
index 95f134510..565c0645b 100644
--- a/tests/mpz/t-gcd.c
+++ b/tests/mpz/t-gcd.c
@@ -27,10 +27,12 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void dump_abort _PROTO ((mpz_t, mpz_t));
void debug_mp _PROTO ((mpz_t, int));
+int
main (int argc, char **argv)
{
mpz_t op1, op2, x;
@@ -44,6 +46,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -122,6 +126,19 @@ main (int argc, char **argv)
dump_abort (op1, op2);
}
+ mpz_clear (bs);
+ mpz_clear (op1);
+ mpz_clear (op2);
+ mpz_clear (x);
+ mpz_clear (gcd);
+ mpz_clear (gcd2);
+ mpz_clear (temp1);
+ mpz_clear (temp2);
+ mpz_clear (s);
+ mpz_clear (t);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-get_si.c b/tests/mpz/t-get_si.c
index 059371cb4..85b73b09e 100644
--- a/tests/mpz/t-get_si.c
+++ b/tests/mpz/t-get_si.c
@@ -115,7 +115,11 @@ check_max (void)
int
main (void)
{
+ tests_start ();
+
check_data ();
check_max ();
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-jac.c b/tests/mpz/t-jac.c
index 9aeea1d29..b9d06d9f0 100644
--- a/tests/mpz/t-jac.c
+++ b/tests/mpz/t-jac.c
@@ -628,7 +628,6 @@ check_squares_zi (void)
mpz_t bs;
mpz_init (bs);
-
mpz_init (a);
mpz_init (b);
mpz_init (g);
@@ -657,6 +656,7 @@ check_squares_zi (void)
try_all (a, b, answer);
}
+ mpz_clear (bs);
mpz_clear (a);
mpz_clear (b);
mpz_clear (g);
@@ -669,6 +669,7 @@ void
check_a_zero (void)
{
mpz_t a, b;
+
mpz_init_set_ui (a, 0);
mpz_init (b);
@@ -697,6 +698,7 @@ check_a_zero (void)
try_all (a, b, 0); /* (0/2)=0 */
mpz_clear (a);
+ mpz_clear (b);
}
@@ -705,6 +707,8 @@ main (int argc, char *argv[])
{
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -736,5 +740,8 @@ try(a,b,answer) =\n\
check_squares_zi ();
check_a_zero ();
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-misc.c b/tests/mpz/t-misc.c
index a5c81786e..f573cada7 100644
--- a/tests/mpz/t-misc.c
+++ b/tests/mpz/t-misc.c
@@ -197,9 +197,12 @@ check_mpz_cmp_si (void)
int
main (void)
{
+ tests_start ();
+
check_oddeven ();
check_mpz_set_si ();
check_mpz_cmp_si ();
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-mul.c b/tests/mpz/t-mul.c
index e682cf7bd..f7cb074fb 100644
--- a/tests/mpz/t-mul.c
+++ b/tests/mpz/t-mul.c
@@ -27,12 +27,14 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
+#include "tests.h"
void debug_mp _PROTO ((mpz_t, int));
static void base_mul _PROTO ((mp_ptr,mp_srcptr,mp_size_t,mp_srcptr,mp_size_t));
static void ref_mpz_mul _PROTO ((mpz_t, const mpz_t, const mpz_t));
void dump_abort _PROTO ((char *, mpz_t, mpz_t, mpz_t, mpz_t));
+int
main (int argc, char **argv)
{
mpz_t multiplier, multiplicand;
@@ -46,6 +48,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -127,6 +131,16 @@ main (int argc, char **argv)
}
}
+ mpz_clear (bs);
+ mpz_clear (multiplier);
+ mpz_clear (multiplicand);
+ mpz_clear (product);
+ mpz_clear (ref_product);
+ mpz_clear (quotient);
+ mpz_clear (remainder);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-pow_ui.c b/tests/mpz/t-pow_ui.c
index 00f45d065..2917614bc 100644
--- a/tests/mpz/t-pow_ui.c
+++ b/tests/mpz/t-pow_ui.c
@@ -25,10 +25,12 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void debug_mp _PROTO ((char *, mpz_t, int));
void ref_mpz_pow_ui _PROTO ((mpz_t, const mpz_t, unsigned long int));
+int
main (int argc, char **argv)
{
mpz_t base, exp;
@@ -42,6 +44,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -113,6 +117,14 @@ main (int argc, char **argv)
}
}
+ mpz_clear (bs);
+ mpz_clear (base);
+ mpz_clear (exp);
+ mpz_clear (result);
+ mpz_clear (ref_result);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-powm.c b/tests/mpz/t-powm.c
index a218b3233..5fc54cf96 100644
--- a/tests/mpz/t-powm.c
+++ b/tests/mpz/t-powm.c
@@ -26,10 +26,12 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void dump_abort _PROTO ((mpz_t, mpz_t));
void debug_mp _PROTO ((mpz_t, int));
+int
main (int argc, char **argv)
{
mpz_t base, exp, mod;
@@ -42,6 +44,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -137,6 +141,18 @@ main (int argc, char **argv)
abort ();
}
+ mpz_clear (bs);
+ mpz_clear (base);
+ mpz_clear (exp);
+ mpz_clear (mod);
+ mpz_clear (r1);
+ mpz_clear (r2);
+ mpz_clear (t1);
+ mpz_clear (exp2);
+ mpz_clear (base2);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-powm_ui.c b/tests/mpz/t-powm_ui.c
index d3bc7b172..023bba572 100644
--- a/tests/mpz/t-powm_ui.c
+++ b/tests/mpz/t-powm_ui.c
@@ -25,10 +25,12 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void dump_abort _PROTO ((mpz_t, mpz_t));
void debug_mp _PROTO ((mpz_t, int));
+int
main (int argc, char **argv)
{
mpz_t base, exp, mod;
@@ -42,6 +44,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -133,6 +137,16 @@ main (int argc, char **argv)
abort ();
}
+ mpz_clear (bs);
+ mpz_clear (base);
+ mpz_clear (exp);
+ mpz_clear (mod);
+ mpz_clear (r1);
+ mpz_clear (r2);
+ mpz_clear (base2);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-root.c b/tests/mpz/t-root.c
index 06b8deb20..81b56af7e 100644
--- a/tests/mpz/t-root.c
+++ b/tests/mpz/t-root.c
@@ -25,9 +25,11 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void debug_mp _PROTO ((mpz_t, int));
+int
main (int argc, char **argv)
{
mpz_t x2;
@@ -42,6 +44,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -129,6 +133,14 @@ main (int argc, char **argv)
}
}
+ mpz_clear (bs);
+ mpz_clear (x2);
+ mpz_clear (x);
+ mpz_clear (temp);
+ mpz_clear (temp2);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-scan.c b/tests/mpz/t-scan.c
index cd590feca..69f96f65f 100644
--- a/tests/mpz/t-scan.c
+++ b/tests/mpz/t-scan.c
@@ -23,6 +23,7 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
#include "urandom.h"
+#include "tests.h"
unsigned long
@@ -110,6 +111,10 @@ check_ref (void)
int
main (int argc, char *argv[])
{
+ tests_start ();
+
check_ref ();
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-sqrtrem.c b/tests/mpz/t-sqrtrem.c
index 868ab7797..a93d41960 100644
--- a/tests/mpz/t-sqrtrem.c
+++ b/tests/mpz/t-sqrtrem.c
@@ -25,10 +25,12 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void dump_abort _PROTO ((mpz_t, mpz_t, mpz_t));
void debug_mp _PROTO ((mpz_t, int));
+int
main (int argc, char **argv)
{
mpz_t x2;
@@ -42,6 +44,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -98,6 +102,15 @@ main (int argc, char **argv)
dump_abort (x2, x, rem);
}
+ mpz_clear (bs);
+ mpz_clear (x2);
+ mpz_clear (x);
+ mpz_clear (rem);
+ mpz_clear (temp);
+ mpz_clear (temp2);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-tdiv.c b/tests/mpz/t-tdiv.c
index 6c6e53841..7bf76e746 100644
--- a/tests/mpz/t-tdiv.c
+++ b/tests/mpz/t-tdiv.c
@@ -26,10 +26,12 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void dump_abort _PROTO ((mpz_t, mpz_t));
void debug_mp _PROTO ((mpz_t, int));
+int
main (int argc, char **argv)
{
mpz_t dividend, divisor;
@@ -44,6 +46,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -130,6 +134,17 @@ main (int argc, char **argv)
dump_abort (dividend, divisor);
}
+ mpz_clear (bs);
+ mpz_clear (dividend);
+ mpz_clear (divisor);
+ mpz_clear (quotient);
+ mpz_clear (remainder);
+ mpz_clear (quotient2);
+ mpz_clear (remainder2);
+ mpz_clear (temp);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}
diff --git a/tests/mpz/t-tdiv_ui.c b/tests/mpz/t-tdiv_ui.c
index 0a7a04b3e..7163a36db 100644
--- a/tests/mpz/t-tdiv_ui.c
+++ b/tests/mpz/t-tdiv_ui.c
@@ -26,10 +26,12 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
+#include "tests.h"
void dump_abort _PROTO ((mpz_t, mp_limb_t));
void debug_mp _PROTO ((mpz_t, int));
+int
main (int argc, char **argv)
{
mpz_t dividend;
@@ -45,6 +47,8 @@ main (int argc, char **argv)
unsigned long bsi, size_range;
char *perform_seed;
+ tests_start ();
+
gmp_randinit (rands, GMP_RAND_ALG_LC, 64);
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
@@ -126,6 +130,16 @@ main (int argc, char **argv)
dump_abort (dividend, divisor);
}
+ mpz_clear (bs);
+ mpz_clear (dividend);
+ mpz_clear (quotient);
+ mpz_clear (remainder);
+ mpz_clear (quotient2);
+ mpz_clear (remainder2);
+ mpz_clear (temp);
+ gmp_randclear (rands);
+
+ tests_end ();
exit (0);
}