summaryrefslogtreecommitdiff
path: root/tests/tget_set_d128.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-06-19 11:47:27 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-06-19 11:47:27 +0000
commite4d6a766713481e7074a84327bdb0b1543888066 (patch)
tree68186f0c757843ce4bc05366ef9aa12b9b796c94 /tests/tget_set_d128.c
parent02038fbaa0ab0ed00c98f035715040354c47b77d (diff)
downloadmpfr-e4d6a766713481e7074a84327bdb0b1543888066.tar.gz
[tests/tget_set_d128.c] Test the flags too.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@12781 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tget_set_d128.c')
-rw-r--r--tests/tget_set_d128.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/tget_set_d128.c b/tests/tget_set_d128.c
index 81810afa9..64f75d8c1 100644
--- a/tests/tget_set_d128.c
+++ b/tests/tget_set_d128.c
@@ -34,19 +34,24 @@ test_set (void)
{
long v[] = { 1, -1, 2147483647, -2147483647 };
mpfr_t x;
+ mpfr_flags_t flags;
int i, inex;
mpfr_init2 (x, 53);
for (i = 0; i < numberof (v); i++)
{
+ mpfr_clear_flags ();
inex = mpfr_set_decimal128 (x, (_Decimal128) v[i], MPFR_RNDN);
- if (mpfr_cmp_si (x, v[i]) != 0 || inex != 0)
+ flags = __gmpfr_flags;
+ if (mpfr_cmp_si (x, v[i]) != 0 || inex != 0 || flags != 0)
{
printf ("Error in test_set for i=%d\n", i);
- printf ("Expected %ld\n with inex = 0\n", v[i]);
+ printf ("Expected %ld\n with inex = 0 and flags =", v[i]);
+ flags_out (0);
printf ("Got ");
mpfr_dump (x);
- printf (" with inex = %d\n", inex);
+ printf (" with inex = %d and flags =", inex);
+ flags_out (flags);
exit (1);
}
}