From add53ee43c546a41b24a2a018962452fd0adebba Mon Sep 17 00:00:00 2001 From: enge Date: Fri, 4 Nov 2011 18:49:20 +0000 Subject: removed inclusion of mpc-impl.h from mpc-tests.h, required to copy some lines into the latter git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@1114 211d60ee-9f03-0410-a15a-8952a2c7a4e4 --- src/mpc-impl.h | 17 ----------------- tests/mpc-tests.h | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/src/mpc-impl.h b/src/mpc-impl.h index 89370e4..4d8aa58 100644 --- a/src/mpc-impl.h +++ b/src/mpc-impl.h @@ -122,23 +122,6 @@ __MPC_DECLSPEC int mpfr_regular_p __MPC_PROTO ((mpfr_srcptr)); /* Consider as NaN all other numbers containing at least one NaN */ -#define MPC_OUT(x) \ -do { \ - printf (#x "[%lu,%lu]=", (unsigned long int) MPC_PREC_RE (x), \ - (unsigned long int) MPC_PREC_IM (x)); \ - mpc_out_str (stdout, 2, 0, x, MPC_RNDNN); \ - printf ("\n"); \ -} while (0) - -#define MPFR_OUT(x) \ -do { \ - printf (#x "[%lu]=", (unsigned long int) mpfr_get_prec (x)); \ - mpfr_out_str (stdout, 2, 0, x, GMP_RNDN); \ - printf ("\n"); \ -} while (0) - - - /* * ASSERT macros */ diff --git a/tests/mpc-tests.h b/tests/mpc-tests.h index c0f7c46..664aa1b 100644 --- a/tests/mpc-tests.h +++ b/tests/mpc-tests.h @@ -21,10 +21,49 @@ along with this program. If not, see http://www.gnu.org/licenses/ . #ifndef __MPC_TESTS_H #define __MPC_TESTS_H +#include "config.h" #include #include +#include +#include "mpc.h" + +/* pieces copied from mpc-impl.h */ +#define MPC_PREC_RE(x) (mpfr_get_prec(mpc_realref(x))) +#define MPC_PREC_IM(x) (mpfr_get_prec(mpc_imagref(x))) +#define MPC_MAX_PREC(x) MPC_MAX(MPC_PREC_RE(x), MPC_PREC_IM(x)) +#define MPC_MAX(h,i) ((h) > (i) ? (h) : (i)) + +#define MPC_OUT(x) \ +do { \ + printf (#x "[%lu,%lu]=", (unsigned long int) MPC_PREC_RE (x), \ + (unsigned long int) MPC_PREC_IM (x)); \ + mpc_out_str (stdout, 2, 0, x, MPC_RNDNN); \ + printf ("\n"); \ +} while (0) + +#define MPFR_OUT(x) \ +do { \ + printf (#x "[%lu]=", (unsigned long int) mpfr_get_prec (x)); \ + mpfr_out_str (stdout, 2, 0, x, GMP_RNDN); \ + printf ("\n"); \ +} while (0) + +#define MPC_ASSERT(expr) \ + do { \ + if (!(expr)) \ + { \ + fprintf (stderr, "%s:%d: MPC assertion failed: %s\n", \ + __FILE__, __LINE__, #expr); \ + abort(); \ + } \ + } while (0) + +__MPC_DECLSPEC int mpc_mul_naive __MPC_PROTO ((mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t)); +__MPC_DECLSPEC int mpc_mul_karatsuba __MPC_PROTO ((mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t)); + + +/* end pieces copied from mpc-impl.h */ -#include "mpc-impl.h" #define MPC_INEX_STR(inex) \ (inex) == 0 ? "(0, 0)" \ -- cgit v1.2.1