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