diff options
author | thevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2013-11-07 12:31:25 +0000 |
---|---|---|
committer | thevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2013-11-07 12:31:25 +0000 |
commit | dc7baa6385e187ef5193663e0653a9db0d7f7879 (patch) | |
tree | 684193531cc7223a0f968be6d653ec60aecd95b4 | |
parent | 32766bf1cfe6ff9b3a14828a02e71cb970d2d2ab (diff) | |
download | mpc-dc7baa6385e187ef5193663e0653a9db0d7f7879.tar.gz |
[tests/] Add templated tests for mpc_fr_div and mpc_fr_sub.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/branches/benchs_tests@1328 211d60ee-9f03-0410-a15a-8952a2c7a4e4
-rw-r--r-- | tests/Makefile.am | 12 | ||||
-rw-r--r-- | tests/fr_div.dsc | 29 | ||||
-rw-r--r-- | tests/fr_sub.dsc | 29 | ||||
-rw-r--r-- | tests/tfr_div_tmpl.c | 42 | ||||
-rw-r--r-- | tests/tfr_sub_tmpl.c | 43 |
5 files changed, 149 insertions, 6 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 27b1b9e..a7a349c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,9 +30,9 @@ LOADLIBES=$(DEFS) -I$(top_srcdir)/src -I$(top_builddir) $(CPPFLAGS) \ TEMPLATED = tabs_tmpl tacos_tmpl tacosh_tmpl tadd_tmpl tadd_fr_tmpl targ_tmpl \ tasin_tmpl tasinh_tmpl tatan_tmpl tatanh_tmpl tconj_tmpl tcos_tmpl \ - tcosh_tmpl tdiv_tmpl tdiv_tmpl tmul_tmpl tmul_fr_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 + tcosh_tmpl tdiv_tmpl tdiv_tmpl tfr_div_tmpl tfr_sub_tmpl tmul_tmpl \ + tmul_fr_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 \ @@ -50,9 +50,9 @@ libmpc_tests_la_SOURCES=mpc-tests.h random.c tgeneric.c read_data.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 \ - conj.dsc cos.dsc cosh.dsc div.dsc div_fr.dsc mul.dsc mul_fr.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 + conj.dsc cos.dsc cosh.dsc div.dsc div_fr.dsc fr_div.dsc fr_sub.dsc mul.dsc \ + mul_fr.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/fr_div.dsc b/tests/fr_div.dsc new file mode 100644 index 0000000..7bc24d7 --- /dev/null +++ b/tests/fr_div.dsc @@ -0,0 +1,29 @@ +# Description file for mpc_fr_div +# +# Copyright (C) 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/ . +# +NAME: + mpc_fr_div +RETURN: + mpc_inex +OUTPUT: + mpc_ptr +INPUT: + mpfr_srcptr + mpc_srcptr + mpc_rnd_t diff --git a/tests/fr_sub.dsc b/tests/fr_sub.dsc new file mode 100644 index 0000000..63f14b4 --- /dev/null +++ b/tests/fr_sub.dsc @@ -0,0 +1,29 @@ +# Description file for mpc_fr_sub +# +# Copyright (C) 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/ . +# +NAME: + mpc_fr_sub +RETURN: + mpc_inex +OUTPUT: + mpc_ptr +INPUT: + mpfr_srcptr + mpc_srcptr + mpc_rnd_t diff --git a/tests/tfr_div_tmpl.c b/tests/tfr_div_tmpl.c new file mode 100644 index 0000000..91bd435 --- /dev/null +++ b/tests/tfr_div_tmpl.c @@ -0,0 +1,42 @@ +/* tfr_div_tmpl -- templated test file for mpc_fr_div. + +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_fr_div (P[1].mpc, P[2].mpfr, P[3].mpc, P[4].mpc_rnd) +#define MPC_FUNCTION_CALL_REUSE_OP2 \ + P[0].mpc_inex = mpc_fr_div (P[1].mpc, P[2].mpfr, P[1].mpc, P[4].mpc_rnd) + +#include "data_check.tpl" + +int +main (void) +{ + DECL_FUNC (CFC, f, mpc_fr_div); + test_start(); + + data_check_template ("fr_div.dsc", "fr_div.dat"); + tgeneric (f, 2, 1024, 7, 65535); + + test_end (); + return 0; +} diff --git a/tests/tfr_sub_tmpl.c b/tests/tfr_sub_tmpl.c new file mode 100644 index 0000000..3eb865f --- /dev/null +++ b/tests/tfr_sub_tmpl.c @@ -0,0 +1,43 @@ +/* tfr_div_tmpl -- template test file for mpc_fr_sub. + +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_fr_sub (P[1].mpc, P[2].mpfr, P[3].mpc, P[4].mpc_rnd) +#define MPC_FUNCTION_CALL_REUSE_OP2 \ + P[0].mpc_inex = mpc_fr_sub (P[1].mpc, P[2].mpfr, P[1].mpc, P[4].mpc_rnd) + +#include "data_check.tpl" + +int +main (void) +{ + DECL_FUNC(CFC, f, mpc_fr_sub); + + test_start(); + + data_check_template ("fr_sub.dsc", "fr_sub.dat"); + tgeneric (f, 2, 4096, 7, 0); + + test_end (); + return 0; +} |