summaryrefslogtreecommitdiff
path: root/tests/turandom.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2017-01-23 11:38:04 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2017-01-23 11:38:04 +0000
commitf0a8dcd800710bfdee1388b2fcb9b8463829c5c6 (patch)
treef4e366a8e68d940bfd97b85c539d9b8916b2bdfa /tests/turandom.c
parent6f7eabefbcb4c242409d1ee5641b4505e505cda3 (diff)
downloadmpfr-f0a8dcd800710bfdee1388b2fcb9b8463829c5c6.tar.gz
[tests/turandom.c] added non-regression test
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11221 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/turandom.c')
-rw-r--r--tests/turandom.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/turandom.c b/tests/turandom.c
index 186733b04..dbd21cbbe 100644
--- a/tests/turandom.c
+++ b/tests/turandom.c
@@ -191,6 +191,24 @@ bug20100914 (void)
gmp_randclear (s);
}
+/* non-regression test for bug reported by Trevor Spiteri
+ https://sympa.inria.fr/sympa/arc/mpfr/2017-01/msg00020.html */
+static void
+bug20170123 (void)
+{
+ mpfr_t x;
+ mpfr_exp_t emin;
+
+ emin = mpfr_get_emin ();
+ mpfr_set_emin (-7);
+ mpfr_init2 (x, 53);
+ gmp_randseed_ui (mpfr_rands, 398);
+ mpfr_urandom (x, mpfr_rands, MPFR_RNDN);
+ MPFR_ASSERTN(mpfr_cmp_ui_2exp (x, 1, -8) == 0);
+ mpfr_clear (x);
+ mpfr_set_emin (emin);
+}
+
int
main (int argc, char *argv[])
{
@@ -248,6 +266,8 @@ main (int argc, char *argv[])
bug20100914 ();
#endif
+ bug20170123 ();
+
tests_end_mpfr ();
return 0;
}