diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/read_description.c | 16 | ||||
-rw-r--r-- | tests/tgeneric.tpl | 16 | ||||
-rw-r--r-- | tests/tsin_cos.c | 4 |
3 files changed, 21 insertions, 15 deletions
diff --git a/tests/read_description.c b/tests/read_description.c index 899a600..8a02265 100644 --- a/tests/read_description.c +++ b/tests/read_description.c @@ -1,6 +1,6 @@ /* read_description.c -- read parameters from description file -Copyright (C) 2012, 2013 INRIA +Copyright (C) 2012, 2013, 2014 INRIA This file is part of GNU MPC. @@ -26,8 +26,8 @@ static size_t read_keyworddesc (mpc_datafile_context_t* datafile_context, /* tuple to link name with the enum value */ typedef struct { - const char *typename; /* type name */ - mpc_param_t typeval ; /* type enum */ + const char * name; /* type name */ + mpc_param_t val; /* type enum */ } param_typeval_t; /* available types for function description */ @@ -115,15 +115,15 @@ static mpc_param_t description_findtype (const char *name) { - mpc_param_t r = sparam_typeval[0].typeval; + mpc_param_t r = sparam_typeval[0].val; size_t s = 0; const size_t send = sizeof (sparam_typeval) / sizeof (param_typeval_t); - while (s < send && strcmp (sparam_typeval[s].typename, name) != 0) + while (s < send && strcmp (sparam_typeval[s].name, name) != 0) s++; if (s < send) - r = sparam_typeval[s].typeval; + r = sparam_typeval[s].val; else { printf ("Error: Unable to find the type '%s'\n",name); @@ -141,11 +141,11 @@ read_description_findname (mpc_param_t e) size_t s = 0; const size_t send = sizeof (sparam_typeval) / sizeof (param_typeval_t); - while (s < send && sparam_typeval[s].typeval != e) + while (s < send && sparam_typeval[s].val != e) s++; if (s<send) - name = sparam_typeval[s].typename; + name = sparam_typeval[s].name; else { printf ("Error: Unable to find the enum type\n"); diff --git a/tests/tgeneric.tpl b/tests/tgeneric.tpl index 5d65afb..22b2548 100644 --- a/tests/tgeneric.tpl +++ b/tests/tgeneric.tpl @@ -75,7 +75,6 @@ tgeneric_template (const char *description_file, for (prec = prec_min; prec <= prec_max; prec += step) check_against_quadruple_precision (¶ms, prec, exp_min, exp_max, -1); - /* check consistency with quadruple precision for special values: pure real, pure imaginary, or infinite arguments */ last_special = count_special_cases (¶ms); @@ -162,11 +161,13 @@ enum { SPECIAL_MZERO, SPECIAL_PZERO, SPECIAL_PINF, - SPECIAL_COUNT, -} special_case; + SPECIAL_COUNT +}; static int count_special_cases (mpc_fun_param_t *params) +/* counts the number of possibilities of exactly one real or imaginary part of + any input parameter being special, all others being finite real numbers */ { int i; const int start = params->nbout; @@ -202,6 +203,9 @@ special_mpfr (mpfr_ptr x, int special) case SPECIAL_PINF: mpfr_set_inf (x, +1); break; + case SPECIAL_COUNT: + /* does not occur */ + break; } } @@ -264,13 +268,15 @@ random_params (mpc_fun_param_t *params, break; case NATIVE_LD: - case NATIVE_DC: case NATIVE_LDC: + case NATIVE_DC: + case NATIVE_LDC: /* TODO: draw random value */ fprintf (stderr, "random_params: type not implemented.\n"); exit (1); break; - case NATIVE_IM: case NATIVE_UIM: + case NATIVE_IM: + case NATIVE_UIM: /* TODO: draw random value */ fprintf (stderr, "random_params: type not implemented.\n"); exit (1); diff --git a/tests/tsin_cos.c b/tests/tsin_cos.c index 73791e6..ae1b1c8 100644 --- a/tests/tsin_cos.c +++ b/tests/tsin_cos.c @@ -207,8 +207,8 @@ enum { SPECIAL_MZERO, SPECIAL_PZERO, SPECIAL_PINF, - SPECIAL_COUNT, -} special_case; + SPECIAL_COUNT +}; static void special_mpfr (mpfr_ptr x, int special) |