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

Function TEST

test/unit/StreamingTest.cpp:48–108  ·  view source on GitHub ↗

This test depends on stages being executed in the order that they were added to each parent. If you change order, things will break.

Source from the content-addressed store, hash-verified

46// This test depends on stages being executed in the order that they were
47// added to each parent. If you change order, things will break.
48TEST(Streaming, filter)
49{
50 Options ro1;
51 ro1.add("bounds", BOX3D(0, 0, 0, 99, 99, 99));
52 ro1.add("mode", "ramp");
53 ro1.add("count", 100);
54 FauxReader r1;
55 r1.setOptions(ro1);
56
57 Options ro2;
58 ro2.add("bounds", BOX3D(100, 100, 100, 199, 199, 199));
59 ro2.add("mode", "ramp");
60 ro2.add("count", 100);
61 FauxReader r2;
62 r2.setOptions(ro2);
63
64 Options ro3;
65 ro3.add("bounds", BOX3D(200, 200, 200, 299, 299, 299));
66 ro3.add("mode", "ramp");
67 ro3.add("count", 100);
68 FauxReader r3;
69 r3.setOptions(ro3);
70
71 Options ro4;
72 ro4.add("bounds", BOX3D(300, 300, 300, 399, 399, 399));
73 ro4.add("mode", "ramp");
74 ro4.add("count", 100);
75 FauxReader r4;
76 r4.setOptions(ro4);
77
78 MergeFilter m1;
79 m1.setInput(r1);
80 m1.setInput(r2);
81
82 MergeFilter m2;
83 m2.setInput(r3);
84 m2.setInput(r4);
85
86 MergeFilter m3;
87 m3.setInput(m1);
88 m3.setInput(m2);
89
90 StreamCallbackFilter f;
91 int cnt = 0;
92 auto cb = [&cnt](PointRef& point)
93 {
94 static int x(0), y(0), z(0);
95 EXPECT_EQ(point.getFieldAs<int>(Dimension::Id::X), x++);
96 EXPECT_EQ(point.getFieldAs<int>(Dimension::Id::Y), y++);
97 EXPECT_EQ(point.getFieldAs<int>(Dimension::Id::Z), z++);
98 cnt++;
99 return true;
100 };
101 f.setCallback(cb);
102 f.setInput(m3);
103
104 FixedPointTable t(20);
105 f.prepare(t);

Callers

nothing calls this directly

Calls 14

redirectFunction · 0.85
restoreFunction · 0.85
datapathFunction · 0.85
setOptionsMethod · 0.80
executeStreamMethod · 0.80
strMethod · 0.80
createStageMethod · 0.80
BOX3DClass · 0.70
addMethod · 0.45
prepareMethod · 0.45
executeMethod · 0.45
readPipelineMethod · 0.45

Tested by

no test coverage detected