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

Function exec1

test/unit/WhereTest.cpp:51–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void exec1(const std::string& where, size_t expKeep, size_t expViews,
52 Stage::WhereMergeMode mm = Stage::WhereMergeMode::Auto)
53{
54 StageFactory factory;
55
56 Stage *r = factory.createStage("readers.faux");
57 Options ro;
58 ro.add("count", 100);
59 ro.add("bounds", BOX3D(0, 0, 100, 99, 9.9, 199));
60 ro.add("mode", "ramp");
61 r->setOptions(ro);
62
63 class TestFilter : public Filter
64 {
65 std::string getName() const
66 { return "filters.test"; }
67
68 void filter(PointView& v)
69 {
70 g_count = v.size();
71 }
72 };
73
74 TestFilter f;
75 Options fo;
76 fo.add("where", where);
77 fo.add("where_merge", mm);
78 f.setOptions(fo);
79 f.setInput(*r);
80
81 PointTable t;
82 f.prepare(t);
83 PointViewSet s = f.execute(t);
84 EXPECT_EQ(s.size(), expViews);
85 size_t total = 0;
86 for (auto vp : s)
87 total += vp->size();
88 EXPECT_EQ(total, 100u);
89 EXPECT_EQ(g_count, expKeep);
90}
91
92void exec2(const std::string& where, size_t expKeep, size_t expViews,
93 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