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

mercurial at gmplib.org mercurial at gmplib.org
Sat Jan 19 08:01:37 CET 2013


details:   /var/hg/gmp/rev/e820576d508d
changeset: 15306:e820576d508d
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jan 19 07:53:04 2013 +0100
description:
Changelog

details:   /var/hg/gmp/rev/abdd6b7670d0
changeset: 15307:abdd6b7670d0
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jan 19 07:54:37 2013 +0100
description:
mini-gmp/tests: Get the current free function using mp_get_memory_functions.

details:   /var/hg/gmp/rev/f3097b0ceb3d
changeset: 15308:f3097b0ceb3d
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jan 19 07:55:16 2013 +0100
description:
ChangeLog

details:   /var/hg/gmp/rev/124b230c512f
changeset: 15309:124b230c512f
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jan 19 07:56:49 2013 +0100
description:
mini-gmp/tests/testutils.h (tu_free): Remove declaration

details:   /var/hg/gmp/rev/fc59d0a1d335
changeset: 15310:fc59d0a1d335
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jan 19 07:57:05 2013 +0100
description:
ChangeLog

details:   /var/hg/gmp/rev/4f7a21320fac
changeset: 15311:4f7a21320fac
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jan 19 07:58:29 2013 +0100
description:
typos

details:   /var/hg/gmp/rev/745e27a14f4f
changeset: 15312:745e27a14f4f
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jan 19 08:00:34 2013 +0100
description:
mini-gmp/tests/testutils.c (block_check, tu_free): Mark static.

details:   /var/hg/gmp/rev/d323a6ba92b6
changeset: 15313:d323a6ba92b6
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jan 19 08:01:01 2013 +0100
description:
ChangeLog

diffstat:

 ChangeLog                  |  36 ++++++++++++++++++++++--------------
 mini-gmp/tests/t-double.c  |   5 ++++-
 mini-gmp/tests/t-str.c     |  29 +++++++++++++++++------------
 mini-gmp/tests/testutils.c |   6 +++---
 mini-gmp/tests/testutils.h |   3 ---
 5 files changed, 46 insertions(+), 33 deletions(-)

diffs (192 lines):

diff -r abe5df85098f -r d323a6ba92b6 ChangeLog
--- a/ChangeLog	Fri Jan 18 22:37:11 2013 +0100
+++ b/ChangeLog	Sat Jan 19 08:01:01 2013 +0100
@@ -1,3 +1,13 @@
+2013-01-19 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* mini-gmp/tests/t-double.c (testmain): Get the current free
+	function using mp_get_memory_functions.
+	* mini-gmp/tests/t-str.c (testmain): Likewise.
+
+	* mini-gmp/tests/testutils.h (tu_free): Remove declaration.
+
+	* mini-gmp/tests/testutils.c (block_check, tu_free): Mark static.
+
 2013-01-18  Niels Möller  <nisse at lysator.liu.se>
 
 	* mini-gmp/tests/t-str.c (test_small): New function, exercising
@@ -24,27 +34,25 @@
 	Calls testmain after initialization. All other test programs
 	updated to define testmain rather than main.
 
+2013-01-18 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* mini-gmp/tests/t-signed.c: Slightly larger coverage.
+	* mini-gmp/tests/t-double.c: Test also mpz_init_set_d.
+
 2013-01-18  Torbjorn Granlund  <tege at gmplib.org>
 
+	* mpn/generic/set_str.c (normalization_steps): Eliminate set-but-unused
+	variable.
+
+	* mini-gmp/tests/t-div.c: Test mpz_divisible_p and mpz_divisible_ui_p.
+
+	* tests/tests.h (TESTS_REPS): Fix printf argument type clashes.
+
 	* mini-gmp/tests/t-div.c: Test also mpz_mod, mpz_mod_ui.  Compare
 	mpz_divisible_p just to ceil, to save time.
 
 	* mini-gmp/mini-gmp.c: Prefix some names with GMP_.
 
-2013-01-18 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
-	* mini-gmp/tests/t-signed.c: Slightly larger coverage.
-	* mini-gmp/tests/t-double.c: Test also mpz_init_set_d.
-
-2013-01-18  Torbjorn Granlund  <tege at gmplib.org>
-
-	* mpn/generic/set_str.c (normalization_steps): Eliminate set-but-unused
-	variable.
-
-	* mini-gmp/tests/t-div.c: Test mpz_divisible_p and mpz_divisible_ui_p.
-
-	* tests/tests.h (TESTS_REPS): Fix printf argument type clashes.
-
 2013-01-16 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mini-gmp/tests/t-double.c: Test mpz_cmp_d.
diff -r abe5df85098f -r d323a6ba92b6 mini-gmp/tests/t-double.c
--- a/mini-gmp/tests/t-double.c	Fri Jan 18 22:37:11 2013 +0100
+++ b/mini-gmp/tests/t-double.c	Sat Jan 19 08:01:01 2013 +0100
@@ -61,6 +61,9 @@
   unsigned i;
   mpz_t x;
 
+  void (*freefunc) (void *, size_t);
+  mp_get_memory_functions (NULL, NULL, &freefunc);
+
   for (i = 0; values[i].s; i++)
     {
       char *s;
@@ -75,7 +78,7 @@
 		   values[i].d, s, values[i].s);
 	  abort ();
 	}
-      tu_free(s, 0);
+      freefunc(s, 0);
       mpz_clear (x);
     }
 
diff -r abe5df85098f -r d323a6ba92b6 mini-gmp/tests/t-str.c
--- a/mini-gmp/tests/t-str.c	Fri Jan 18 22:37:11 2013 +0100
+++ b/mini-gmp/tests/t-str.c	Sat Jan 19 08:01:01 2013 +0100
@@ -1,6 +1,6 @@
 /*
 
-Copyright 2012, Free Software Foundation, Inc.
+Copyright 2012, 2013 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library test suite.
 
@@ -50,30 +50,32 @@
     { " 763959", "763959" },
     { "9 81999", "981999" },
     { "10\t7398", "107398" },
-    { "9585 44", "958544" },
+    { "-9585 44", "-00958544" },
+    { "-0", "0000" },
+    { " -000  ", "0" },
     { "0704436", "231710" },
     { " 02503517", "689999" },
     { "0 1312143", "365667" },
-    { "03 274062", "882738" },
-    { "012\t242", "5282" },
+    { "-03 274062", "-882738" },
+    { "012\t242", "005282" },
     { "0b11010111110010001111", "883855" },
     { " 0b11001010010100001", "103585" },
-    { "0b101010110011101111", "175343" },
+    { "-0b101010110011101111", "-175343" },
     { "0b 1111111011011100110", "521958" },
     { "0b1 1111110111001000011", "1044035" },
     { " 0x53dfc", "343548" },
-    { "0xfa019", "1024025" },
+    { "0xfA019", "1024025" },
     { "0x 642d1", "410321" },
     { "0x5 8067", "360551" },
-    { "0xd6be6", "879590" },
+    { "-0xd6Be6", "-879590" },
     { "\t0B1110000100000000011", "460803" },
     { "0B\t1111110010010100101", "517285" },
     { "0B1\t010111101101110100", "359284" },
-    { "0B101\t1001101111111001", "367609" },
+    { "-0B101\t1001101111111001", "-367609" },
     { "0B10001001010111110000", "562672" },
-    { "0Xe4b7e", "936830" },
-    { "0X1e4bf", "124095" },
-    { "0Xfdb90", "1039248" },
+    { "0Xe4B7e", "936830" },
+    { "0X1E4bf", "124095" },
+    { "-0Xfdb90", "-1039248" },
     { "0X7fc47", "523335" },
     { "0X8167c", "530044" },
     /* Some invalid inputs */
@@ -140,6 +142,9 @@
 
   mpz_t a, b;
 
+  void (*freefunc) (void *, size_t);
+  mp_get_memory_functions (NULL, NULL, &freefunc);
+
   test_small ();
 
   mpz_init (a);
@@ -262,7 +267,7 @@
 		}
 	    }
 	  free (ap);
-	  tu_free (bp, 0);
+	  freefunc (bp, 0);
 	}
     }
   mpz_clear (a);
diff -r abe5df85098f -r d323a6ba92b6 mini-gmp/tests/testutils.c
--- a/mini-gmp/tests/testutils.c	Fri Jan 18 22:37:11 2013 +0100
+++ b/mini-gmp/tests/testutils.c	Sat Jan 19 08:01:01 2013 +0100
@@ -30,7 +30,7 @@
 
    About alignment: In general, getting a block from malloc, and
    incrementing it by sizeof(size_t), like we do here, might give a
-   pointer which is not properlt unaligned for all types. But the
+   pointer which is not properly aligned for all types. But the
    largest type we allocate space for is unsigned long (mp_limb_t),
    which shouldn't have stricter alignment requirements than
    size_t. */
@@ -52,7 +52,7 @@
 }
 
 /* Check small redzone, return pointer to malloced block. */
-size_t *
+static size_t *
 block_check  (char *p)
 {
   size_t *block = (size_t *) p - 1;
@@ -94,7 +94,7 @@
   return block_init (block, new_size);
 }
 
-void
+static void
 tu_free (void *p, size_t old_size)
 {
   free (block_check (p));
diff -r abe5df85098f -r d323a6ba92b6 mini-gmp/tests/testutils.h
--- a/mini-gmp/tests/testutils.h	Fri Jan 18 22:37:11 2013 +0100
+++ b/mini-gmp/tests/testutils.h	Sat Jan 19 08:01:01 2013 +0100
@@ -20,6 +20,3 @@
 #include "mini-random.h"
 
 void testmain (int argc, char **argv);
-
-void
-tu_free (void *p, size_t old_size);


More information about the gmp-commit mailing list