summaryrefslogtreecommitdiff
path: root/tests/tsqr.c
diff options
context:
space:
mode:
authorthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2008-09-19 13:28:37 +0000
committerthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2008-09-19 13:28:37 +0000
commit30b78cf056358b55930b4f579a4eb625cc2b535d (patch)
tree1825135733dfb52ac2c99acf8cd5f5c37fde1f5e /tests/tsqr.c
parent017bceb58af7101f066c3b3a149a44f8e68b1a5b (diff)
downloadmpc-30b78cf056358b55930b4f579a4eb625cc2b535d.tar.gz
tests/tgeneric_cc.c: random tests for complex functions of one complex variable and tests for parameter reuse.
tests/Makefile.am: add tgeneric.cc plus some tests files tconj, tneg tests/tlog.c tests/ttan.c tests/tcos.c tests/tsin.c tests/tsqrt.c tests/tconj.c tests/ttanh.c tests/tcosh.c tests/texp.c tests/tsinh.c tests/tsqr.c tests/tneg.c: use tgeneric_cc.c git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@182 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests/tsqr.c')
-rw-r--r--tests/tsqr.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/tests/tsqr.c b/tests/tsqr.c
index 4bcf82c..5cc17a2 100644
--- a/tests/tsqr.c
+++ b/tests/tsqr.c
@@ -26,6 +26,10 @@ MA 02111-1307, USA. */
#include "mpc.h"
#include "mpc-impl.h"
+#include "random.c"
+#define TEST_FUNCTION mpc_sqr
+#include "tgeneric_cc.c"
+
void cmpsqr (mpc_srcptr, mpc_rnd_t);
void testsqr (long, long, mp_prec_t, mpc_rnd_t);
void special (void);
@@ -181,10 +185,7 @@ special (void)
int
main (void)
{
- mpc_t x;
- mpc_rnd_t rnd_re, rnd_im;
- mp_prec_t prec;
- int i;
+ test_start ();
special ();
@@ -198,23 +199,9 @@ main (void)
testsqr (0, 1816, 8, 24);
testsqr (145, 0, 8, 24);
- mpc_init (x);
-
- for (prec = 2; prec < 1000; prec++)
- {
- mpc_set_prec (x, prec);
+ tgeneric (2, 1024, 1, 0);
- for (i = 0; i < (int) (1000/prec); i++)
- {
- mpc_random (x);
-
- for (rnd_re = 0; rnd_re < 4; rnd_re ++)
- for (rnd_im = 0; rnd_im < 4; rnd_im ++)
- cmpsqr (x, RNDC(rnd_re, rnd_im));
- }
- }
-
- mpc_clear (x);
+ test_end ();
return 0;
}