diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2020-10-31 15:15:13 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2020-10-31 15:15:13 +0100 |
commit | 915ad5d4b7fa38579e25fc5d4c1f43c85baf52ce (patch) | |
tree | 5fe74ce29f0c7d3d955d0020be352bffeef6ce02 /tests | |
parent | 30dca3d167139d9dae88bfe42d63c46e2989528a (diff) | |
download | gmp-915ad5d4b7fa38579e25fc5d4c1f43c85baf52ce.tar.gz |
tests/mpf/t-conv.c: Some more tests on zero.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mpf/t-conv.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/tests/mpf/t-conv.c b/tests/mpf/t-conv.c index a64e86fdd..2f992af99 100644 --- a/tests/mpf/t-conv.c +++ b/tests/mpf/t-conv.c @@ -1,6 +1,6 @@ /* Test mpf_get_str and mpf_set_str. -Copyright 1996, 2000, 2001, 2008, 2019 Free Software Foundation, Inc. +Copyright 1996, 2000, 2001, 2008, 2019, 2020 Free Software Foundation, Inc. This file is part of the GNU MP Library test suite. @@ -138,7 +138,7 @@ main (int argc, char **argv) if (mpf_cmp (x, y) != 0) abort (); - mpf_set_str (y, "0", 10); + mpf_set_str (y, " 0", 10); mpf_set_str (x, "00000000000000000000000000000000000000000000000000000", 10); MPF_CHECK_FORMAT (x); if (mpf_cmp (x, y) != 0) @@ -160,7 +160,6 @@ main (int argc, char **argv) if (mpf_cmp (x, y) != 0) abort (); - mpf_set_str (y, "0", 16); mpf_set_str (x, "00000000000000000000000000000000000000000000000000000", 16); MPF_CHECK_FORMAT (x); if (mpf_cmp (x, y) != 0) @@ -181,6 +180,26 @@ main (int argc, char **argv) MPF_CHECK_FORMAT (x); if (mpf_cmp (x, y) != 0) abort (); + mpf_set_str (x, "+00000000000000000000000000000000000000000000000000000e-345", 9); + MPF_CHECK_FORMAT (x); + if (mpf_cmp (x, y) != 0) + abort (); + mpf_set_str (x, "-0000000000000000000000000000000000000000000000000000.@AB", 26); + MPF_CHECK_FORMAT (x); + if (mpf_cmp (x, y) != 0) + abort (); + mpf_set_str (x, "000000000000000000000000000000000000000000000000000.0@78", 19); + MPF_CHECK_FORMAT (x); + if (mpf_cmp (x, y) != 0) + abort (); + mpf_set_str (x, "+.0000000000000000000000000000000000000000000000000000e555", 6); + MPF_CHECK_FORMAT (x); + if (mpf_cmp (x, y) != 0) + abort (); + mpf_set_str (x, "-0.000000000000000000000000000000000000000000000000000@-AAAAAAAAAAAAAAAAAAAAAAAA", 17); + MPF_CHECK_FORMAT (x); + if (mpf_cmp (x, y) != 0) + abort (); /* Now test random values. */ |