Polly 20.0.0git
|
#include <assert.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include "imath.h"
#include "imdrover.h"
#include "imrat.h"
#include "iprime.h"
Go to the source code of this file.
Macros | |
#define | FAIL(E) return (imath_errno = (E), false) |
#define | VCHECK(X, V) |
#define | CHECK(X) VCHECK(X, MP_OK) |
#define | ECHECK(X) VCHECK(X, expect) |
#define | ACHECK(X) |
#define | OUTPUT_LIMIT 2048 |
#define | NUM_REGS 16 |
#define | OTHER_ERROR -1024 |
Functions | |
void | trim_line (char *line) |
Removes leading and trailing whitespace from a zero-terminated line . | |
static mp_result | read_int_value (mp_int z, char *str) |
static mp_result | read_rat_value (mp_rat q, char *str) |
static bool | read_long (long *z, char *str) |
static bool | parse_int_values (testspec_t *t, mp_int *in, mp_int *out, mp_result *rval) |
static bool | parse_rat_values (testspec_t *t, mp_rat *in, mp_rat *out, mp_result *rval) |
static bool | parse_result_code (char *str, mp_result *code) |
static int | parse_binary (char *str, unsigned char *buf, int limit) |
static void | done_testing (void) |
void | init_testing (void) |
void | reset_registers (void) |
bool | test_init (testspec_t *t, FILE *ofp) |
bool | test_set (testspec_t *t, FILE *ofp) |
bool | test_neg (testspec_t *t, FILE *ofp) |
bool | test_abs (testspec_t *t, FILE *ofp) |
bool | test_add (testspec_t *t, FILE *ofp) |
bool | test_sub (testspec_t *t, FILE *ofp) |
bool | test_mul (testspec_t *t, FILE *ofp) |
bool | test_mulp2 (testspec_t *t, FILE *ofp) |
bool | test_mulv (testspec_t *t, FILE *ofp) |
bool | test_sqr (testspec_t *t, FILE *ofp) |
bool | test_div (testspec_t *t, FILE *ofp) |
bool | test_divp2 (testspec_t *t, FILE *ofp) |
bool | test_divv (testspec_t *t, FILE *ofp) |
bool | test_expt (testspec_t *t, FILE *ofp) |
bool | test_exptv (testspec_t *t, FILE *ofp) |
bool | test_exptf (testspec_t *t, FILE *ofp) |
bool | test_mod (testspec_t *t, FILE *ofp) |
bool | test_gcd (testspec_t *t, FILE *ofp) |
bool | test_egcd (testspec_t *t, FILE *ofp) |
bool | test_lcm (testspec_t *t, FILE *ofp) |
bool | test_sqrt (testspec_t *t, FILE *ofp) |
bool | test_root (testspec_t *t, FILE *ofp) |
bool | test_invmod (testspec_t *t, FILE *ofp) |
bool | test_exptmod (testspec_t *t, FILE *ofp) |
bool | test_exptmod_ev (testspec_t *t, FILE *ofp) |
bool | test_exptmod_bv (testspec_t *t, FILE *ofp) |
bool | test_comp (testspec_t *t, FILE *ofp) |
bool | test_ucomp (testspec_t *t, FILE *ofp) |
bool | test_zcomp (testspec_t *t, FILE *ofp) |
bool | test_vcomp (testspec_t *t, FILE *ofp) |
bool | test_uvcomp (testspec_t *t, FILE *ofp) |
bool | test_tostr (testspec_t *t, FILE *ofp) |
bool | test_tobin (testspec_t *t, FILE *ofp) |
bool | test_to_int (testspec_t *t, FILE *ofp) |
bool | test_to_uint (testspec_t *t, FILE *ofp) |
bool | test_read_binary (testspec_t *t, FILE *ofp) |
bool | test_to_uns (testspec_t *t, FILE *ofp) |
bool | test_read_uns (testspec_t *t, FILE *ofp) |
bool | test_meta (testspec_t *t, FILE *ofp) |
bool | test_qneg (testspec_t *t, FILE *ofp) |
bool | test_qrecip (testspec_t *t, FILE *ofp) |
bool | test_qabs (testspec_t *t, FILE *ofp) |
bool | test_qadd (testspec_t *t, FILE *ofp) |
bool | test_qsub (testspec_t *t, FILE *ofp) |
bool | test_qmul (testspec_t *t, FILE *ofp) |
bool | test_qdiv (testspec_t *t, FILE *ofp) |
bool | test_qaddz (testspec_t *t, FILE *ofp) |
bool | test_qsubz (testspec_t *t, FILE *ofp) |
bool | test_qmulz (testspec_t *t, FILE *ofp) |
bool | test_qdivz (testspec_t *t, FILE *ofp) |
bool | test_qexpt (testspec_t *t, FILE *ofp) |
bool | test_qtostr (testspec_t *t, FILE *ofp) |
bool | test_qtodec (testspec_t *t, FILE *ofp) |
bool | test_qrdec (testspec_t *t, FILE *ofp) |
bool | test_is_prime (testspec_t *t, FILE *OFP) |
Variables | |
mp_result | imath_errno |
char * | imath_errmsg |
static char | g_output [OUTPUT_LIMIT] |
static mpz_t | g_zreg [NUM_REGS] |
static mpq_t | g_qreg [NUM_REGS] |
static unsigned char | g_bin1 [OUTPUT_LIMIT] |
static unsigned char | g_bin2 [OUTPUT_LIMIT] |
#define ACHECK | ( | X | ) |
Definition at line 53 of file imdrover.c.
#define FAIL | ( | E | ) | return (imath_errno = (E), false) |
Definition at line 42 of file imdrover.c.
#define NUM_REGS 16 |
Definition at line 62 of file imdrover.c.
#define OTHER_ERROR -1024 |
Definition at line 63 of file imdrover.c.
#define OUTPUT_LIMIT 2048 |
Definition at line 61 of file imdrover.c.
#define VCHECK | ( | X, | |
V | |||
) |
Definition at line 45 of file imdrover.c.
|
static |
Definition at line 398 of file imdrover.c.
References g_qreg, g_zreg, mp_int_clear, mp_rat_clear, and NUM_REGS.
Referenced by init_testing().
void init_testing | ( | void | ) |
Definition at line 411 of file imdrover.c.
References assert, done_testing(), g_output, g_qreg, g_zreg, imath_errmsg, mp_int_init, MP_OK, mp_rat_init, and NUM_REGS.
Referenced by main().
|
static |
Definition at line 380 of file imdrover.c.
References pos(), read_long(), str, and trim_line().
Referenced by test_read_binary(), test_read_uns(), test_to_uns(), and test_tobin().
|
static |
Definition at line 201 of file imdrover.c.
References abs(), g_zreg, mp_int_zero, MP_OK, parse_result_code(), pos(), read_int_value(), str, t, and trim_line().
Referenced by test_abs(), test_add(), test_comp(), test_div(), test_divp2(), test_divv(), test_egcd(), test_expt(), test_exptf(), test_exptmod(), test_exptmod_bv(), test_exptmod_ev(), test_exptv(), test_gcd(), test_init(), test_invmod(), test_is_prime(), test_lcm(), test_meta(), test_mod(), test_mul(), test_mulp2(), test_mulv(), test_neg(), test_read_binary(), test_read_uns(), test_root(), test_set(), test_sqr(), test_sqrt(), test_sub(), test_to_int(), test_to_uint(), test_to_uns(), test_tobin(), test_tostr(), test_ucomp(), test_uvcomp(), test_vcomp(), and test_zcomp().
|
static |
Definition at line 272 of file imdrover.c.
References abs(), g_qreg, MP_OK, mp_rat_zero, parse_result_code(), pos(), read_rat_value(), str, t, and trim_line().
Referenced by test_qabs(), test_qadd(), test_qaddz(), test_qdiv(), test_qdivz(), test_qexpt(), test_qmul(), test_qmulz(), test_qneg(), test_qrdec(), test_qrecip(), test_qsub(), test_qsubz(), test_qtodec(), and test_qtostr().
|
static |
Definition at line 343 of file imdrover.c.
References MP_MEMORY, MP_OK, MP_RANGE, MP_ROUND_DOWN, MP_ROUND_HALF_DOWN, MP_ROUND_HALF_UP, MP_ROUND_UP, MP_TRUE, MP_TRUNC, MP_UNDEF, read_long(), and str.
Referenced by parse_int_values(), parse_rat_values(), and test_qtodec().
Definition at line 103 of file imdrover.c.
References mp_int_read_string, MP_RANGE, and str.
Referenced by parse_int_values().
|
static |
Definition at line 168 of file imdrover.c.
References str.
Referenced by parse_binary(), parse_result_code(), test_qrdec(), test_qtodec(), and test_qtostr().
Definition at line 134 of file imdrover.c.
References MP_RANGE, mp_rat_read_decimal, mp_rat_read_string, and str.
Referenced by parse_rat_values().
void reset_registers | ( | void | ) |
Definition at line 427 of file imdrover.c.
References g_qreg, g_zreg, mp_int_zero, mp_rat_zero, and NUM_REGS.
bool test_abs | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 497 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_abs, mp_int_compare, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_add | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 512 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, mp_int_add, mp_int_add_value, mp_int_compare, mp_int_to_int, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_comp | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 897 of file imdrover.c.
References ACHECK, FAIL, g_output, mp_int_compare, OTHER_ERROR, parse_int_values(), res, and t.
bool test_div | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 615 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_div, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), str, and t.
bool test_divp2 | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 636 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_div_pow2, mp_int_to_int, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), str, and t.
bool test_divv | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 659 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_div_value, mp_int_to_int, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), str, and t.
bool test_egcd | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 757 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, g_zreg, mp_int_add, mp_int_compare, mp_int_egcd, mp_int_mul, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), str, t, t1, and t2.
bool test_expt | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 682 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_expt, mp_int_to_int, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_exptf | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 715 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_expt_full, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_exptmod | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 851 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_exptmod, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_exptmod_bv | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 881 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_exptmod_bvalue, mp_int_to_int, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_exptmod_ev | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 865 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_exptmod_evalue, mp_int_to_int, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_exptv | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 698 of file imdrover.c.
References a(), ACHECK, b(), CHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_expt_value, mp_int_to_int, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_gcd | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 743 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_gcd, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_init | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 434 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_init_uvalue, mp_int_init_value, mp_int_to_int, mp_int_to_string, mp_int_to_uint, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_invmod | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 837 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_invmod, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_is_prime | ( | testspec_t * | t, |
FILE * | OFP | ||
) |
Definition at line 1453 of file imdrover.c.
References ACHECK, ECHECK, mp_int_is_prime(), parse_int_values(), and t.
bool test_lcm | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 793 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_lcm, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_meta | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1121 of file imdrover.c.
References FAIL, g_output, MP_BADARG, mp_int_to_string, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_mod | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 729 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_mod, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_mul | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 555 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_mul, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_mulp2 | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 569 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_mul_pow2, mp_int_to_int, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_mulv | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 585 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_mul_value, mp_int_to_int, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_neg | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 482 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_neg, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_qabs | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1194 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, MP_OK, mp_rat_abs, mp_rat_compare, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), and t.
bool test_qadd | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1208 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, MP_OK, mp_rat_add, mp_rat_compare, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), and t.
bool test_qaddz | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1264 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, MP_BADARG, MP_NUMER_P(), MP_OK, mp_rat_add_int, mp_rat_compare, mp_rat_is_integer, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), and t.
bool test_qdiv | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1250 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, MP_OK, mp_rat_compare, mp_rat_div, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), and t.
bool test_qdivz | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1330 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, MP_BADARG, MP_NUMER_P(), MP_OK, mp_rat_compare, mp_rat_div_int, mp_rat_is_integer, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), and t.
bool test_qexpt | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1352 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, MP_BADARG, mp_int_to_int, MP_NUMER_P(), MP_OK, mp_rat_compare, mp_rat_expt, mp_rat_is_integer, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), power(), and t.
bool test_qmul | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1236 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, MP_OK, mp_rat_compare, mp_rat_mul, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), and t.
bool test_qmulz | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1308 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, MP_BADARG, MP_NUMER_P(), MP_OK, mp_rat_compare, mp_rat_is_integer, mp_rat_mul_int, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), and t.
bool test_qneg | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1166 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, MP_OK, mp_rat_compare, mp_rat_neg, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), and t.
bool test_qrdec | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1436 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, g_qreg, MP_OK, mp_rat_compare, mp_rat_read_decimal, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), read_long(), t, and trim_line().
bool test_qrecip | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1180 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, MP_OK, mp_rat_compare, mp_rat_recip, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), and t.
bool test_qsub | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1222 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, MP_OK, mp_rat_compare, mp_rat_sub, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), and t.
bool test_qsubz | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1286 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, MP_BADARG, MP_NUMER_P(), MP_OK, mp_rat_compare, mp_rat_is_integer, mp_rat_sub_int, mp_rat_to_string, OTHER_ERROR, OUTPUT_LIMIT, parse_rat_values(), and t.
bool test_qtodec | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1400 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, m, MP_OK, MP_RANGE, mp_rat_decimal_len, mp_rat_to_decimal, OTHER_ERROR, parse_rat_values(), parse_result_code(), read_long(), res, t, and trim_line().
bool test_qtostr | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1376 of file imdrover.c.
References ACHECK, CHECK, FAIL, g_output, MP_MAX_RADIX, MP_RANGE, mp_rat_string_len, mp_rat_to_string, OTHER_ERROR, parse_rat_values(), read_long(), t, and trim_line().
bool test_read_binary | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1051 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_bin1, g_output, g_zreg, MP_BADARG, mp_int_compare, mp_int_read_binary, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_binary(), parse_int_values(), t, and trim_line().
bool test_read_uns | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1101 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_bin1, g_output, g_zreg, MP_BADARG, mp_int_compare, mp_int_read_unsigned, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_binary(), parse_int_values(), t, and trim_line().
bool test_root | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 821 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_root, mp_int_to_int, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_set | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 458 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_set_uvalue, mp_int_set_value, mp_int_to_int, mp_int_to_string, mp_int_to_uint, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_sqr | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 601 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_sqr, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_sqrt | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 807 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_sqrt(), mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_sub | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 534 of file imdrover.c.
References ACHECK, CHECK, ECHECK, FAIL, g_output, mp_int_compare, mp_int_sub, mp_int_sub_value, mp_int_to_int, mp_int_to_string, MP_OK, OTHER_ERROR, OUTPUT_LIMIT, parse_int_values(), and t.
bool test_to_int | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1021 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare_value, mp_int_to_int, MP_OK, OTHER_ERROR, parse_int_values(), and t.
bool test_to_uint | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1036 of file imdrover.c.
References ACHECK, ECHECK, FAIL, g_output, mp_int_compare_uvalue, mp_int_to_uint, MP_OK, OTHER_ERROR, parse_int_values(), and t.
bool test_to_uns | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 1071 of file imdrover.c.
References ACHECK, CHECK, FAIL, g_bin1, g_bin2, g_output, MP_BADARG, mp_int_to_unsigned, mp_int_unsigned_len, OTHER_ERROR, parse_binary(), parse_int_values(), pos(), t, and trim_line().
bool test_tobin | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 991 of file imdrover.c.
References ACHECK, CHECK, FAIL, g_bin1, g_bin2, g_output, MP_BADARG, mp_int_binary_len, mp_int_to_binary, OTHER_ERROR, parse_binary(), parse_int_values(), pos(), t, and trim_line().
bool test_tostr | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 971 of file imdrover.c.
References ACHECK, CHECK, FAIL, g_output, mp_int_string_len, mp_int_to_int, mp_int_to_string, MP_MAX_RADIX, MP_OK, MP_RANGE, OTHER_ERROR, parse_int_values(), t, and trim_line().
bool test_ucomp | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 911 of file imdrover.c.
References ACHECK, FAIL, g_output, mp_int_compare_unsigned, OTHER_ERROR, parse_int_values(), res, and t.
bool test_uvcomp | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 955 of file imdrover.c.
References ACHECK, FAIL, g_output, mp_int_compare_uvalue, OTHER_ERROR, parse_int_values(), res, and t.
bool test_vcomp | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 939 of file imdrover.c.
References ACHECK, FAIL, g_output, mp_int_compare_value, OTHER_ERROR, parse_int_values(), res, and t.
bool test_zcomp | ( | testspec_t * | t, |
FILE * | ofp | ||
) |
Definition at line 925 of file imdrover.c.
References ACHECK, FAIL, g_output, mp_int_compare_zero, OTHER_ERROR, parse_int_values(), res, and t.
void trim_line | ( | char * | line | ) |
Removes leading and trailing whitespace from a zero-terminated line
.
Definition at line 260 of file imtest.c.
Referenced by parse_binary(), parse_int_values(), parse_rat_values(), read_line(), test_qrdec(), test_qtodec(), test_qtostr(), test_read_binary(), test_read_uns(), test_to_uns(), test_tobin(), and test_tostr().
|
static |
Definition at line 68 of file imdrover.c.
Referenced by test_read_binary(), test_read_uns(), test_to_uns(), and test_tobin().
|
static |
Definition at line 69 of file imdrover.c.
Referenced by test_to_uns(), and test_tobin().
|
static |
Definition at line 65 of file imdrover.c.
Referenced by init_testing(), test_abs(), test_add(), test_comp(), test_div(), test_divp2(), test_divv(), test_egcd(), test_expt(), test_exptf(), test_exptmod(), test_exptmod_bv(), test_exptmod_ev(), test_exptv(), test_gcd(), test_init(), test_invmod(), test_lcm(), test_meta(), test_mod(), test_mul(), test_mulp2(), test_mulv(), test_neg(), test_qabs(), test_qadd(), test_qaddz(), test_qdiv(), test_qdivz(), test_qexpt(), test_qmul(), test_qmulz(), test_qneg(), test_qrdec(), test_qrecip(), test_qsub(), test_qsubz(), test_qtodec(), test_qtostr(), test_read_binary(), test_read_uns(), test_root(), test_set(), test_sqr(), test_sqrt(), test_sub(), test_to_int(), test_to_uint(), test_to_uns(), test_tobin(), test_tostr(), test_ucomp(), test_uvcomp(), test_vcomp(), and test_zcomp().
Definition at line 67 of file imdrover.c.
Referenced by done_testing(), init_testing(), parse_rat_values(), reset_registers(), and test_qrdec().
Definition at line 66 of file imdrover.c.
Referenced by done_testing(), init_testing(), parse_int_values(), reset_registers(), test_egcd(), test_read_binary(), and test_read_uns().
char* imath_errmsg |
Definition at line 39 of file imdrover.c.
Referenced by init_testing(), and run_test().
mp_result imath_errno |
Definition at line 38 of file imdrover.c.
Referenced by run_test().