summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO5
-rw-r--r--src/mpc-impl.h4
-rw-r--r--tests/read_data.c44
-rw-r--r--tests/tcos.c8
-rw-r--r--tests/tcosh.c8
-rw-r--r--tests/tgeneric.c152
-rw-r--r--tests/tio_str.c14
-rw-r--r--tests/tmul_i.c14
-rw-r--r--tests/tset.c24
-rw-r--r--tests/tsqr.c4
-rw-r--r--tests/tstrtoc.c10
-rw-r--r--tests/ttan.c8
12 files changed, 150 insertions, 145 deletions
diff --git a/TODO b/TODO
index a6abca2..d7cb290 100644
--- a/TODO
+++ b/TODO
@@ -17,3 +17,8 @@ New tests to add:
- from Andreas Enge and Philippe Théveny 9 April 2008
correct handling of Nan and infinities in the case of
intermediate overflows while the result may fit (we need special code)
+
+Code clean-up:
+- from Andreas Enge 12 January 2011
+ factor out code such as test_failed in ttan.c, error message in
+ bug20090105 of tcos.c etc. into one macro in mpc-tests.h
diff --git a/src/mpc-impl.h b/src/mpc-impl.h
index 5907083..53230b5 100644
--- a/src/mpc-impl.h
+++ b/src/mpc-impl.h
@@ -1,6 +1,6 @@
/* mpc-impl.h -- Internal include file for mpc.
-Copyright (C) 2002, 2004, 2005, 2008, 2009, 2010 Andreas Enge, Philippe Th\'eveny, Paul Zimmermann
+Copyright (C) 2002, 2004, 2005, 2008, 2009, 2010, 2011 Andreas Enge, Philippe Th\'eveny, Paul Zimmermann
This file is part of the MPC Library.
@@ -110,7 +110,7 @@ MA 02111-1307, USA. */
/* Consider as NaN all other numbers containing at least one NaN */
-#define OUT(x) \
+#define MPC_OUT(x) \
do { \
printf (#x "[%lu,%lu]=", (unsigned long int) MPC_PREC_RE (x), \
(unsigned long int) MPC_PREC_IM (x)); \
diff --git a/tests/read_data.c b/tests/read_data.c
index 72449be..77e74f9 100644
--- a/tests/read_data.c
+++ b/tests/read_data.c
@@ -1,6 +1,6 @@
/* Read data file and check function.
-Copyright (C) 2008, 2009, 2010 Andreas Enge, Philippe Th\'eveny
+Copyright (C) 2008, 2009, 2010, 2011 Andreas Enge, Philippe Th\'eveny
This file is part of the MPC Library.
@@ -575,7 +575,7 @@ data_check (mpc_function function, const char *file_name)
if (inex_re != TERNARY_NOT_CHECKED && inex_re != inex)
printf("ternary value: got %s, expected %s\n",
MPFR_INEX_STR (inex), MPFR_INEX_STR (inex_re));
- OUT (op);
+ MPC_OUT (op);
printf (" ");
MPFR_OUT (got);
MPFR_OUT (expected);
@@ -602,10 +602,10 @@ data_check (mpc_function function, const char *file_name)
printf("ternary value: got %s, expected (%s, %s)\n",
MPC_INEX_STR (inex),
MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
- OUT (op);
+ MPC_OUT (op);
printf (" ");
- OUT (got);
- OUT (expected);
+ MPC_OUT (got);
+ MPC_OUT (expected);
exit (1);
}
@@ -631,11 +631,11 @@ data_check (mpc_function function, const char *file_name)
printf("ternary value: got %s, expected (%s, %s)\n",
MPC_INEX_STR (inex),
MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
- OUT (op1);
- OUT (op2);
+ MPC_OUT (op1);
+ MPC_OUT (op2);
printf (" ");
- OUT (got);
- OUT (expected);
+ MPC_OUT (got);
+ MPC_OUT (expected);
exit (1);
}
@@ -658,11 +658,11 @@ data_check (mpc_function function, const char *file_name)
printf("ternary value: got %s, expected (%s, %s)\n",
MPC_INEX_STR (inex),
MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
- OUT (op1);
- OUT (op2);
+ MPC_OUT (op1);
+ MPC_OUT (op2);
printf (" ");
- OUT (got);
- OUT (expected);
+ MPC_OUT (got);
+ MPC_OUT (expected);
exit (1);
}
@@ -691,10 +691,10 @@ data_check (mpc_function function, const char *file_name)
MPC_INEX_STR (inex),
MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
MPFR_OUT (op1);
- OUT (op2);
+ MPC_OUT (op2);
printf (" ");
- OUT (got);
- OUT (expected);
+ MPC_OUT (got);
+ MPC_OUT (expected);
exit (1);
}
@@ -721,11 +721,11 @@ data_check (mpc_function function, const char *file_name)
printf("ternary value: got %s, expected (%s, %s)\n",
MPC_INEX_STR (inex),
MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
- OUT (op1);
+ MPC_OUT (op1);
MPFR_OUT (op2);
printf (" ");
- OUT (got);
- OUT (expected);
+ MPC_OUT (got);
+ MPC_OUT (expected);
exit (1);
}
@@ -750,10 +750,10 @@ data_check (mpc_function function, const char *file_name)
printf("ternary value: got %s, expected (%s, %s)\n",
MPC_INEX_STR (inex),
MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
- OUT (op1);
+ MPC_OUT (op1);
printf ("op2 %lu\n ", ui);
- OUT (got);
- OUT (expected);
+ MPC_OUT (got);
+ MPC_OUT (expected);
exit (1);
}
diff --git a/tests/tcos.c b/tests/tcos.c
index 2204f3a..d501a37 100644
--- a/tests/tcos.c
+++ b/tests/tcos.c
@@ -1,6 +1,6 @@
/* test file for mpc_cos.
-Copyright (C) 2008, 2009 Andreas Enge, Philippe Th\'eveny
+Copyright (C) 2008, 2009, 2011 Andreas Enge, Philippe Th\'eveny
This file is part of the MPC Library.
@@ -43,10 +43,10 @@ bug20090105 (void)
if (mpc_cmp (got, expected) != 0)
{
printf ("Error in bug20090105: cos(op) with rounding mode MPC_RNDNN\n");
- OUT (op);
- OUT (expected);
+ MPC_OUT (op);
+ MPC_OUT (expected);
printf(" ");
- OUT (got);
+ MPC_OUT (got);
exit (1);
}
diff --git a/tests/tcosh.c b/tests/tcosh.c
index 84fa812..d6c4a68 100644
--- a/tests/tcosh.c
+++ b/tests/tcosh.c
@@ -1,6 +1,6 @@
/* test file for mpc_cosh.
-Copyright (C) 2008, 2009, 2010 Philippe Th\'eveny, Paul Zimmermann, Andreas Enge
+Copyright (C) 2008, 2009, 2010, 2011 Philippe Th\'eveny, Paul Zimmermann, Andreas Enge
This file is part of the MPC Library.
@@ -27,10 +27,10 @@ static void
test_failed (mpc_t op, mpc_t get, mpc_t expected)
{
printf ("mpc_cosh(op) failed\n with ");
- OUT (op);
+ MPC_OUT (op);
printf (" ");
- OUT (get);
- OUT (expected);
+ MPC_OUT (get);
+ MPC_OUT (expected);
exit (1);
}
diff --git a/tests/tgeneric.c b/tests/tgeneric.c
index d25d094..9741206 100644
--- a/tests/tgeneric.c
+++ b/tests/tgeneric.c
@@ -1,6 +1,6 @@
/* File for generic tests.
-Copyright (C) 2008, 2009, 2010 Philippe Th\'eveny, Andreas Enge, Paul Zimmermann
+Copyright (C) 2008, 2009, 2010, 2011 Philippe Th\'eveny, Andreas Enge, Paul Zimmermann
This file is part of the MPC Library.
@@ -59,18 +59,18 @@ tgeneric_cc (mpc_function *function, mpc_ptr op, mpc_ptr rop,
/* rounding failed */
printf ("Rounding in %s might be incorrect for\n", function->name);
- OUT (op);
+ MPC_OUT (op);
printf ("with rounding mode (%s, %s)",
mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
printf ("\n%s gives ", function->name);
- OUT (rop);
+ MPC_OUT (rop);
printf ("%s quadruple precision gives ", function->name);
- OUT (rop4);
+ MPC_OUT (rop4);
printf ("and is rounded to ");
- OUT (rop4rnd);
+ MPC_OUT (rop4rnd);
exit (1);
}
@@ -90,7 +90,7 @@ tgeneric_fc (mpc_function *function, mpc_ptr op, mpfr_ptr rop,
return;
printf ("Rounding in %s might be incorrect for\n", function->name);
- OUT (op);
+ MPC_OUT (op);
printf ("with rounding mode %s", mpfr_print_rnd_mode (rnd));
printf ("\n%s gives ", function->name);
@@ -124,17 +124,17 @@ tgeneric_cfc (mpc_function *function, mpfr_ptr op1, mpc_ptr op2,
printf ("Rounding in %s might be incorrect for\n", function->name);
MPFR_OUT (op1);
- OUT (op2);
+ MPC_OUT (op2);
printf ("with rounding mode (%s, %s)",
mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
printf ("\n%s gives ", function->name);
- OUT (rop);
+ MPC_OUT (rop);
printf ("%s quadruple precision gives ", function->name);
- OUT (rop4);
+ MPC_OUT (rop4);
printf ("and is rounded to ");
- OUT (rop4rnd);
+ MPC_OUT (rop4rnd);
exit (1);
}
@@ -159,18 +159,18 @@ tgeneric_ccf (mpc_function *function, mpc_ptr op1, mpfr_ptr op2,
return;
printf ("Rounding in %s might be incorrect for\n", function->name);
- OUT (op1);
+ MPC_OUT (op1);
MPFR_OUT (op2);
printf ("with rounding mode (%s, %s)",
mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
printf ("\n%s gives ", function->name);
- OUT (rop);
+ MPC_OUT (rop);
printf ("%s quadruple precision gives ", function->name);
- OUT (rop4);
+ MPC_OUT (rop4);
printf ("and is rounded to ");
- OUT (rop4rnd);
+ MPC_OUT (rop4rnd);
exit (1);
}
@@ -203,18 +203,18 @@ tgeneric_ccc (mpc_function *function, mpc_ptr op1, mpc_ptr op2,
/* rounding failed */
printf ("Rounding in %s might be incorrect for\n", function->name);
- OUT (op1);
- OUT (op2);
+ MPC_OUT (op1);
+ MPC_OUT (op2);
printf ("with rounding mode (%s, %s)",
mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
printf ("\n%s gives ", function->name);
- OUT (rop);
+ MPC_OUT (rop);
printf ("%s quadruple precision gives ", function->name);
- OUT (rop4);
+ MPC_OUT (rop4);
printf ("and is rounded to ");
- OUT (rop4rnd);
+ MPC_OUT (rop4rnd);
exit (1);
}
@@ -239,18 +239,18 @@ tgeneric_ccu (mpc_function *function, mpc_ptr op1, unsigned long int op2,
return;
printf ("Rounding in %s might be incorrect for\n", function->name);
- OUT (op1);
+ MPC_OUT (op1);
printf ("op2=%lu\n", op2);
printf ("with rounding mode (%s, %s)",
mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
printf ("\n%s gives ", function->name);
- OUT (rop);
+ MPC_OUT (rop);
printf ("%s quadruple precision gives ", function->name);
- OUT (rop4);
+ MPC_OUT (rop4);
printf ("and is rounded to ");
- OUT (rop4rnd);
+ MPC_OUT (rop4rnd);
exit (1);
}
@@ -276,17 +276,17 @@ tgeneric_cuc (mpc_function *function, unsigned long int op1, mpc_ptr op2,
printf ("Rounding in %s might be incorrect for\n", function->name);
printf ("op1=%lu\n", op1);
- OUT (op2);
+ MPC_OUT (op2);
printf ("with rounding mode (%s, %s)",
mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
printf ("\n%s gives ", function->name);
- OUT (rop);
+ MPC_OUT (rop);
printf ("%s quadruple precision gives ", function->name);
- OUT (rop4);
+ MPC_OUT (rop4);
printf ("and is rounded to ");
- OUT (rop4rnd);
+ MPC_OUT (rop4rnd);
exit (1);
}
@@ -311,18 +311,18 @@ tgeneric_ccs (mpc_function *function, mpc_ptr op1, long int op2,
return;
printf ("Rounding in %s might be incorrect for\n", function->name);
- OUT (op1);
+ MPC_OUT (op1);
printf ("op2=%ld\n", op2);
printf ("with rounding mode (%s, %s)",
mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
printf ("\n%s gives ", function->name);
- OUT (rop);
+ MPC_OUT (rop);
printf ("%s quadruple precision gives ", function->name);
- OUT (rop4);
+ MPC_OUT (rop4);
printf ("and is rounded to ");
- OUT (rop4rnd);
+ MPC_OUT (rop4rnd);
exit (1);
}
@@ -348,18 +348,18 @@ tgeneric_cci (mpc_function *function, mpc_ptr op1, int op2,
return;
printf ("Rounding in %s might be incorrect for\n", function->name);
- OUT (op1);
+ MPC_OUT (op1);
printf ("op2=%d\n", op2);
printf ("with rounding mode (%s, %s)",
mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
printf ("\n%s gives ", function->name);
- OUT (rop);
+ MPC_OUT (rop);
printf ("%s quadruple precision gives ", function->name);
- OUT (rop4);
+ MPC_OUT (rop4);
printf ("and is rounded to ");
- OUT (rop4rnd);
+ MPC_OUT (rop4rnd);
exit (1);
}
@@ -387,17 +387,17 @@ tgeneric_cuuc (mpc_function *function, unsigned long int op1,
printf ("Rounding in %s might be incorrect for\n", function->name);
printf ("op1=%lu\n", op1);
printf ("op2=%lu\n", op2);
- OUT (op3);
+ MPC_OUT (op3);
printf ("with rounding mode (%s, %s)",
mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
printf ("\n%s gives ", function->name);
- OUT (rop);
+ MPC_OUT (rop);
printf ("%s quadruple precision gives ", function->name);
- OUT (rop4);
+ MPC_OUT (rop4);
printf ("and is rounded to ");
- OUT (rop4rnd);
+ MPC_OUT (rop4rnd);
exit (1);
}
@@ -416,9 +416,9 @@ reuse_cc (mpc_function* function, mpc_srcptr z, mpc_ptr got, mpc_ptr expected)
if (!same_mpc_value (got, expected, ks))
{
printf ("Error for %s(z, z) for\n", function->name);
- OUT (z);
- OUT (expected);
- OUT (got);
+ MPC_OUT (z);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
@@ -435,7 +435,7 @@ reuse_fc (mpc_function* function, mpc_ptr z, mpc_ptr x, mpfr_ptr expected)
mpfr_t got;
got[0] = MPC_RE(x)[0]; /* display sensible name */
printf ("Error for %s(MPC_RE(z), z) for\n", function->name);
- OUT (z);
+ MPC_OUT (z);
MPFR_OUT (expected);
MPFR_OUT (got);
@@ -448,7 +448,7 @@ reuse_fc (mpc_function* function, mpc_ptr z, mpc_ptr x, mpfr_ptr expected)
mpfr_t got;
got[0] = MPC_IM(x)[0]; /* display sensible name */
printf ("Error for %s(MPC_IM(z), z) for \n", function->name);
- OUT (z);
+ MPC_OUT (z);
MPFR_OUT (expected);
MPFR_OUT (got);
@@ -469,9 +469,9 @@ reuse_cfc (mpc_function* function, mpc_srcptr z, mpfr_srcptr x, mpc_ptr got,
{
printf ("Error for %s(z, x, z) for\n", function->name);
MPFR_OUT (x);
- OUT (z);
- OUT (expected);
- OUT (got);
+ MPC_OUT (z);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
@@ -489,10 +489,10 @@ reuse_ccf (mpc_function* function, mpc_srcptr z, mpfr_srcptr x, mpc_ptr got,
if (!same_mpc_value (got, expected, ks))
{
printf ("Error for %s(z, z, x) for\n", function->name);
- OUT (z);
+ MPC_OUT (z);
MPFR_OUT (x);
- OUT (expected);
- OUT (got);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
@@ -510,10 +510,10 @@ reuse_ccc (mpc_function* function, mpc_srcptr z, mpc_srcptr x,
if (!same_mpc_value (got, expected, ks))
{
printf ("Error for %s(z, z, x) for\n", function->name);
- OUT (z);
- OUT (x);
- OUT (expected);
- OUT (got);
+ MPC_OUT (z);
+ MPC_OUT (x);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
@@ -523,10 +523,10 @@ reuse_ccc (mpc_function* function, mpc_srcptr z, mpc_srcptr x,
if (!same_mpc_value (got, expected, ks))
{
printf ("Error for %s(x, z, x) for\n", function->name);
- OUT (z);
- OUT (x);
- OUT (expected);
- OUT (got);
+ MPC_OUT (z);
+ MPC_OUT (x);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
@@ -536,9 +536,9 @@ reuse_ccc (mpc_function* function, mpc_srcptr z, mpc_srcptr x,
if (!same_mpc_value (got, expected, ks))
{
printf ("Error for %s(x, x, x) for\n", function->name);
- OUT (x);
- OUT (expected);
- OUT (got);
+ MPC_OUT (x);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
@@ -556,10 +556,10 @@ reuse_ccu (mpc_function* function, mpc_srcptr z, unsigned long ul,
if (!same_mpc_value (got, expected, ks))
{
printf ("Error for %s(z, z, n) for\n", function->name);
- OUT (z);
+ MPC_OUT (z);
printf ("n=%lu\n", ul);
- OUT (expected);
- OUT (got);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
@@ -578,9 +578,9 @@ reuse_cuc (mpc_function* function, unsigned long ul, mpc_srcptr z,
{
printf ("Error for %s(z, n, z) for\n", function->name);
printf ("n=%lu\n", ul);
- OUT (z);
- OUT (expected);
- OUT (got);
+ MPC_OUT (z);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
@@ -598,10 +598,10 @@ reuse_ccs (mpc_function* function, mpc_srcptr z, long lo,
if (!same_mpc_value (got, expected, ks))
{
printf ("Error for %s(z, z, n) for\n", function->name);
- OUT (z);
+ MPC_OUT (z);
printf ("n=%ld\n", lo);
- OUT (expected);
- OUT (got);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
@@ -619,10 +619,10 @@ reuse_cci (mpc_function* function, mpc_srcptr z, int i,
if (!same_mpc_value (got, expected, ks))
{
printf ("Error for %s(z, z, n) for\n", function->name);
- OUT (z);
+ MPC_OUT (z);
printf ("n=%d\n", i);
- OUT (expected);
- OUT (got);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
@@ -642,9 +642,9 @@ reuse_cuuc (mpc_function* function, unsigned long ul1, unsigned long ul2,
printf ("Error for %s(z, m, n, z) for\n", function->name);
printf ("m=%lu\n", ul1);
printf ("n=%lu\n", ul2);
- OUT (z);
- OUT (expected);
- OUT (got);
+ MPC_OUT (z);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
diff --git a/tests/tio_str.c b/tests/tio_str.c
index c2d59f6..1ef77a5 100644
--- a/tests/tio_str.c
+++ b/tests/tio_str.c
@@ -1,6 +1,6 @@
/* tio_str.c -- Test file for mpc_inp_str and mpc_out_str.
-Copyright (C) 2009 Philippe Th\'eveny, Andreas Enge
+Copyright (C) 2009, 2011 Philippe Th\'eveny, Andreas Enge
This file is part of the MPC Library.
@@ -94,8 +94,8 @@ check_file (const char* file_name)
printf (" got size: %lu\nexpected size: %lu\n ",
(unsigned long int) size, (unsigned long int) expected_size);
printf (" ");
- OUT (got);
- OUT (expected);
+ MPC_OUT (got);
+ MPC_OUT (expected);
exit (1);
}
@@ -148,8 +148,8 @@ check_io_str (mpc_ptr read_number, mpc_ptr expected)
if (mpc_cmp (read_number, expected) != 0 || mpfr_erangeflag_p())
{
printf ("Error: inp_str o out_str <> Id\n");
- OUT (read_number);
- OUT (expected);
+ MPC_OUT (read_number);
+ MPC_OUT (expected);
exit (1);
}
@@ -196,8 +196,8 @@ check_stdout (mpc_ptr read_number, mpc_ptr expected)
{
printf ("mpc_inp_str did not read the number which was written by "
"mpc_out_str\n");
- OUT (read_number);
- OUT (expected);
+ MPC_OUT (read_number);
+ MPC_OUT (expected);
exit (1);
}
fflush(stdin);
diff --git a/tests/tmul_i.c b/tests/tmul_i.c
index 753e0de..83bca46 100644
--- a/tests/tmul_i.c
+++ b/tests/tmul_i.c
@@ -1,6 +1,6 @@
/* tmul_i -- test file for mpc_mul_i.
-Copyright (C) 2008, 2009, 2010 Philippe Theveny, Andreas Enge
+Copyright (C) 2008, 2009, 2010, 2011 Philippe Theveny, Andreas Enge
This file is part of the MPC Library.
@@ -54,10 +54,10 @@ check_different_precisions(void)
if (mpc_cmp(got, expected) != 0)
{
printf ("Error for mpc_mul_i(z, z, n) for\n");
- OUT (z);
+ MPC_OUT (z);
printf ("n=+1\n");
- OUT (expected);
- OUT (got);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
@@ -68,10 +68,10 @@ check_different_precisions(void)
if (mpc_cmp(got, expected) != 0)
{
printf ("Error for mpc_mul_i(z, z, n) for\n");
- OUT (z);
+ MPC_OUT (z);
printf ("n=-1\n");
- OUT (expected);
- OUT (got);
+ MPC_OUT (expected);
+ MPC_OUT (got);
exit (1);
}
diff --git a/tests/tset.c b/tests/tset.c
index 70a0295..9e9d092 100644
--- a/tests/tset.c
+++ b/tests/tset.c
@@ -1,6 +1,6 @@
/* tset.c -- Test file for mpc_set_x and mpc_set_x_x functions.
-Copyright (C) 2009, 2010 Philippe Th\'eveny, Paul Zimmermann, Andreas Enge
+Copyright (C) 2009, 2010, 2011 Philippe Th\'eveny, Paul Zimmermann, Andreas Enge
This file is part of the MPC Library.
@@ -44,7 +44,7 @@ MA 02111-1307, USA. */
do { \
printf ("Error in "function_name" for prec = %lu\n", \
(unsigned long int) precision); \
- OUT(a); \
+ MPC_OUT(a); \
exit (1); \
} while (0)
@@ -154,8 +154,8 @@ check_set (void)
{
printf ("Error in mpc_set for prec = %lu\n",
(unsigned long int) prec);
- OUT(z);
- OUT(x);
+ MPC_OUT(z);
+ MPC_OUT(x);
exit (1);
}
@@ -350,9 +350,9 @@ check_set_str (mpfr_exp_t exp_max)
{
printf ("Error: mpc_set_str o mpc_get_str != Id\n"
"in base %u with str=\"%s\"\n", base, str);
- OUT (expected);
+ MPC_OUT (expected);
printf (" ");
- OUT (got);
+ MPC_OUT (got);
exit (1);
}
mpc_free_str (str);
@@ -364,9 +364,9 @@ check_set_str (mpfr_exp_t exp_max)
{
printf ("Error: mpc_set_str o mpc_get_str != Id\n"
"in base %u with str=\"%s\"\n", base, str);
- OUT (expected);
+ MPC_OUT (expected);
printf (" ");
- OUT (got);
+ MPC_OUT (got);
exit (1);
}
mpc_free_str (str);
@@ -386,9 +386,9 @@ check_set_str (mpfr_exp_t exp_max)
{
printf ("Error: mpc_set_str o mpc_get_str != Id\n"
"with str=\"%s\"\n", str);
- OUT (expected);
+ MPC_OUT (expected);
printf (" ");
- OUT (got);
+ MPC_OUT (got);
exit (1);
}
mpc_free_str (str);
@@ -408,9 +408,9 @@ check_set_str (mpfr_exp_t exp_max)
{
printf ("Error: mpc_set_str o mpc_get_str != Id\n"
"with str=\"%s\"\n", str);
- OUT (expected);
+ MPC_OUT (expected);
printf (" ");
- OUT (got);
+ MPC_OUT (got);
exit (1);
}
mpc_free_str (str);
diff --git a/tests/tsqr.c b/tests/tsqr.c
index 5904f33..9d7ff7f 100644
--- a/tests/tsqr.c
+++ b/tests/tsqr.c
@@ -1,6 +1,6 @@
/* tsqr -- test file for mpc_sqr.
-Copyright (C) 2002, 2005, 2008, 2010 Andreas Enge, Paul Zimmermann, Philippe Th\'eveny
+Copyright (C) 2002, 2005, 2008, 2010, 2011 Andreas Enge, Paul Zimmermann, Philippe Th\'eveny
This file is part of the MPC Library.
@@ -158,7 +158,7 @@ reuse_bug (void)
||!mpfr_zero_p (MPC_IM (z1)) || !mpfr_signbit (MPC_IM (z1)))
{
printf ("Error: Regression, bug 20081021 reproduced\n");
- OUT (z1);
+ MPC_OUT (z1);
exit (1);
}
diff --git a/tests/tstrtoc.c b/tests/tstrtoc.c
index d740478..a3b5326 100644
--- a/tests/tstrtoc.c
+++ b/tests/tstrtoc.c
@@ -1,6 +1,6 @@
/* test file for mpc_strtoc.
-Copyright (C) 2009 Philippe Th\'eveny, Andreas Enge
+Copyright (C) 2009, 2011 Philippe Th\'eveny, Andreas Enge
This file is part of the MPC Library.
@@ -53,7 +53,7 @@ check_file (const char* file_name)
fp = open_data_file (file_name);
-
+
/* initializations */
str = (char *) malloc (str_len);
if (str == NULL)
@@ -118,8 +118,8 @@ check_file (const char* file_name)
else
{
printf (" ");
- OUT (got);
- OUT (expected);
+ MPC_OUT (got);
+ MPC_OUT (expected);
}
exit (1);
}
@@ -151,7 +151,7 @@ check_null (void)
{
printf ("Error: mpc_strtoc(z, NULL) with a NULL pointer should fail"
" and the z value should be set to NaN +I*NaN\ngot ");
- OUT (z);
+ MPC_OUT (z);
exit (1);
}
diff --git a/tests/ttan.c b/tests/ttan.c
index 715c403..c67af79 100644
--- a/tests/ttan.c
+++ b/tests/ttan.c
@@ -1,6 +1,6 @@
/* test file for mpc_tan.
-Copyright (C) 2008 Philippe Th\'eveny, Paul Zimmermann, Andreas Enge
+Copyright (C) 2008, 2011 Philippe Th\'eveny, Paul Zimmermann, Andreas Enge
This file is part of the MPC Library.
@@ -26,10 +26,10 @@ static void
test_failed (mpc_t op, mpc_t get, mpc_t expected)
{
printf ("mpc_tan(op) failed\n with ");
- OUT (op);
+ MPC_OUT (op);
printf (" ");
- OUT (get);
- OUT (expected);
+ MPC_OUT (get);
+ MPC_OUT (expected);
exit (1);
}