MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

libs/geometry/geometry_tests/tree_test.cpp:31–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31UNIT_TEST(Tree4D_Smoke)
32{
33 Tree theTree;
34
35 R arr[] = {R(0, 0, 1, 1), R(1, 1, 2, 2), R(2, 2, 3, 3)};
36
37 for (size_t i = 0; i < ARRAY_SIZE(arr); ++i)
38 theTree.ReplaceAllInRect(arr[i], &RTrue<R>);
39
40 vector<R> test;
41 theTree.ForEach(base::MakeBackInsertFunctor(test));
42 TEST_EQUAL(3, test.size(), ());
43
44 test.clear();
45 R const searchR(1.5, 1.5, 1.5, 1.5);
46 theTree.ForEachInRect(searchR, base::MakeBackInsertFunctor(test));
47 TEST_EQUAL(1, test.size(), ());
48 TEST_EQUAL(test[0], arr[1], ());
49
50 R const replaceR(0.5, 0.5, 2.5, 2.5);
51 theTree.ReplaceAllInRect(replaceR, &RTrue<R>);
52
53 test.clear();
54 theTree.ForEach(base::MakeBackInsertFunctor(test));
55 TEST_EQUAL(1, test.size(), ());
56 TEST_EQUAL(test[0], replaceR, ());
57
58 test.clear();
59 theTree.ForEachInRect(searchR, base::MakeBackInsertFunctor(test));
60 TEST_EQUAL(1, test.size(), ());
61}
62
63UNIT_TEST(Tree4D_ForAnyInRect)
64{

Callers

nothing calls this directly

Calls 15

MakeBackInsertFunctorFunction · 0.85
TESTFunction · 0.85
CheckInRectFunction · 0.85
findFunction · 0.85
ReplaceAllInRectMethod · 0.80
ForAnyInRectMethod · 0.80
maxXMethod · 0.80
ReplaceEqualInRectMethod · 0.80
ForEachMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
ForEachInRectMethod · 0.45

Tested by

no test coverage detected