summaryrefslogtreecommitdiff
path: root/tests/tcmp_d.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-02-23 11:56:19 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-02-23 11:56:19 +0000
commit404f22f85dd315417f26cea1d8bb175128d840cb (patch)
tree07abb340b949b72b79218cb505b0ba018bab784a /tests/tcmp_d.c
parentbc2a35ef7f8157f2deefc639599c64c126c20e83 (diff)
downloadmpfr-404f22f85dd315417f26cea1d8bb175128d840cb.tar.gz
[tests/{tcmp_d.c,tcmp_ld.c}] Full test of the flags for NaN → failure.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10087 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tcmp_d.c')
-rw-r--r--tests/tcmp_d.c19
1 files changed, 15 insertions, 4 deletions
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 "