[Gmp-commit] /var/hg/gmp-6.2: 5 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Sun Oct 18 19:49:59 UTC 2020


details:   /var/hg/gmp-6.2/rev/3ced213ee0ab
changeset: 18099:3ced213ee0ab
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sun Oct 18 21:47:50 2020 +0200
description:
tests/mpz/io.c: Test out-of-range bases for mpz_out_str.

details:   /var/hg/gmp-6.2/rev/37c8c775a927
changeset: 18100:37c8c775a927
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sun Oct 18 21:48:34 2020 +0200
description:
mini-gmp/tests/t-str.c: Test out-of-range bases for mpz_out_str.

details:   /var/hg/gmp-6.2/rev/3fb366f9b729
changeset: 18101:3fb366f9b729
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sun Oct 18 21:49:08 2020 +0200
description:
mini-gmp/tests/t-mpq_str.c: Test out-of-range bases for mpq_out_str.

details:   /var/hg/gmp-6.2/rev/54ce6633eb3c
changeset: 18102:54ce6633eb3c
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sun Oct 18 21:49:30 2020 +0200
description:
ChangeLog

details:   /var/hg/gmp-6.2/rev/734d04ff4aab
changeset: 18103:734d04ff4aab
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sun Oct 18 21:49:42 2020 +0200
description:
NEWS

diffstat:

 ChangeLog                  |   2 ++
 NEWS                       |   7 ++++++-
 mini-gmp/ChangeLog         |   3 +++
 mini-gmp/tests/t-mpq_str.c |  14 +++++++++++++-
 mini-gmp/tests/t-str.c     |  14 +++++++++++++-
 tests/mpz/io.c             |  15 ++++++++++++++-
 6 files changed, 51 insertions(+), 4 deletions(-)

diffs (138 lines):

diff -r b3ca6f0653b7 -r 734d04ff4aab ChangeLog
--- a/ChangeLog	Sun Oct 18 19:28:37 2020 +0200
+++ b/ChangeLog	Sun Oct 18 21:49:42 2020 +0200
@@ -2,6 +2,8 @@
 
 	* tests/devel/Makefile.am: Remove redundancies.
 
+	* tests/mpz/io.c: Test out-of-range bases for mpz_out_str.
+
 2020-10-15  Torbjörn Granlund  <tg at gmplib.org>
 
 	* configure.ac: Recognise zen3.
diff -r b3ca6f0653b7 -r 734d04ff4aab NEWS
--- a/NEWS	Sun Oct 18 19:28:37 2020 +0200
+++ b/NEWS	Sun Oct 18 21:49:42 2020 +0200
@@ -10,12 +10,17 @@
 
   * Overflows are more carefully detected and reported for mpz_pow_ui.
 
+  * A bug in longlong.h for aarch64 sub_ddmmss, not affecting GMP, was healed.
+
+  * mini-gmp: mpz_out_str and mpq_out_str now correctly handle out of
+    range bases.
+
   FEATURES
   * C90 compliance.
 
   * Initial support for Darwin on arm64.
 
-  * Support for more 64-bit arm processors.
+  * Support for more processors.
 
 Changes between GMP version 6.1.* and 6.2.0
 
diff -r b3ca6f0653b7 -r 734d04ff4aab mini-gmp/ChangeLog
--- a/mini-gmp/ChangeLog	Sun Oct 18 19:28:37 2020 +0200
+++ b/mini-gmp/ChangeLog	Sun Oct 18 21:49:42 2020 +0200
@@ -3,6 +3,9 @@
 	* mini-mpq.c (mpq_out_str): Return 0 when base is out of range.
 	* mini-gmp.c (mpz_out_str): Likewise. (spotted by Paul Eggert)
 
+	* tests/t-str.c: Test out-of-range bases for mpz_out_str.
+	* tests/t-mpq_str.c: Likewise, for mpq_out_str.
+
 2020-10-06  Niels Möller  <nisse at lysator.liu.se>
 
 	* tests/run-tests: Better support for make check on wine or cygwin.
diff -r b3ca6f0653b7 -r 734d04ff4aab mini-gmp/tests/t-mpq_str.c
--- a/mini-gmp/tests/t-mpq_str.c	Sun Oct 18 19:28:37 2020 +0200
+++ b/mini-gmp/tests/t-mpq_str.c	Sun Oct 18 21:49:42 2020 +0200
@@ -1,6 +1,6 @@
 /*
 
-Copyright 2012-2014, 2016, 2018 Free Software Foundation, Inc.
+Copyright 2012-2014, 2016, 2018, 2020 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library test suite.
 
@@ -160,6 +160,18 @@
     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;
diff -r b3ca6f0653b7 -r 734d04ff4aab mini-gmp/tests/t-str.c
--- a/mini-gmp/tests/t-str.c	Sun Oct 18 19:28:37 2020 +0200
+++ b/mini-gmp/tests/t-str.c	Sun Oct 18 21:49:42 2020 +0200
@@ -1,6 +1,6 @@
 /*
 
-Copyright 2012-2014, 2016 Free Software Foundation, Inc.
+Copyright 2012-2014, 2016, 2020 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library test suite.
 
@@ -156,6 +156,18 @@
     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;
diff -r b3ca6f0653b7 -r 734d04ff4aab tests/mpz/io.c
--- a/tests/mpz/io.c	Sun Oct 18 19:28:37 2020 +0200
+++ b/tests/mpz/io.c	Sun Oct 18 21:49:42 2020 +0200
@@ -1,6 +1,7 @@
 /* Test conversion and I/O using mpz_out_str and mpz_inp_str.
 
-Copyright 1993, 1994, 1996, 2000, 2001, 2012 Free Software Foundation, Inc.
+Copyright 1993, 1994, 1996, 2000, 2001, 2012, 2020 Free Software
+Foundation, Inc.
 
 This file is part of the GNU MP Library test suite.
 
@@ -63,6 +64,18 @@
 
   fp = fopen (FILENAME, "w+");
 
+  if (mpz_out_str (fp, 63, op1) != 0)
+    {
+      printf ("mpz_out_str did not return 0 (error) with base > 62\n");
+      abort ();
+    }
+
+  if (mpz_out_str (fp, -37, op1) != 0)
+    {
+      printf ("mpz_out_str did not return 0 (error) with base < -37\n");
+      abort ();
+    }
+
   for (i = 0; i < reps; i++)
     {
       mpz_urandomb (bs, rands, 32);



More information about the gmp-commit mailing list