MCPcopy Create free account
hub / github.com/davisking/dlib / binary_search_tree_kernel_test

Function binary_search_tree_kernel_test

dlib/test/binary_search_tree.h:28–883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 typename bst
27 >
28 void binary_search_tree_kernel_test (
29 )
30 /*!
31 requires
32 - bst is an implementation of
33 binary_search_tree/binary_search_tree_kernel_abstract.h is instantiated
34 to map int to int
35 ensures
36 - runs tests on bst for compliance with the specs
37 !*/
38 {
39
40 bst test, test2;
41
42 srand(static_cast<unsigned int>(time(0)));
43
44
45 DLIB_TEST(test.count(3) == 0);
46
47 enumerable<map_pair<int,int> >& e = test;
48 DLIB_TEST(e.at_start() == true);
49
50 DLIB_TEST(test.count(3) == 0);
51
52 for (int i = 0; i < 4; ++i)
53 {
54 DLIB_TEST(test.size() == 0);
55 DLIB_TEST(test.count(3) == 0);
56 DLIB_TEST(test.height() == 0);
57 DLIB_TEST(test[5] == 0);
58 DLIB_TEST(test[0] == 0);
59 DLIB_TEST(test.at_start());
60 DLIB_TEST(test.current_element_valid() == false);
61 DLIB_TEST(test.count(3) == 0);
62
63 DLIB_TEST(test.move_next() == false);
64 DLIB_TEST(test.move_next() == false);
65 DLIB_TEST(test.move_next() == false);
66 DLIB_TEST(test.move_next() == false);
67 DLIB_TEST(test.move_next() == false);
68 DLIB_TEST(test.count(3) == 0);
69
70 DLIB_TEST(test.at_start() == false);
71 DLIB_TEST(test.current_element_valid() == false);
72
73 test.clear();
74 test.position_enumerator(5);
75 DLIB_TEST(test.current_element_valid() == false);
76 DLIB_TEST(test.at_start() == false);
77 test.position_enumerator(5);
78 DLIB_TEST(test.current_element_valid() == false);
79 DLIB_TEST(test.at_start() == false);
80 test.position_enumerator(9);
81 DLIB_TEST(test.current_element_valid() == false);
82 DLIB_TEST(test.at_start() == false);
83 test.clear();
84 test.position_enumerator(5);
85 DLIB_TEST(test.current_element_valid() == false);

Callers

nothing calls this directly

Calls 15

countMethod · 0.80
removeMethod · 0.80
serializeFunction · 0.70
deserializeFunction · 0.70
swapFunction · 0.70
randClass · 0.50
maxFunction · 0.50
at_startMethod · 0.45
sizeMethod · 0.45
heightMethod · 0.45
current_element_validMethod · 0.45
move_nextMethod · 0.45

Tested by

no test coverage detected