diff options
author | thevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2009-03-20 15:07:03 +0000 |
---|---|---|
committer | thevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2009-03-20 15:07:03 +0000 |
commit | 787eb286cd5e116b091c940f0e6d81fd5a12518f (patch) | |
tree | d902969b4e6a92bd52804b0c4f12fcd77072581f /tests/mpc-tests.h | |
parent | f8ab5b5dc3961522317426ace0d50bd8603aed33 (diff) | |
download | mpc-787eb286cd5e116b091c940f0e6d81fd5a12518f.tar.gz |
tests/mpc-tests.h tests/read_data.c: factorize code reading data file, and use
environment variable srcdir defined by 'make check'.
tests/tstrtoc.c: Simplify using new functions in read_data.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@491 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests/mpc-tests.h')
-rw-r--r-- | tests/mpc-tests.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/mpc-tests.h b/tests/mpc-tests.h index 6589657..dc3be5d 100644 --- a/tests/mpc-tests.h +++ b/tests/mpc-tests.h @@ -20,13 +20,11 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdio.h> -#include "mpc-impl.h" +#include <ctype.h> -#define TERNARY_NOT_CHECKED 255 - /* special value to indicate that the ternary value is not checked */ -#define TERNARY_ERROR 254 - /* special value to indicate that an error occurred in an mpc function */ +#include "mpc-impl.h" +/** OUTPUT HELPER MACROS */ #define MPFR_OUT(X) \ printf (#X" [%ld]=", MPFR_PREC (X));\ mpfr_out_str (stdout, 2, 0, (X), GMP_RNDN);\ @@ -163,11 +161,21 @@ void tgeneric (mpc_function, mpfr_prec_t, mpfr_prec_t, mpfr_prec_t, mp_exp_t); precomputed data in a file.*/ void data_check (mpc_function, const char *); +FILE * open_data_file (const char *file_name); +void close_data_file (FILE *fp); + /* 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_int (FILE *fp, int *n, const char *name); +size_t read_string (FILE *fp, char **buffer_ptr, size_t buffer_length, const char *name); void read_mpfr (FILE *fp, mpfr_ptr x, int *known_sign); void read_mpc (FILE *fp, mpc_ptr z, known_signs_t *ks); + +#define TERNARY_NOT_CHECKED 255 + /* special value to indicate that the ternary value is not checked */ +#define TERNARY_ERROR 254 + /* special value to indicate that an error occurred in an mpc function */ |