diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-01-27 00:09:17 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-01-27 00:09:17 +0100 |
commit | d58e4bc3d03c5ebd833c72d86fd1b8d60b7d84c6 (patch) | |
tree | 3cbc82e86c6c3ffe1743e15eb92221b61638d626 /tests/mpz | |
parent | d6033525963d1877c296d83c4960d0ed3bfc158d (diff) | |
download | gmp-d58e4bc3d03c5ebd833c72d86fd1b8d60b7d84c6.tar.gz |
* mpz/get_str.c, mpf/get_str.c: Make allocated string block exactly
strlen(str)+1 bytes.
* mpz/dump.c, mpf/dump.c, tests/mpz/convert.c: Use this size when
freeing.
* tests/mpz/*.c, tests/mpq/*.c, tests/mpf/*.c: Uses tests_start and
tests_end.
Diffstat (limited to 'tests/mpz')
-rw-r--r-- | tests/mpz/convert.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/mpz/convert.c b/tests/mpz/convert.c index f96f9e21e..544f9790c 100644 --- a/tests/mpz/convert.c +++ b/tests/mpz/convert.c @@ -29,6 +29,7 @@ MA 02111-1307, USA. */ void debug_mp _PROTO ((mpz_t, int)); +int main (int argc, char **argv) { mpz_t op1, op2; @@ -42,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"); @@ -84,7 +86,7 @@ main (int argc, char **argv) str = mpz_get_str ((char *) 0, base, op1); mpz_set_str_or_abort (op2, str, base); - (*__gmp_free_func) (str, 0); + (*__gmp_free_func) (str, strlen (str) + 1); if (mpz_cmp (op1, op2)) { @@ -97,6 +99,12 @@ main (int argc, char **argv) } } + mpz_clear (bs); + mpz_clear (op1); + mpz_clear (op2); + gmp_randclear (rands); + + tests_end (); exit (0); } |