summaryrefslogtreecommitdiff
path: root/tests/tests.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2010-08-23 14:03:07 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2010-08-23 14:03:07 +0000
commitcacfe329c174bd70119cefbbe09ade21ee33f742 (patch)
treeacf4ea2d95bf416efbde2e87302ae9173d037b75 /tests/tests.c
parent914111184a397b4d178a1d2b3b543cadf7735bcf (diff)
downloadmpfr-cacfe329c174bd70119cefbbe09ade21ee33f742.tar.gz
[tests/{mpfr-test.h,tests.c}] Added flags_out function to output flags.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7103 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tests.c')
-rw-r--r--tests/tests.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/tests.c b/tests/tests.c
index 77782ccc0..eb56a77b2 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -932,3 +932,23 @@ bad_cases (int (*fct)(FLIST), int (*inv)(FLIST), char *name,
}
mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
+
+void
+flags_out (unsigned int flags)
+{
+ int none = 1;
+
+ if (flags & MPFR_FLAGS_UNDERFLOW)
+ none = 0, printf (" underflow");
+ if (flags & MPFR_FLAGS_OVERFLOW)
+ none = 0, printf (" overflow");
+ if (flags & MPFR_FLAGS_NAN)
+ none = 0, printf (" nan");
+ if (flags & MPFR_FLAGS_INEXACT)
+ none = 0, printf (" inexact");
+ if (flags & MPFR_FLAGS_ERANGE)
+ none = 0, printf (" erange");
+ if (none)
+ printf (" none");
+ printf (" (%u)\n", flags);
+}