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

Function TEST

test/unit/filters/InfoFilterTest.cpp:65–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65TEST(InfoFilterTest, point)
66{
67 struct rgb
68 {
69 int r;
70 int g;
71 int b;
72
73 bool operator == (const rgb& o) const
74 {
75 return o.r == r && o.g == g && o.b == b;
76 }
77 };
78
79 std::vector<rgb> vtest { {84, 102, 93}, {82, 98, 90}, {80, 96, 90},
80 {79, 96, 90}, {78, 94, 89}, {82, 98, 90}, {80, 98, 90},
81 {89, 106, 99}, {80, 100, 90}, {77, 93, 86} };
82 std::vector<rgb> v;
83
84 Options fOpts;
85 fOpts.add("point", "0-9");
86 MetadataNode m = run(fOpts);
87 MetadataNode p = m.findChild("points");
88 MetadataNodeList l = p.children();
89 EXPECT_EQ(l.size(), 10U);
90 for (MetadataNode& n : l)
91 {
92 int r = n.findChild("Red").value<int>();
93 int g = n.findChild("Green").value<int>();
94 int b = n.findChild("Blue").value<int>();
95 v.push_back({r, g, b});
96 }
97 for (size_t i = 0; i < vtest.size(); ++i)
98 EXPECT_EQ(v[i], vtest[i]);
99}
100
101TEST(InfoFilterTest, query)
102{

Callers

nothing calls this directly

Calls 13

datapathFunction · 0.85
createStageMethod · 0.80
setOptionsMethod · 0.80
runFunction · 0.70
addMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
prepareMethod · 0.45
executeMethod · 0.45
boundsMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected