summaryrefslogtreecommitdiff
path: root/tests/mpfr-test.h
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-07-22 14:43:55 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-07-22 14:43:55 +0000
commitfa06e09eddd04e5c23a47b10b7add0c09093e576 (patch)
tree7b03737745bf6968f12b54f8f255f9738969d8ab /tests/mpfr-test.h
parent31b27e688bf029b0115f8afe0b04c50cfd86f4de (diff)
downloadmpfr-fa06e09eddd04e5c23a47b10b7add0c09093e576.tar.gz
[tests] Define the RND_RAND_NO_RNDF and RND_LOOP_NO_RNDF macros, similar
to RND_RAND and RND_LOOP respectively but excluding MPFR_RNDF, to be used for tests that don't make sense in the faithful rounding mode. Replaced code to use these macros, fixing the remaining failures. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/faithful@10656 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/mpfr-test.h')
-rw-r--r--tests/mpfr-test.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/mpfr-test.h b/tests/mpfr-test.h
index 616ef4119..c7d5f1057 100644
--- a/tests/mpfr-test.h
+++ b/tests/mpfr-test.h
@@ -51,12 +51,19 @@ extern "C" {
/* Generates a random rounding mode */
#define RND_RAND() ((mpfr_rnd_t) (randlimb() % MPFR_RND_MAX))
+/* Ditto, excluding RNDF, assumed to be the last rounding mode */
+#define RND_RAND_NO_RNDF() ((mpfr_rnd_t) (randlimb() % MPFR_RNDF))
+
/* Generates a random sign */
#define SIGN_RAND() ( (randlimb()%2) ? MPFR_SIGN_POS : MPFR_SIGN_NEG)
/* Loop for all rounding modes */
#define RND_LOOP(_r) for((_r) = 0 ; (_r) < MPFR_RND_MAX ; (_r)++)
+/* Loop for all rounding modes except RNDF (assumed to be the last one),
+ which must be excluded from tests that rely on deterministic results. */
+#define RND_LOOP_NO_RNDF(_r) for((_r) = 0 ; (_r) < MPFR_RNDF ; (_r)++)
+
/* Test whether two floating-point data have the same value,
seen as an element of the set of the floating-point data
(Level 2 in the IEEE 754-2008 standard). */