diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-12-27 15:59:46 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-12-27 15:59:46 +0000 |
commit | 3c1355e2d78c8ea82e09e8474e9fd4695752b016 (patch) | |
tree | 7b7ca543f1a071b790e521891472667bb8a49ba6 /tests/texceptions.c | |
parent | 50ef3fcb7f2308ba5cbc7ad3c9d6aa2533eebdb9 (diff) | |
download | mpfr-3c1355e2d78c8ea82e09e8474e9fd4695752b016.tar.gz |
texceptions.c: restore the exponent range.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5134 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/texceptions.c')
-rw-r--r-- | tests/texceptions.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/texceptions.c b/tests/texceptions.c index cfe37162f..ff5a73b48 100644 --- a/tests/texceptions.c +++ b/tests/texceptions.c @@ -65,6 +65,11 @@ check_default_rnd (void) static void check_emin_emax (void) { + mp_exp_t old_emin, old_emax; + + old_emin = mpfr_get_emin (); + old_emax = mpfr_get_emax (); + /* Check the functions not the macros ! */ if ((mpfr_set_emin)(MPFR_EMIN_MIN) != 0) ERROR("set_emin failed!"); @@ -88,6 +93,9 @@ check_emin_emax (void) ERROR ("get_emax_min"); if ((mpfr_get_emax_max) () != MPFR_EMAX_MAX) ERROR ("get_emax_max"); + + set_emin (old_emin); + set_emax (old_emax); } static void @@ -131,7 +139,11 @@ static void check_flags (void) { mpfr_t x; - mpfr_init(x); + mp_exp_t old_emin, old_emax; + + old_emin = mpfr_get_emin (); + old_emax = mpfr_get_emax (); + mpfr_init (x); /* Check the functions not the macros ! */ (mpfr_clear_flags)(); @@ -168,7 +180,9 @@ check_flags (void) if (!(mpfr_erangeflag_p)()) ERROR ("ERROR: No erange flag!\n"); - mpfr_clear(x); + mpfr_clear (x); + set_emin (old_emin); + set_emax (old_emax); } static void @@ -368,6 +382,9 @@ main (int argc, char *argv[]) mpfr_clear (x); mpfr_clear (y); + set_emin (emin); + set_emax (emax); + check_emin_emax(); check_flags(); check_set_get_prec (); |