From 404f22f85dd315417f26cea1d8bb175128d840cb Mon Sep 17 00:00:00 2001 From: vlefevre Date: Tue, 23 Feb 2016 11:56:19 +0000 Subject: =?UTF-8?q?[tests/{tcmp=5Fd.c,tcmp=5Fld.c}]=20Full=20test=20of=20t?= =?UTF-8?q?he=20flags=20for=20NaN=20=E2=86=92=20failure.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10087 280ebfd0-de03-0410-8827-d642c229c3f4 --- tests/tcmp_d.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'tests/tcmp_d.c') diff --git a/tests/tcmp_d.c b/tests/tcmp_d.c index 5992df299..38bdae881 100644 --- a/tests/tcmp_d.c +++ b/tests/tcmp_d.c @@ -73,11 +73,16 @@ main (void) { int c; - mpfr_clear_erangeflag (); + mpfr_clear_flags (); c = mpfr_cmp_d (x, DBL_NAN); - if (c != 0 || !mpfr_erangeflag_p ()) + if (c != 0 || __gmpfr_flags != MPFR_FLAGS_ERANGE) { printf ("ERROR for NAN (1)\n"); + printf ("Expected 0, got %d\n", c); + printf ("Expected flags:"); + flags_out (MPFR_FLAGS_ERANGE); + printf ("Got flags: "); + flags_out (__gmpfr_flags); #ifdef MPFR_NANISNAN printf ("The reason is that NAN == NAN. Please look at the configure " "output\nand Section \"In case of problem\" of the INSTALL " @@ -85,12 +90,18 @@ main (void) #endif exit (1); } + mpfr_set_nan (x); - mpfr_clear_erangeflag (); + mpfr_clear_flags (); c = mpfr_cmp_d (x, 2.0); - if (c != 0 || !mpfr_erangeflag_p ()) + if (c != 0 || __gmpfr_flags != MPFR_FLAGS_ERANGE) { printf ("ERROR for NAN (2)\n"); + printf ("Expected 0, got %d\n", c); + printf ("Expected flags:"); + flags_out (MPFR_FLAGS_ERANGE); + printf ("Got flags: "); + flags_out (__gmpfr_flags); #ifdef MPFR_NANISNAN printf ("The reason is that NAN == NAN. Please look at the configure " "output\nand Section \"In case of problem\" of the INSTALL " -- cgit v1.2.1