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/tget_f.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'tests/tget_f.c') diff --git a/tests/tget_f.c b/tests/tget_f.c index b0af066c6..b73e2a503 100644 --- a/tests/tget_f.c +++ b/tests/tget_f.c @@ -185,13 +185,10 @@ ternary_test (void) /* y == 1 */ mpfr_set_ui_2exp (y, 1, prec, MPFR_RNDN); - RND_LOOP (rnd) + RND_LOOP_NO_RNDF (rnd) { inex = mpfr_get_f (x, y, (mpfr_rnd_t) rnd); - if (rnd == MPFR_RNDF) - continue; - if (inex != 0 || mpfr_cmp_f (y, x) != 0) { printf ("Error (1) in mpfr_get_f (x, y, %s)\nx = ", @@ -209,7 +206,7 @@ ternary_test (void) /* y == 1 + epsilon */ mpfr_nextbelow (y); - RND_LOOP (rnd) + RND_LOOP_NO_RNDF (rnd) { switch (rnd) { @@ -223,9 +220,6 @@ ternary_test (void) inex = mpfr_get_f (x, y, (mpfr_rnd_t) rnd); - if (rnd == MPFR_RNDF) - continue; - if (! SAME_SIGN (expected_inex, inex) || SAME_SIGN (expected_inex, mpfr_cmp_f (y, x))) { @@ -245,13 +239,10 @@ ternary_test (void) /* y == positive random float */ mpfr_random2 (y, MPFR_LIMB_SIZE (y), 1024, RANDS); - RND_LOOP (rnd) + RND_LOOP_NO_RNDF (rnd) { inex = mpfr_get_f (x, y, (mpfr_rnd_t) rnd); - if (rnd == MPFR_RNDF) - continue; - if (! SAME_SIGN (inex, -mpfr_cmp_f (y, x))) { printf ("Error (3) in mpfr_get_f (x, y, %s)\nx = ", -- cgit v1.2.1