diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2020-10-25 18:19:20 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2020-10-25 18:19:20 +0100 |
commit | 78d5c0145869a8587c5d9b02fcf94ae81894f098 (patch) | |
tree | a94d6c728e3f5c284c04131a4617b99a668a3e0f | |
parent | ccfdf4eb9e54e4220f09ce3dff2cdaabfceddcee (diff) | |
download | gmp-78d5c0145869a8587c5d9b02fcf94ae81894f098.tar.gz |
mini-gmp/tests/t-str.c: Test out-of-range bases for mpz_out_str
-rw-r--r-- | mini-gmp/tests/t-str.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mini-gmp/tests/t-str.c b/mini-gmp/tests/t-str.c index 2aa67d01d..d4dce1e80 100644 --- a/mini-gmp/tests/t-str.c +++ b/mini-gmp/tests/t-str.c @@ -156,6 +156,18 @@ testmain (int argc, char **argv) fprintf (stderr, "Failed to create temporary file. Skipping mpz_out_str tests.\n"); + if (mpz_out_str (tmp, 63, a) != 0) + { + printf ("mpz_out_str did not return 0 (error) with base > 62\n"); + abort (); + } + + if (mpz_out_str (tmp, -37, a) != 0) + { + printf ("mpz_out_str did not return 0 (error) with base < -37\n"); + abort (); + } + for (i = 0; i < COUNT; i++) { int base; |