summaryrefslogtreecommitdiff
path: root/tests/thypot.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-14 11:11:31 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-14 11:11:31 +0000
commitf095a6c8a44a63379841097ddfbf4682e56e4036 (patch)
treeff27c1422f6c4e9e704d35ffc9953571a796f11c /tests/thypot.c
parentaedeae287d6c8de47317f93227626653a622d3ee (diff)
downloadmpfr-f095a6c8a44a63379841097ddfbf4682e56e4036.tar.gz
improved coverage test
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2713 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/thypot.c')
-rw-r--r--tests/thypot.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/thypot.c b/tests/thypot.c
index a93247331..fdb7eefab 100644
--- a/tests/thypot.c
+++ b/tests/thypot.c
@@ -29,6 +29,29 @@ MA 02111-1307, USA. */
#define TEST_FUNCTION mpfr_hypot
static void
+special (void)
+{
+ mpfr_t x, y, z;
+
+ mpfr_init (x);
+ mpfr_init (y);
+ mpfr_init (z);
+
+ mpfr_set_nan (x);
+ mpfr_hypot (z, x, y, GMP_RNDN);
+ MPFR_ASSERTN(mpfr_nan_p (z));
+
+ mpfr_set_inf (x, 1);
+ mpfr_set_inf (y, -1);
+ mpfr_hypot (z, x, y, GMP_RNDN);
+ MPFR_ASSERTN(mpfr_inf_p (z) && mpfr_sgn (z) > 0);
+
+ mpfr_clear (x);
+ mpfr_clear (y);
+ mpfr_clear (z);
+}
+
+static void
test_large (void)
{
mpfr_t x, y, z, t;
@@ -93,6 +116,8 @@ main (int argc, char *argv[])
tests_start_mpfr ();
+ special ();
+
mpfr_init (x1);
mpfr_init (x2);
mpfr_init (y);