summaryrefslogtreecommitdiff
path: root/tests/tgeneric.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2011-03-09 15:38:58 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2011-03-09 15:38:58 +0000
commitfed992e13be222158fd39317d74e6cd3589eedcb (patch)
treeb85d11b113cd2adb5dc661b2ef6bc1caba1a0015 /tests/tgeneric.c
parent0625da7f90e92965918b00887ad8dd316dc092d6 (diff)
downloadmpfr-fed992e13be222158fd39317d74e6cd3589eedcb.tar.gz
[tests/tgeneric.c] Added feature for MPFR_SUSPICIOUS_OVERFLOW to avoid
spurious failures by defining TGENERIC_SO_TEST to some well-chosen test. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7553 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tgeneric.c')
-rw-r--r--tests/tgeneric.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/tgeneric.c b/tests/tgeneric.c
index 2d2ff73db..6e560dc34 100644
--- a/tests/tgeneric.c
+++ b/tests/tgeneric.c
@@ -43,6 +43,13 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define TEST_RANDOM_EMAX 255
#endif
+/* If the MPFR_SUSPICIOUS_OVERFLOW test fails but this is not a bug,
+ then define TGENERIC_SO_TEST with an adequate test (possibly 0) to
+ omit this particular case. */
+#ifndef TGENERIC_SO_TEST
+#define TGENERIC_SO_TEST 1
+#endif
+
/* The (void *) below is needed to avoid a warning with gcc 4.2+ and functions
* with 2 arguments. See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36299>.
*/
@@ -440,7 +447,7 @@ test_generic (mpfr_prec_t p0, mpfr_prec_t p1, unsigned int N)
MPFR_ASSERTN (MPFR_IS_PURE_FP (y));
mpfr_nexttoinf (y);
if (MPFR_IS_INF (y) && MPFR_IS_LIKE_RNDZ (rnd, MPFR_IS_NEG (y))
- && !mpfr_overflow_p ())
+ && !mpfr_overflow_p () && TGENERIC_SO_TEST)
{
printf ("Possible bug! |y| is the maximum finite number "
"and has been obtained when\nrounding toward zero"