summaryrefslogtreecommitdiff
path: root/mini-gmp
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2020-10-25 18:19:20 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2020-10-25 18:19:20 +0100
commit78d5c0145869a8587c5d9b02fcf94ae81894f098 (patch)
treea94d6c728e3f5c284c04131a4617b99a668a3e0f /mini-gmp
parentccfdf4eb9e54e4220f09ce3dff2cdaabfceddcee (diff)
downloadgmp-78d5c0145869a8587c5d9b02fcf94ae81894f098.tar.gz
mini-gmp/tests/t-str.c: Test out-of-range bases for mpz_out_str
Diffstat (limited to 'mini-gmp')
-rw-r--r--mini-gmp/tests/t-str.c12
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;