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

mercurial at gmplib.org mercurial at gmplib.org
Sat Dec 26 21:05:45 UTC 2015


details:   /var/hg/gmp/rev/99d5d02d230c
changeset: 17007:99d5d02d230c
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Sat Dec 26 22:05:22 2015 +0100
description:
Assert library version.

details:   /var/hg/gmp/rev/d54d5254777c
changeset: 17008:d54d5254777c
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Sat Dec 26 22:05:42 2015 +0100
description:
ChangeLog

diffstat:

 ChangeLog    |   4 ++++
 tests/misc.c |  14 ++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diffs (35 lines):

diff -r b038d524a264 -r d54d5254777c ChangeLog
--- a/ChangeLog	Sat Dec 19 11:59:42 2015 +0100
+++ b/ChangeLog	Sat Dec 26 22:05:42 2015 +0100
@@ -1,3 +1,7 @@
+2015-12-26  Torbjörn Granlund  <torbjorng at google.com>
+
+	* tests/misc.c (tests_start): Assert library version.
+
 2015-12-19  Marc Glisse  <marc.glisse at inria.fr>
 
 	* gmp-impl.h (fft_table_nk): Use gmp_uint_least32_t.
diff -r b038d524a264 -r d54d5254777c tests/misc.c
--- a/tests/misc.c	Sat Dec 19 11:59:42 2015 +0100
+++ b/tests/misc.c	Sat Dec 26 22:05:42 2015 +0100
@@ -49,6 +49,20 @@
 void
 tests_start (void)
 {
+  char version[10];
+  snprintf (version, 10, "%u.%u.%u",
+	    __GNU_MP_VERSION,
+	    __GNU_MP_VERSION_MINOR,
+	    __GNU_MP_VERSION_PATCHLEVEL);
+
+  if (strcmp (gmp_version, version) != 0)
+    {
+      fprintf (stderr, "tests are not linked to the newly compiled library\n");
+      fprintf (stderr, "  local version is: %s\n", version);
+      fprintf (stderr, "  linked version is: %s\n", gmp_version);
+      abort ();
+    }
+
   /* don't buffer, so output is not lost if a test causes a segv etc */
   setbuf (stdout, NULL);
   setbuf (stderr, NULL);


More information about the gmp-commit mailing list