57 test_macro(expr, #expr, cpl_func, __FILE__, __LINE__)
80 #define test_eq(first, second) \
81 test_eq_macro(first, #first, second, #second, \
82 cpl_func, __FILE__, __LINE__)
100 #define test_eq_string(first, second) \
101 test_eq_string_macro(first, #first, second, #second, \
102 cpl_func, __FILE__, __LINE__)
124 #define test_abs(first, second, tolerance) \
125 test_abs_macro(first, #first, second, #second, \
126 tolerance, #tolerance, \
127 cpl_func, __FILE__, __LINE__)
155 #define test_rel(first, second, tolerance) \
156 test_rel_macro(first, #first, second, #second, \
157 tolerance, #tolerance, \
158 cpl_func, __FILE__, __LINE__)
166 #define TEST_INIT test_init_macro(__FILE__)
175 return(test_end_macro(cpl_func, __FILE__, __LINE__) ? \
176 EXIT_FAILURE : EXIT_SUCCESS)
187 test_end_macro(
const char *
function,
const char *file,
unsigned line);
190 test_macro(
int expression,
const char *expr_string,
191 const char *
function,
const char *file,
unsigned line);
195 int second,
const char *second_string,
196 const char *
function,
const char *file,
unsigned line);
199 const char *second,
const char *second_string,
200 const char *
function,
201 const char *file,
unsigned line);
204 double second,
const char *second_string,
205 double tolerance,
const char *tolerance_string,
206 const char *
function,
const char *file,
unsigned line);
210 double second,
const char *second_string,
211 double tolerance,
const char *tolerance_string,
212 const char *
function,
const char *file,
unsigned line);
216 const char *
const product_tags[],
int n_prod,
217 const char *main_product,
218 const char *
const qc[],
int n_qc);
void test_macro(int expression, const char *expr_string, const char *function, const char *file, unsigned line)
Test a given expression.
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_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_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.
unsigned test_end_macro(const char *function, const char *file, unsigned line)
Perform the final checks and return the number of errors.
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_init_macro(const char *file)
Initialize CPL + messaging.
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.