summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2020-06-01 10:39:52 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2020-06-01 10:39:52 +0000
commitdce6158229d1a0b144d527403d01d189554c0092 (patch)
tree11b4f8f1b3b8e4c8cd5c4dbc88c5f23af7471531 /tests
parent923d451d79787b127b1a38da91dccc1a50ad6a45 (diff)
downloadmpfr-dce6158229d1a0b144d527403d01d189554c0092.tar.gz
Bug fixes and cleanup related to "src/mpfr-intmax.h" by introducing
a new macro MPFR_NEED_INTMAX_H, which should be defined instead of using: #include "mpfr-intmax.h" Details on the bugs fixed: * The code added in r13916 forgot a #include <limits.h> since this code does a test on ULLONG_MAX. With the cleanup, <limits.h> is already always included by mpfr-impl.h (early enough). * In src/get_str.c and tests/memory.c, a #include "config.h" was missing before #include "mpfr-intmax.h"; this issue would affect platforms where "config.h" is needed and where <inttypes.h> or <stdint.h> does not exist or does not work. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13923 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r--tests/memory.c2
-rw-r--r--tests/tfits.c7
-rw-r--r--tests/tfprintf.c2
-rw-r--r--tests/tget_sj.c7
-rw-r--r--tests/tprintf.c2
-rw-r--r--tests/tset_sj.c7
-rw-r--r--tests/tversion.c7
7 files changed, 7 insertions, 27 deletions
diff --git a/tests/memory.c b/tests/memory.c
index c1a691be2..91e022400 100644
--- a/tests/memory.c
+++ b/tests/memory.c
@@ -22,7 +22,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
/* Note: this file comes from GMP's tests/memory.c */
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-test.h"
/* Each block allocated is a separate malloc, for the benefit of a redzoning
diff --git a/tests/tfits.c b/tests/tfits.c
index 8a8d647e9..01fd4c0f1 100644
--- a/tests/tfits.c
+++ b/tests/tfits.c
@@ -22,12 +22,7 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* Needed due to the inclusion of mpfr-intmax.h */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-test.h"
#define FTEST_AUX(N,NOT,FCT) \
diff --git a/tests/tfprintf.c b/tests/tfprintf.c
index 72c6e35f9..a52f19f68 100644
--- a/tests/tfprintf.c
+++ b/tests/tfprintf.c
@@ -38,7 +38,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include <float.h>
#include <stddef.h>
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-test.h"
#define QUOTE(X) NAME(X)
diff --git a/tests/tget_sj.c b/tests/tget_sj.c
index 86623052f..df117f0de 100644
--- a/tests/tget_sj.c
+++ b/tests/tget_sj.c
@@ -20,12 +20,7 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* Needed due to the inclusion of mpfr-intmax.h */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-test.h"
#ifndef _MPFR_H_HAVE_INTMAX_T
diff --git a/tests/tprintf.c b/tests/tprintf.c
index cf96258c1..4ea0ef620 100644
--- a/tests/tprintf.c
+++ b/tests/tprintf.c
@@ -41,7 +41,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include <locale.h>
#endif
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-test.h"
#define STDOUT_FILENO 1
diff --git a/tests/tset_sj.c b/tests/tset_sj.c
index 86a62c49c..035a030ad 100644
--- a/tests/tset_sj.c
+++ b/tests/tset_sj.c
@@ -21,12 +21,7 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* Needed due to the inclusion of mpfr-intmax.h */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-test.h"
#ifndef _MPFR_H_HAVE_INTMAX_T
diff --git a/tests/tversion.c b/tests/tversion.c
index dc9fb3af3..1279665c5 100644
--- a/tests/tversion.c
+++ b/tests/tversion.c
@@ -20,14 +20,9 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* Needed due to the inclusion of mpfr-intmax.h */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
#include <errno.h>
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-test.h"
/* Warning about the usage of printf/puts below: