summaryrefslogtreecommitdiff
path: root/tests/tpow.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-02-15 11:45:26 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-02-15 11:45:26 +0000
commit74d346295c5daa390d622079681764bfcf98a4f6 (patch)
treeed4a5039d9a904dc8af10cf1269c00f4fe9e25d2 /tests/tpow.c
parenta6b841ffeebc78b8f0a7ecc3a2306297b73f165b (diff)
downloadmpfr-74d346295c5daa390d622079681764bfcf98a4f6.tar.gz
Added bad_cases tests for mpfr_pow_ui and mpfr_pow_si.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10037 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tpow.c')
-rw-r--r--tests/tpow.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/tpow.c b/tests/tpow.c
index 8081cfc0e..1fa7079d1 100644
--- a/tests/tpow.c
+++ b/tests/tpow.c
@@ -68,6 +68,21 @@ test_pow (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
#define test_generic_ui test_generic_si
#include "tgeneric_ui.c"
+#define DEFN(N) \
+ static int powu##N (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd) \
+ { return mpfr_pow_ui (y, x, N, rnd); } \
+ static int pows##N (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd) \
+ { return mpfr_pow_si (y, x, N, rnd); } \
+ static int root##N (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd) \
+ { return mpfr_root (y, x, N, rnd); }
+
+DEFN(2)
+DEFN(3)
+DEFN(4)
+DEFN(5)
+DEFN(17)
+DEFN(120)
+
static void
check_pow_ui (void)
{
@@ -1624,6 +1639,31 @@ main (int argc, char **argv)
data_check ("data/pow275", mpfr_pow275, "mpfr_pow275");
+ bad_cases (powu2, root2, "mpfr_pow_ui[2]",
+ 8, -256, 255, 4, 128, 800, 40);
+ bad_cases (pows2, root2, "mpfr_pow_ui[2]",
+ 8, -256, 255, 4, 128, 800, 40);
+ bad_cases (powu3, root3, "mpfr_pow_ui[3]",
+ 8, -256, 255, 4, 128, 800, 40);
+ bad_cases (pows3, root3, "mpfr_pow_ui[3]",
+ 8, -256, 255, 4, 128, 800, 40);
+ bad_cases (powu4, root4, "mpfr_pow_ui[4]",
+ 8, -256, 255, 4, 128, 800, 40);
+ bad_cases (pows4, root4, "mpfr_pow_ui[4]",
+ 8, -256, 255, 4, 128, 800, 40);
+ bad_cases (powu5, root5, "mpfr_pow_ui[5]",
+ 8, -256, 255, 4, 128, 800, 40);
+ bad_cases (pows5, root5, "mpfr_pow_ui[5]",
+ 8, -256, 255, 4, 128, 800, 40);
+ bad_cases (powu17, root17, "mpfr_pow_ui[17]",
+ 8, -256, 255, 4, 128, 800, 40);
+ bad_cases (pows17, root17, "mpfr_pow_ui[17]",
+ 8, -256, 255, 4, 128, 800, 40);
+ bad_cases (powu120, root120, "mpfr_pow_ui[120]",
+ 8, -256, 255, 4, 128, 800, 40);
+ bad_cases (pows120, root120, "mpfr_pow_ui[120]",
+ 8, -256, 255, 4, 128, 800, 40);
+
tests_end_mpfr ();
return 0;
}