summaryrefslogtreecommitdiff
path: root/tests/tcmp_ui.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2005-06-06 14:13:47 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2005-06-06 14:13:47 +0000
commitdb5c0c2631a3d07b367ebb6fc512bc51f2442661 (patch)
treed84623ae061511ee4ddcd2ec630f27d1b65b1baa /tests/tcmp_ui.c
parentac367785e482c011eed621bbb3a3480b8856cf7f (diff)
downloadmpfr-db5c0c2631a3d07b367ebb6fc512bc51f2442661.tar.gz
Improve coverage test
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3617 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tcmp_ui.c')
-rw-r--r--tests/tcmp_ui.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/tests/tcmp_ui.c b/tests/tcmp_ui.c
index 750f8b1d3..6080df616 100644
--- a/tests/tcmp_ui.c
+++ b/tests/tcmp_ui.c
@@ -67,13 +67,18 @@ main (void)
exit (1);
}
- mpfr_set_ui (x, 0, GMP_RNDN);
- mpfr_ui_div (x, 1, x, GMP_RNDU);
- if (mpfr_cmp_ui (x, 0) == 0)
+ mpfr_set_inf (x, 1);
+ if (mpfr_cmp_ui (x, 1) <= 0)
{
printf ("Error in mpfr_cmp_ui (Inf, 0)\n");
exit (1);
}
+ mpfr_set_inf (x, -1);
+ if (mpfr_cmp_ui (x, 1) >= 0)
+ {
+ printf ("Error in mpfr_cmp_ui (-Inf, 0)\n");
+ exit (1);
+ }
mpfr_set_si (x, -1, GMP_RNDN);
MPFR_ASSERTN(mpfr_cmp_ui (x, 1) < 0);
@@ -100,6 +105,19 @@ main (void)
exit (1);
}
+ mpfr_set_inf (x, 1);
+ if (mpfr_cmp_si (x, -1) <= 0)
+ {
+ printf ("Error in mpfr_cmp_si (Inf, 0)\n");
+ exit (1);
+ }
+ mpfr_set_inf (x, -1);
+ if (mpfr_cmp_si (x, -1) >= 0)
+ {
+ printf ("Error in mpfr_cmp_si (-Inf, 0)\n");
+ exit (1);
+ }
+
/* case b=0 */
mpfr_set_ui (x, 0, GMP_RNDZ);
MPFR_ASSERTN(mpfr_cmp_si (x, 0) == 0);