Definition in file testlib_test.h.
#include <vcl_string.h>
#include <vcl_complex.h>
Go to the source code of this file.
Defines | |
| #define | Assert testlib_test_assert |
| #define | AssertNear testlib_test_assert_near |
| #define | AssertFar testlib_test_assert_far |
| #define | TESTMAIN_ARGS(x) int x ## _main(int argc, char*argv[]) { START(#x); x(argc,argv); SUMMARY(); } |
| #define | TESTLIB_DEFINE_MAIN(x) int main() { START(#x); x(); return testlib_test_summary(); } |
| #define | TESTLIB_DEFINE_MAIN_ARGS(x) int main(int argc, char * argv[]) { START(#x); x(argc,argv); SUMMARY(); } |
Functions | |
| void | testlib_test_start (const char *name=0) |
| initialise test counters, check test name 'name' exists. | |
| void | testlib_test_begin (const char *msg) |
| increment number of tests, then output msg. | |
| void | testlib_test_perform (bool success) |
| increment success/failure counters. | |
| int | testlib_test_summary () |
| output summary of tests performed. | |
| void | testlib_test_assert (const vcl_string &msg, bool expr) |
| output msg, then perform test in expr. | |
| void | testlib_test_assert_near (const vcl_string &msg, double expr, double target=0, double tol=1e-12) |
| output msg, then perform test to see if expr is within tol of target. | |
| void | testlib_test_assert_near (const vcl_string &msg, vcl_complex< double > expr, vcl_complex< double > target, double tol=1e-12) |
| output msg, then perform test to see if expr is within tol of target. | |
| void | testlib_test_assert_near_relative (const vcl_string &msg, double expr, double target=0, double tol=1e-12) |
| output msg, then test to see if expr is within relative tol of target. | |
| void | testlib_test_assert_near_relative (const vcl_string &msg, vcl_complex< double > expr, vcl_complex< double > target, double tol=1e-12) |
| output msg, then test to see if expr is within relative tol of target. | |
| void | testlib_test_assert_far (const vcl_string &msg, double expr, double target=0, double tol=1e-12) |
| output msg, then perform test to see if expr is not within tol of target. | |
| void | testlib_test_assert_far (const vcl_string &msg, vcl_complex< double > expr, vcl_complex< double > target, double tol=1e-12) |
| output msg, then perform test to see if expr is not within tol of target. | |
| void | testlib_test_assert_equal (const vcl_string &msg, long expr, long target) |
| output msg, then perform test to see if expr is equal to target. | |
| testlib_test_begin (s) | |
| testlib_test_perform ((p)==(v)) | |
| while (false) testlib_test_begin(s) | |
| TEST function, s is message, test to see if p==v for integral values. | |
| testlib_test_assert_equal ("", p, v) | |
| testlib_test_assert_near ("", p, v, t) | |
| testlib_test_assert_near_relative ("", p, v, t) | |
| testlib_test_assert_far ("", p, v, t) | |
Variables | |
| x | |
| #define Assert testlib_test_assert |
Definition at line 52 of file testlib_test.h.
| #define AssertFar testlib_test_assert_far |
Definition at line 54 of file testlib_test.h.
| #define AssertNear testlib_test_assert_near |
Definition at line 53 of file testlib_test.h.
| #define TESTLIB_DEFINE_MAIN_ARGS | ( | x | ) | int main(int argc, char * argv[]) { START(#x); x(argc,argv); SUMMARY(); } |
| #define TESTMAIN_ARGS | ( | x | ) | int x ## _main(int argc, char*argv[]) { START(#x); x(argc,argv); SUMMARY(); } |
| void testlib_test_assert | ( | const vcl_string & | msg, | |
| bool | expr | |||
| ) |
| testlib_test_assert_equal | ( | "" | , | |
| p | , | |||
| v | ||||
| ) |
| void testlib_test_assert_equal | ( | const vcl_string & | msg, | |
| long | expr, | |||
| long | target | |||
| ) |
output msg, then perform test to see if expr is equal to target.
Definition at line 159 of file testlib_test.cxx.
| testlib_test_assert_far | ( | "" | , | |
| p | , | |||
| v | , | |||
| t | ||||
| ) |
| void testlib_test_assert_far | ( | const vcl_string & | msg, | |
| vcl_complex< double > | expr, | |||
| vcl_complex< double > | target, | |||
| double | tol = 1e-12 | |||
| ) |
output msg, then perform test to see if expr is not within tol of target.
Definition at line 150 of file testlib_test.cxx.
| void testlib_test_assert_far | ( | const vcl_string & | msg, | |
| double | expr, | |||
| double | target = 0, |
|||
| double | tol = 1e-12 | |||
| ) |
output msg, then perform test to see if expr is not within tol of target.
Definition at line 141 of file testlib_test.cxx.
| testlib_test_assert_near | ( | "" | , | |
| p | , | |||
| v | , | |||
| t | ||||
| ) |
| void testlib_test_assert_near | ( | const vcl_string & | msg, | |
| vcl_complex< double > | expr, | |||
| vcl_complex< double > | target, | |||
| double | tol = 1e-12 | |||
| ) |
output msg, then perform test to see if expr is within tol of target.
Definition at line 110 of file testlib_test.cxx.
| void testlib_test_assert_near | ( | const vcl_string & | msg, | |
| double | expr, | |||
| double | target = 0, |
|||
| double | tol = 1e-12 | |||
| ) |
output msg, then perform test to see if expr is within tol of target.
Definition at line 101 of file testlib_test.cxx.
| testlib_test_assert_near_relative | ( | "" | , | |
| p | , | |||
| v | , | |||
| t | ||||
| ) |
| void testlib_test_assert_near_relative | ( | const vcl_string & | msg, | |
| vcl_complex< double > | expr, | |||
| vcl_complex< double > | target, | |||
| double | tol = 1e-12 | |||
| ) |
output msg, then test to see if expr is within relative tol of target.
Definition at line 130 of file testlib_test.cxx.
| void testlib_test_assert_near_relative | ( | const vcl_string & | msg, | |
| double | expr, | |||
| double | target = 0, |
|||
| double | tol = 1e-12 | |||
| ) |
output msg, then test to see if expr is within relative tol of target.
Definition at line 119 of file testlib_test.cxx.
| testlib_test_begin | ( | s | ) |
| void testlib_test_begin | ( | const char * | msg | ) |
| testlib_test_perform | ( | (p) | = =(v) |
) |
| void testlib_test_perform | ( | bool | success | ) |
| void testlib_test_start | ( | const char * | name = 0 |
) |
initialise test counters, check test name 'name' exists.
Definition at line 28 of file testlib_test.cxx.
| int testlib_test_summary | ( | ) |
| while | ( | false | ) |
TEST function, s is message, test to see if p==v for integral values.
Definition at line 98 of file testlib_test.h.
1.5.1