From e4d6a766713481e7074a84327bdb0b1543888066 Mon Sep 17 00:00:00 2001 From: vlefevre Date: Tue, 19 Jun 2018 11:47:27 +0000 Subject: [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 --- tests/tget_set_d128.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/tget_set_d128.c') 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); } } -- cgit v1.2.1