summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/mpf/t-conv.c25
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. */