Defines | |
#define | cleanup |
Functions | |
static void | _test (int expression, const char *message, const char *function, const char *file, unsigned line) |
Evaluate an expression and update an internal counter if it fails. | |
void | test_macro (int expression, const char *expr_string, const char *function, const char *file, unsigned line) |
Test a given expression. | |
void | test_eq_macro (int first, const char *first_string, int second, const char *second_string, const char *function, const char *file, unsigned line) |
Test if two integer expressions are equal. | |
void | test_eq_string_macro (const char *first, const char *first_string, const char *second, const char *second_string, const char *function, const char *file, unsigned line) |
Test if two strings are equal. | |
void | test_abs_macro (double first, const char *first_string, double second, const char *second_string, double tolerance, const char *tolerance_string, const char *function, const char *file, unsigned line) |
Test if two numerical expressions are within a given (absolute) tolerance. | |
void | test_rel_macro (double first, const char *first_string, double second, const char *second_string, double tolerance, const char *tolerance_string, const char *function, const char *file, unsigned line) |
Test if two numerical expressions are within a given relative tolerance. | |
void | test_init_macro (const char *file) |
Initialize CPL + messaging. | |
unsigned | test_end_macro (const char *function, const char *file, unsigned line) |
Perform the final checks and return the number of errors. | |
void | test_recipe_output (const cpl_frameset *frames, const char *const product_tags[], int n_prod, const char *main_product, const char *const qc[], int n_qc) |
Test existence of recipe products. | |
Variables | |
static unsigned long | test_nfail = 0 |
static cpl_errorstate | error_init |
#define cleanup |
static void _test | ( | int | expression, | |
const char * | message, | |||
const char * | function, | |||
const char * | file, | |||
unsigned | line | |||
) | [static] |
Evaluate an expression and update an internal counter if it fails.
expression | The expression to evaluate | |
message | The text message associated with the expression | |
function | function name | |
file | filename | |
line | line number |
Definition at line 63 of file test.c.
References test_nfail.
Referenced by test_abs_macro(), test_eq_macro(), test_eq_string_macro(), test_macro(), and test_rel_macro().
void test_macro | ( | int | expression, | |
const char * | expr_string, | |||
const char * | function, | |||
const char * | file, | |||
unsigned | line | |||
) |
Test a given expression.
expression | the expression to evaluate | |
expr_string | the expression to evaluate as a string | |
function | function name | |
file | filename | |
line | line number |
Definition at line 112 of file test.c.
References _test().
Referenced by test_end_macro().
void test_eq_macro | ( | int | first, | |
const char * | first_string, | |||
int | second, | |||
const char * | second_string, | |||
const char * | function, | |||
const char * | file, | |||
unsigned | line | |||
) |
Test if two integer expressions are equal.
first | The first value in the comparison | |
first_string | The first value as a string | |
second | The second value in the comparison | |
second_string | The second value as a string | |
function | function name | |
file | filename | |
line | line number |
Definition at line 139 of file test.c.
References _test().
Referenced by test_end_macro().
void test_eq_string_macro | ( | const char * | first, | |
const char * | first_string, | |||
const char * | second, | |||
const char * | second_string, | |||
const char * | function, | |||
const char * | file, | |||
unsigned | line | |||
) |
Test if two strings are equal.
first | The first value in the comparison | |
first_string | The first value as a string | |
second | The second value in the comparison | |
second_string | The second value as a string | |
function | function name | |
file | filename | |
line | line number |
Definition at line 170 of file test.c.
References _test().
void test_abs_macro | ( | double | first, | |
const char * | first_string, | |||
double | second, | |||
const char * | second_string, | |||
double | tolerance, | |||
const char * | tolerance_string, | |||
const char * | function, | |||
const char * | file, | |||
unsigned | line | |||
) |
Test if two numerical expressions are within a given (absolute) tolerance.
first | The first value in the comparison | |
first_string | The first value as a string | |
second | The second value in the comparison | |
second_string | The second value as a string | |
tolerance | A non-negative tolerance | |
tolerance_string | The tolerance as a string | |
function | function name | |
file | filename | |
line | line number |
Definition at line 208 of file test.c.
References _test().
void test_rel_macro | ( | double | first, | |
const char * | first_string, | |||
double | second, | |||
const char * | second_string, | |||
double | tolerance, | |||
const char * | tolerance_string, | |||
const char * | function, | |||
const char * | file, | |||
unsigned | line | |||
) |
Test if two numerical expressions are within a given relative tolerance.
first | The first value in the comparison | |
first_string | The first value as a string | |
second | The second value in the comparison | |
second_string | The second value as a string | |
tolerance | A non-negative tolerance | |
tolerance_string | The tolerance as a string | |
function | function name | |
file | filename | |
line | line number |
Definition at line 245 of file test.c.
References _test().
void test_init_macro | ( | const char * | file | ) |
Initialize CPL + messaging.
file | filename |
Definition at line 290 of file test.c.
References error_init.
unsigned test_end_macro | ( | const char * | function, | |
const char * | file, | |||
unsigned | line | |||
) |
Perform the final checks and return the number of errors.
function | function name | |
file | filename | |
line | line number |
Definition at line 381 of file test.c.
References error_init, test_eq_macro(), test_macro(), and test_nfail.
void test_recipe_output | ( | const cpl_frameset * | frames, | |
const char *const | product_tags[], | |||
int | n_prod, | |||
const char * | main_product, | |||
const char *const | qc[], | |||
int | n_qc | |||
) |
Test existence of recipe products.
product_tags | array of expected product tags | |
n_prod | number of products | |
main_product | the only product which should contain QC parameters | |
qc | array of expected QC parameters | |
n_qc | number of QC parameters |
Definition at line 428 of file test.c.
References assure, and cleanup.
Referenced by test_bias(), test_img_science(), test_img_screen_flat(), test_img_sky_flat(), and test_zeropoint().
unsigned long test_nfail = 0 [static] |
The number of failures
Definition at line 49 of file test.c.
Referenced by _test(), and test_end_macro().