summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2011-11-04 18:49:20 +0000
committerenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2011-11-04 18:49:20 +0000
commitadd53ee43c546a41b24a2a018962452fd0adebba (patch)
tree14eacd320d1a94a551f8ed64f6e4577b64cf3d3b
parent73e54f5b55699ef0e099c8c2678090a62d1d10c1 (diff)
downloadmpc-add53ee43c546a41b24a2a018962452fd0adebba.tar.gz
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
-rw-r--r--src/mpc-impl.h17
-rw-r--r--tests/mpc-tests.h41
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 <stdio.h>
#include <ctype.h>
+#include <stdlib.h>
+#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)" \