From fa06e09eddd04e5c23a47b10b7add0c09093e576 Mon Sep 17 00:00:00 2001 From: vlefevre Date: Fri, 22 Jul 2016 14:43:55 +0000 Subject: [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 --- tests/mpfr-test.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/mpfr-test.h') 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). */ -- cgit v1.2.1