summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2013-11-07 11:42:28 +0000
committerthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2013-11-07 11:42:28 +0000
commiteb8ca416871f88fa486ad8f15ff2a8005d1bc847 (patch)
tree4a7fa0d52b964866aa662ed493596cf74be9b8ed
parentb5201d2d83b243854a96f1dcaff8eb9503be9e0a (diff)
downloadmpc-eb8ca416871f88fa486ad8f15ff2a8005d1bc847.tar.gz
[tests/] Add templated test for mpc_conj.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/branches/benchs_tests@1326 211d60ee-9f03-0410-a15a-8952a2c7a4e4
-rw-r--r--tests/Makefile.am12
-rw-r--r--tests/conj.dsc29
-rw-r--r--tests/tconj_tmpl.c44
3 files changed, 79 insertions, 6 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 53ab170..395658d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -29,9 +29,9 @@ LOADLIBES=$(DEFS) -I$(top_srcdir)/src -I$(top_builddir) $(CPPFLAGS) \
$(CFLAGS) -L$(top_builddir)/tests/.libs -lmpc-tests -lmpc -lm $(LIBS)
TEMPLATED = tabs_tmpl tacos_tmpl tacosh_tmpl tadd_tmpl tadd_fr_tmpl targ_tmpl \
- tasin_tmpl tasinh_tmpl tatan_tmpl tatanh_tmpl tcos_tmpl tcosh_tmpl \
- tmul_tmpl tpow_tmpl tpow_fr_tmpl tpow_si_tmpl tpow_ui_tmpl tpow_z_tmpl \
- tsin_tmpl tsinh_tmpl tsub_tmpl ttan_tmpl ttanh_tmpl
+ tasin_tmpl tasinh_tmpl tatan_tmpl tatanh_tmpl tconj_tmpl tcos_tmpl \
+ tcosh_tmpl tmul_tmpl tpow_tmpl tpow_fr_tmpl tpow_si_tmpl tpow_ui_tmpl \
+ tpow_z_tmpl tsin_tmpl tsinh_tmpl tsub_tmpl ttan_tmpl ttanh_tmpl
check_PROGRAMS = tabs tacos tacosh tadd tadd_fr tadd_si tadd_ui targ tasin \
tasinh tatan tatanh tconj tcos tcosh tdiv tdiv_2si tdiv_2ui tdiv_fr tdiv_ui \
texp tfma tfr_div tfr_sub timag tio_str tlog tlog10 tmul tmul_2si tmul_2ui \
@@ -48,9 +48,9 @@ libmpc_tests_la_SOURCES=mpc-tests.h random.c tgeneric.c read_data.c \
tpl_mpc.c tpl_mpfr.c tpl_native.c
TEMPLATES = data_check.tpl abs.dsc acos.dsc acosh.dsc asin.dsc asinh.dsc \
- atan.dsc atanh.dsc add.dsc add_fr.dsc add_si.dsc add_ui.dsc arg.dsc cos.dsc \
- cosh.dsc mul.dsc pow.dsc pow_fr.dsc pow_si.dsc pow_ui.dsc pow_z.dsc sin.dsc \
- sinh.dsc sub.dsc tan.dsc tanh.dsc
+ atan.dsc atanh.dsc add.dsc add_fr.dsc add_si.dsc add_ui.dsc arg.dsc \
+ conj.dsc cos.dsc cosh.dsc mul.dsc pow.dsc pow_fr.dsc pow_si.dsc pow_ui.dsc \
+ pow_z.dsc sin.dsc sinh.dsc sub.dsc tan.dsc tanh.dsc
DATA_SETS = abs.dat acos.dat acosh.dat asin.dat asinh.dat atan.dat \
atanh.dat add.dat add_fr.dat arg.dat conj.dat cos.dat cosh.dat \
div.dat div_fr.dat exp.dat fma.dat fr_div.dat fr_sub.dat \
diff --git a/tests/conj.dsc b/tests/conj.dsc
new file mode 100644
index 0000000..db02041
--- /dev/null
+++ b/tests/conj.dsc
@@ -0,0 +1,29 @@
+# Description file for mpc_conj
+#
+# Copyright (C) 2008, 2010, 2011, 2012, 2013 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+# more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/ .
+#
+# Description file of the function
+NAME:
+ mpc_conj
+RETURN:
+ mpc_inex
+OUTPUT:
+ mpc_ptr
+INPUT:
+ mpc_srcptr
+ mpc_rnd_t
diff --git a/tests/tconj_tmpl.c b/tests/tconj_tmpl.c
new file mode 100644
index 0000000..c2e418b
--- /dev/null
+++ b/tests/tconj_tmpl.c
@@ -0,0 +1,44 @@
+/* tconj_tmpl -- templated test file for mpc_conj.
+
+Copyright (C) 2008, 2013 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+GNU MPC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "templates.h"
+#include "mpc-tests.h"
+
+#define MPC_FUNCTION_CALL \
+ P[0].mpc_inex = mpc_conj (P[1].mpc, P[2].mpc, P[3].mpc_rnd)
+#define MPC_FUNCTION_CALL_REUSE_OP1 \
+ P[0].mpc_inex = mpc_conj (P[1].mpc, P[1].mpc, P[3].mpc_rnd)
+
+#include "data_check.tpl"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_conj);
+
+ test_start ();
+
+ data_check_template ("conj.dsc", "conj.dat");
+ tgeneric (f, 2, 1024, 1, 0);
+
+ test_end ();
+
+ return 0;
+}