summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2010-09-02 15:18:53 +0000
committerenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2010-09-02 15:18:53 +0000
commitf4d8b752160679d4c866ec3d79f793898e57b65d (patch)
tree5e06189c605b54a2b0698bbb6ecc2e2a69f175c5 /tests
parent88ceb9898e44fec1a7ee43c0ed2cb26c94730690 (diff)
downloadmpc-f4d8b752160679d4c866ec3d79f793898e57b65d.tar.gz
tmul.c: moved special values to mul.dat
memory.c: included mpc-tests.h to avoid warning for undeclared prototype git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@830 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests')
-rw-r--r--tests/memory.c2
-rwxr-xr-xtests/mul.dat5
-rw-r--r--tests/sqr.dat4
-rw-r--r--tests/tmul.c33
4 files changed, 8 insertions, 36 deletions
diff --git a/tests/memory.c b/tests/memory.c
index 1af985f..998d99f 100644
--- a/tests/memory.c
+++ b/tests/memory.c
@@ -31,6 +31,8 @@ MA 02110-1301, USA. */
#define __gmp_default_reallocate(p,old,new) realloc(p,new)
#define __gmp_default_free(p,size) free(p)
+#include "mpc-tests.h"
+
/* Each block allocated is a separate malloc, for the benefit of a redzoning
malloc debugger during development or when bug hunting.
diff --git a/tests/mul.dat b/tests/mul.dat
index 5383971..9be5665 100755
--- a/tests/mul.dat
+++ b/tests/mul.dat
@@ -1,6 +1,6 @@
# Data file for mpc_mul
#
-# Copyright (C) 2008 Philippe Th\'eveny, Andreas Enge, Paul Zimmermann
+# Copyright (C) 2008, 2010 Philippe Th\'eveny, Andreas Enge, Paul Zimmermann
#
# This file is part of the MPC Library.
#
@@ -128,3 +128,6 @@
+ - 6 0x33p-315 6 0x9p-497 6 0x3p148 6 0x1dp-73 6 0x11p-463 6 0x3p-645 N N
0 0 4 0x1p-1902 4 0x3p-1085 4 -0x1p-892 4 -0x3p-75 4 -0x1p-1010 4 0 N N
+# a few values, previously hard-coded in tmul.c
+0 0 8 10 8 -5 8 4 8 3 8 1 8 -2 N N
++ + 27 0b1.10110000001100010010000000e-3 27 0b1.00111100000010100001011001e-1 27 0b1.11111011011000010101000000e-2 27 0b1.11010001010110111001110001e-3 27 0b1.10100101110110011011100100e-1 27 0b1.10111100011000001100110011e-1 N N
diff --git a/tests/sqr.dat b/tests/sqr.dat
index 9323b41..d42f09e 100644
--- a/tests/sqr.dat
+++ b/tests/sqr.dat
@@ -1,6 +1,6 @@
# Data file for mpc_sqr.
#
-# Copyright (C) 2008 Philippe Th\'eveny, Andreas Enge
+# Copyright (C) 2008, 2010 Philippe Th\'eveny, Andreas Enge
#
# This file is part of the MPC Library.
#
@@ -136,7 +136,7 @@
# ...and a case where x+y or x-y are 0.
0 0 4 0 4 2 4 1 4 1 N N
-# a few values, moved over from the test file
+# a few values, previously hard-coded in tsqr.c
0 0 8 7 8 24 8 4 8 3 N N
+ + 8 0b1.1000111e-3 8 0b1.1100111e-3 27 0b1.11111011011000010101000000e-2 27 0b1.11010001010110111001110001e-3 N N
diff --git a/tests/tmul.c b/tests/tmul.c
index 9c90ff1..6819a81 100644
--- a/tests/tmul.c
+++ b/tests/tmul.c
@@ -152,38 +152,6 @@ check_regular (void)
}
-static void
-check_special (void)
-{
- mpc_t x, y, z;
- int inexact;
-
- mpc_init2 (x, 8);
- mpc_init2 (y, 8);
- mpc_init2 (z, 8);
-
- mpc_set_si_si (x, 4, 3, MPC_RNDNN);
- mpc_set_si_si (y, 1, -2, MPC_RNDNN);
- inexact = mpc_mul (z, x, y, MPC_RNDNN);
- if (MPC_INEX_RE(inexact) || MPC_INEX_IM(inexact))
- {
- fprintf (stderr, "Error: (4+3*I)*(1-2*I) should be exact with prec=8\n");
- exit (1);
- }
-
- mpc_set_prec (x, 27);
- mpc_set_prec (y, 27);
- mpfr_set_str (MPC_RE(x), "1.11111011011000010101000000e-2", 2, GMP_RNDN);
- mpfr_set_str (MPC_IM(x), "1.11010001010110111001110001e-3", 2, GMP_RNDN);
- mpfr_set_str (MPC_RE(y), "1.10100101110110011011100100e-1", 2, GMP_RNDN);
- mpfr_set_str (MPC_IM(y), "1.10111100011000001100110011e-1", 2, GMP_RNDN);
- cmpmul (x, y, 0);
-
- mpc_clear (x);
- mpc_clear (y);
- mpc_clear (z);
-}
-
#ifdef TIMING
static void
timemul (void)
@@ -243,7 +211,6 @@ main (void)
timemul ();
#endif
- check_special ();
check_regular ();
data_check (f, "mul.dat");