summaryrefslogtreecommitdiff
path: root/tests/mpc-tests.h
diff options
context:
space:
mode:
authorthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2009-02-18 14:38:08 +0000
committerthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2009-02-18 14:38:08 +0000
commitea472cfe91dcb532342adce4ef74074f9c8eccaa (patch)
treef3538b459f789fd78e114dc55d8df43d957dfcb3 /tests/mpc-tests.h
parent9c305dd081f8e646d5ad37037992e8b5e1569eef (diff)
downloadmpc-ea472cfe91dcb532342adce4ef74074f9c8eccaa.tar.gz
doc/mpc.texi: Add documentation for new functions mpc_set_str and mpc_strtoc.
doc/version.texi: Update to february 2009. NEWS src/mpc.h src/Makefile.am: Add new functions mpc_set_str and mpc_strtoc. configure.ac: Check if locale.h exists. src/strtoc.c: new function. src/set_str.c: new function. tests/mpc-tests.h: make public some helper functions from read_data.c. tests/read_data.c: make public some helper functions. tests/Makefile.am: Add tstrtoc.c and tstrtoc.dat. tests/tstrtoc.c: test file for mpc_strtoc. tests/strtoc.dat: data file for mpc_strtoc. git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@414 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests/mpc-tests.h')
-rw-r--r--tests/mpc-tests.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/mpc-tests.h b/tests/mpc-tests.h
index 17144ef..d9a9712 100644
--- a/tests/mpc-tests.h
+++ b/tests/mpc-tests.h
@@ -1,6 +1,6 @@
/* Tests helper functions.
-Copyright (C) 2008 Philippe Th\'eveny, Andreas Enge
+Copyright (C) 2008, 2009 Philippe Th\'eveny, Andreas Enge
This file is part of the MPC Library.
@@ -29,6 +29,18 @@ MA 02111-1307, USA. */
mpfr_out_str (stdout, 2, 0, (X), GMP_RNDN);\
printf ("\n");
+
+#define MPC_INEX_STR(inex) \
+ (inex) == 0 ? "(0, 0)" \
+ : (inex) == 1 ? "(+1, 0)" \
+ : (inex) == 2 ? "(-1, 0)" \
+ : (inex) == 4 ? "(0, +1)" \
+ : (inex) == 5 ? "(+1, +1)" \
+ : (inex) == 6 ? "(-1, +1)" \
+ : (inex) == 8 ? "(0, -1)" \
+ : (inex) == 9 ? "(+1, -1)" \
+ : (inex) == 10 ? "(-1, -1)" : "unknown"
+
#define QUOTE(X) NAME(X)
#define NAME(X) #X
@@ -147,3 +159,12 @@ void tgeneric (mpc_function, mpfr_prec_t, mpfr_prec_t, mpfr_prec_t, mp_exp_t);
/* data_check (function, "data_file_name") checks function results against
precomputed data in a file.*/
void data_check (mpc_function, const char *);
+
+/* helper file reading functions */
+void skip_whitespace_comments (FILE *fp);
+void read_ternary (FILE *fp, int* ternary);
+void read_mpfr_rounding_mode (FILE *fp, mpfr_rnd_t* rnd);
+void read_mpc_rounding_mode (FILE *fp, mpc_rnd_t* rnd);
+mpfr_prec_t read_mpfr_prec (FILE *fp);
+void read_mpfr (FILE *fp, mpfr_ptr x, int *known_sign);
+void read_mpc (FILE *fp, mpc_ptr z, known_signs_t *ks);