| 24 | typename array2d |
| 25 | > |
| 26 | void array2d_kernel_test ( |
| 27 | ) |
| 28 | /*! |
| 29 | requires |
| 30 | - array2d is an implementation of array2d/array2d_kernel_abstract.h |
| 31 | is instantiated with unsigned long |
| 32 | ensures |
| 33 | - runs tests on array2d for compliance with the specs |
| 34 | !*/ |
| 35 | { |
| 36 | srand(static_cast<unsigned int>(time(0))); |
| 37 | |
| 38 | array2d test,test2; |
| 39 | |
| 40 | long nc, nr; |
| 41 | |
| 42 | |
| 43 | DLIB_TEST(get_rect(test).is_empty()); |
| 44 | |
| 45 | enumerable<unsigned long>& e = test; |
| 46 | DLIB_TEST(e.at_start() == true); |
| 47 | |
| 48 | |
| 49 | DLIB_TEST(e.size() == 0); |
| 50 | DLIB_TEST(e.at_start() == true); |
| 51 | DLIB_TEST(e.current_element_valid() == false); |
| 52 | |
| 53 | DLIB_TEST (e.move_next() == false); |
| 54 | DLIB_TEST (e.move_next() == false); |
| 55 | DLIB_TEST (e.move_next() == false); |
| 56 | DLIB_TEST (e.move_next() == false); |
| 57 | DLIB_TEST (e.move_next() == false); |
| 58 | DLIB_TEST (e.move_next() == false); |
| 59 | |
| 60 | |
| 61 | DLIB_TEST(e.size() == 0); |
| 62 | DLIB_TEST(e.at_start() == false); |
| 63 | DLIB_TEST(e.current_element_valid() == false); |
| 64 | |
| 65 | |
| 66 | e.reset(); |
| 67 | |
| 68 | DLIB_TEST(e.size() == 0); |
| 69 | DLIB_TEST(e.at_start() == true); |
| 70 | DLIB_TEST(e.current_element_valid() == false); |
| 71 | |
| 72 | |
| 73 | DLIB_TEST(get_rect(test).is_empty()); |
| 74 | |
| 75 | |
| 76 | |
| 77 | DLIB_TEST(test.at_start() == true); |
| 78 | |
| 79 | |
| 80 | DLIB_TEST(test.size() == 0); |
| 81 | DLIB_TEST(test.at_start() == true); |
| 82 | DLIB_TEST(test.current_element_valid() == false); |
| 83 |
nothing calls this directly
no test coverage detected