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

Function exec2

test/unit/WhereTest.cpp:92–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void exec2(const std::string& where, size_t expKeep, size_t expViews,
93 Stage::WhereMergeMode mm = Stage::WhereMergeMode::Auto)
94{
95 StageFactory factory;
96
97 Stage *r = factory.createStage("readers.faux");
98 Options ro;
99 ro.add("count", 100);
100 ro.add("bounds", BOX3D(0, 0, 100, 99, 9.9, 199));
101 ro.add("mode", "ramp");
102 r->setOptions(ro);
103
104 class TestFilter : public Filter
105 {
106 public:
107 TestFilter()
108 {
109 g_count = 0;
110 }
111
112 private:
113 std::string getName() const
114 { return "filters.test"; }
115
116 void filter(PointView& v)
117 {
118 g_count = v.size();
119 v.setField(Dimension::Id::X, v.size(), 1);
120 }
121 };
122
123 TestFilter f;
124 Options fo;
125 fo.add("where", where);
126 fo.add("where_merge", mm);
127 f.setOptions(fo);
128 f.setInput(*r);
129
130 PointTable t;
131 f.prepare(t);
132 PointViewSet s = f.execute(t);
133 EXPECT_EQ(s.size(), expViews);
134 size_t total = 0;
135 for (auto vp : s)
136 total += vp->size();
137 EXPECT_EQ(total, 101u);
138 EXPECT_EQ(g_count, expKeep);
139}
140
141void exec3(const std::string& where, size_t expKeep, size_t expViews,
142 Stage::WhereMergeMode mm = Stage::WhereMergeMode::Auto)

Callers 1

TESTFunction · 0.85

Calls 7

createStageMethod · 0.80
setOptionsMethod · 0.80
BOX3DClass · 0.70
addMethod · 0.45
prepareMethod · 0.45
executeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected