summaryrefslogtreecommitdiff
path: root/tests/tsinh.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-14 23:05:51 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-14 23:05:51 +0000
commit6e5ffc68a8061e42a2680dd99455f89e2f4f8ca9 (patch)
tree3150eedf9dc6ae8d160042147ff46ac533e723dd /tests/tsinh.c
parentf095a6c8a44a63379841097ddfbf4682e56e4036 (diff)
downloadmpfr-6e5ffc68a8061e42a2680dd99455f89e2f4f8ca9.tar.gz
new coverage tests
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2714 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tsinh.c')
-rw-r--r--tests/tsinh.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/tsinh.c b/tests/tsinh.c
index 1739e35c6..e2e76983b 100644
--- a/tests/tsinh.c
+++ b/tests/tsinh.c
@@ -1,6 +1,6 @@
/* Test file for mpfr_sinh.
-Copyright 2001, 2002 Free Software Foundation.
+Copyright 2001, 2002, 2004 Free Software Foundation.
Adapted from tarctan.c.
This file is part of the MPFR Library.
@@ -28,11 +28,45 @@ MA 02111-1307, USA. */
#define TEST_FUNCTION mpfr_sinh
#include "tgeneric.c"
+static void
+special (void)
+{
+ mpfr_t x;
+
+ mpfr_init (x);
+
+ mpfr_set_nan (x);
+ mpfr_sinh (x, x, GMP_RNDN);
+ MPFR_ASSERTN(mpfr_nan_p (x));
+
+ mpfr_set_inf (x, 1);
+ mpfr_sinh (x, x, GMP_RNDN);
+ MPFR_ASSERTN(mpfr_inf_p (x) && mpfr_sgn (x) > 0);
+ mpfr_set_inf (x, -1);
+ mpfr_sinh (x, x, GMP_RNDN);
+ MPFR_ASSERTN(mpfr_inf_p (x) && mpfr_sgn (x) < 0);
+
+ mpfr_set_prec (x, 10);
+ mpfr_set_str_binary (x, "-0.1001011001");
+ mpfr_sinh (x, x, GMP_RNDN);
+ MPFR_ASSERTN(mpfr_cmp_si_2exp (x, -159, -8) == 0);
+
+ /* corner case */
+ mpfr_set_prec (x, 2);
+ mpfr_set_str_binary (x, "1E-6");
+ mpfr_sinh (x, x, GMP_RNDN);
+ MPFR_ASSERTN(mpfr_cmp_ui_2exp (x, 1, -6) == 0);
+
+ mpfr_clear (x);
+}
+
int
main (int argc, char *argv[])
{
tests_start_mpfr ();
+ special ();
+
test_generic (2, 100, 100);
tests_end_mpfr ();