MCPcopy Create free account
hub / github.com/PDAL/PDAL / TEST_P

Function TEST_P

test/unit/filters/GroundFilterTest.cpp:95–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93};
94
95TEST_P(CustomGroundClassTest, CustomGroundClass)
96{
97 const uint8_t groundClass = 7;
98 const uint8_t otherClass = 5;
99 const uint8_t startingClass = 9;
100 const std::string filterTypeName = GetParam();
101
102 // Both classes custom
103 std::unordered_map<uint8_t, size_t> classCounts = this->classCounts(
104 filterTypeName, groundClass, otherClass, startingClass, /*onlyGround=*/false);
105
106 // If the ground classification filter processes a certain range of returns by default,
107 // some points will retain their original class.
108 EXPECT_TRUE((2 <= classCounts.size()) && (classCounts.size() <= 3));
109 // We must observe at least one groundClass and otherClass point regardless of returns
110 // segmentation in the filter.
111 EXPECT_GT(classCounts[groundClass], 0u);
112 EXPECT_GT(classCounts[otherClass], 0u);
113
114 // Same class for groundClass and otherClass, expect an error
115 EXPECT_ANY_THROW(
116 this->classCounts(
117 filterTypeName, groundClass, groundClass, startingClass, /*onlyGround=*/false);
118 );
119
120 // Only ground class is custom, expect part of the original classification to remain
121 classCounts = this->classCounts(
122 filterTypeName, groundClass, otherClass, startingClass, /*onlyGround=*/true);
123
124 EXPECT_EQ(classCounts.size(), 2u);
125 EXPECT_GT(classCounts[groundClass], 0u);
126 EXPECT_GT(classCounts[startingClass], 0u);
127}
128
129std::vector<std::string> groundFilterTypes = {
130 "csf",

Callers

nothing calls this directly

Calls 2

classCountsMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected