Polly 19.0.0git
Classes | Typedefs | Functions
imdrover.h File Reference
#include <stdbool.h>
#include <stdio.h>

Go to the source code of this file.

Classes

struct  testspec_t
 

Typedefs

typedef bool(* test_f) (testspec_t *, FILE *)
 

Functions

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)
 

Typedef Documentation

◆ test_f

typedef bool(* test_f) (testspec_t *, FILE *)

Definition at line 43 of file imdrover.h.

Function Documentation

◆ 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().

◆ reset_registers()

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.

◆ test_abs()

bool test_abs ( testspec_t t,
FILE *  ofp 
)

◆ test_add()

bool test_add ( testspec_t t,
FILE *  ofp 
)

◆ test_comp()

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.

◆ test_div()

bool test_div ( testspec_t t,
FILE *  ofp 
)

◆ test_divp2()

bool test_divp2 ( testspec_t t,
FILE *  ofp 
)

◆ test_divv()

bool test_divv ( testspec_t t,
FILE *  ofp 
)

◆ test_egcd()

bool test_egcd ( testspec_t t,
FILE *  ofp 
)

◆ test_expt()

bool test_expt ( testspec_t t,
FILE *  ofp 
)

◆ test_exptf()

bool test_exptf ( testspec_t t,
FILE *  ofp 
)

◆ test_exptmod()

bool test_exptmod ( testspec_t t,
FILE *  ofp 
)

◆ test_exptmod_bv()

bool test_exptmod_bv ( testspec_t t,
FILE *  ofp 
)

◆ test_exptmod_ev()

bool test_exptmod_ev ( testspec_t t,
FILE *  ofp 
)

◆ test_exptv()

bool test_exptv ( testspec_t t,
FILE *  ofp 
)

◆ test_gcd()

bool test_gcd ( testspec_t t,
FILE *  ofp 
)

◆ test_init()

bool test_init ( testspec_t t,
FILE *  ofp 
)

◆ test_invmod()

bool test_invmod ( testspec_t t,
FILE *  ofp 
)

◆ test_is_prime()

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.

◆ test_lcm()

bool test_lcm ( testspec_t t,
FILE *  ofp 
)

◆ test_meta()

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.

◆ test_mod()

bool test_mod ( testspec_t t,
FILE *  ofp 
)

◆ test_mul()

bool test_mul ( testspec_t t,
FILE *  ofp 
)

◆ test_mulp2()

bool test_mulp2 ( testspec_t t,
FILE *  ofp 
)

◆ test_mulv()

bool test_mulv ( testspec_t t,
FILE *  ofp 
)

◆ test_neg()

bool test_neg ( testspec_t t,
FILE *  ofp 
)

◆ test_qabs()

bool test_qabs ( testspec_t t,
FILE *  ofp 
)

◆ test_qadd()

bool test_qadd ( testspec_t t,
FILE *  ofp 
)

◆ test_qaddz()

bool test_qaddz ( testspec_t t,
FILE *  ofp 
)

◆ test_qdiv()

bool test_qdiv ( testspec_t t,
FILE *  ofp 
)

◆ test_qdivz()

bool test_qdivz ( testspec_t t,
FILE *  ofp 
)

◆ test_qexpt()

bool test_qexpt ( testspec_t t,
FILE *  ofp 
)

◆ test_qmul()

bool test_qmul ( testspec_t t,
FILE *  ofp 
)

◆ test_qmulz()

bool test_qmulz ( testspec_t t,
FILE *  ofp 
)

◆ test_qneg()

bool test_qneg ( testspec_t t,
FILE *  ofp 
)

◆ test_qrdec()

bool test_qrdec ( testspec_t t,
FILE *  ofp 
)

◆ test_qrecip()

bool test_qrecip ( testspec_t t,
FILE *  ofp 
)

◆ test_qsub()

bool test_qsub ( testspec_t t,
FILE *  ofp 
)

◆ test_qsubz()

bool test_qsubz ( testspec_t t,
FILE *  ofp 
)

◆ test_qtodec()

bool test_qtodec ( testspec_t t,
FILE *  ofp 
)

◆ test_qtostr()

bool test_qtostr ( testspec_t t,
FILE *  ofp 
)

◆ test_read_binary()

bool test_read_binary ( testspec_t t,
FILE *  ofp 
)

◆ test_read_uns()

bool test_read_uns ( testspec_t t,
FILE *  ofp 
)

◆ test_root()

bool test_root ( testspec_t t,
FILE *  ofp 
)

◆ test_set()

bool test_set ( testspec_t t,
FILE *  ofp 
)

◆ test_sqr()

bool test_sqr ( testspec_t t,
FILE *  ofp 
)

◆ test_sqrt()

bool test_sqrt ( testspec_t t,
FILE *  ofp 
)

◆ test_sub()

bool test_sub ( testspec_t t,
FILE *  ofp 
)

◆ test_to_int()

bool test_to_int ( testspec_t t,
FILE *  ofp 
)

◆ test_to_uint()

bool test_to_uint ( testspec_t t,
FILE *  ofp 
)

◆ test_to_uns()

bool test_to_uns ( testspec_t t,
FILE *  ofp 
)

◆ test_tobin()

bool test_tobin ( testspec_t t,
FILE *  ofp 
)

◆ test_tostr()

bool test_tostr ( testspec_t t,
FILE *  ofp 
)

◆ test_ucomp()

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.

◆ test_uvcomp()

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.

◆ test_vcomp()

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.

◆ test_zcomp()

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.