| 22 | typename clp |
| 23 | > |
| 24 | void cmd_line_parser_kernel_test ( |
| 25 | ) |
| 26 | /*! |
| 27 | requires |
| 28 | - clp is an implementation of cmd_line_parser_kernel_abstract.h |
| 29 | ensures |
| 30 | - runs tests on clp for compliance with the specs |
| 31 | !*/ |
| 32 | { |
| 33 | typedef typename clp::char_type ct; |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | int argc; |
| 39 | const ct* argv[100]; |
| 40 | bool ok; |
| 41 | |
| 42 | for (int j = 0; j < 3; ++j) |
| 43 | { |
| 44 | clp test, test2; |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | DLIB_TEST(test.current_element_valid() == false); |
| 50 | DLIB_TEST(test.at_start()); |
| 51 | DLIB_TEST(test.move_next() == false); |
| 52 | DLIB_TEST(test.current_element_valid() == false); |
| 53 | |
| 54 | |
| 55 | |
| 56 | DLIB_TEST(test.parsed_line() == false); |
| 57 | DLIB_TEST(test.option_is_defined(_dT(ct,"a")) == false); |
| 58 | DLIB_TEST(test.option_is_defined(_dT(ct,"a")) == false); |
| 59 | DLIB_TEST(test.option_is_defined(_dT(ct,"a")) == false); |
| 60 | |
| 61 | DLIB_TEST(test.parsed_line() == false); |
| 62 | DLIB_TEST(test.option_is_defined(_dT(ct,"a")) == false); |
| 63 | DLIB_TEST(test.option_is_defined(_dT(ct,"b")) == false); |
| 64 | DLIB_TEST(test.option_is_defined(_dT(ct,"\0")) == false); |
| 65 | |
| 66 | DLIB_TEST(test.current_element_valid() == false); |
| 67 | DLIB_TEST(test.at_start() == false); |
| 68 | DLIB_TEST(test.move_next() == false); |
| 69 | DLIB_TEST(test.current_element_valid() == false); |
| 70 | |
| 71 | |
| 72 | |
| 73 | // program arg1 --davis arg2 -cZzarg asdf |
| 74 | argv[0] = _dT(ct,"program"); |
| 75 | argv[1] = _dT(ct,"arg1"); |
| 76 | argv[2] = _dT(ct,"--davis"); |
| 77 | argv[3] = _dT(ct,"arg2"); |
| 78 | argv[4] = _dT(ct,"-cZzarg"); |
| 79 | argv[5] = _dT(ct,"asdf"); |
| 80 | argc = 6; |
| 81 |
nothing calls this directly
no test coverage detected