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

Function TEST

plugins/matlab/test/MatlabFilterTest.cpp:54–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52// }
53
54TEST(MatlabFilterTest, simple_fetch)
55{
56
57 Options reader_opts;
58 {
59 BOX3D bounds(1.0, 2.0, 3.0, 101.0, 102.0, 103.0);
60 Option opt1("bounds", bounds);
61 Option opt2("count", 10);
62 Option opt3("mode", "constant");
63
64 reader_opts.add(opt1);
65 reader_opts.add(opt2);
66 reader_opts.add(opt3);
67 }
68
69 Options xfilter_opts;
70 {
71 const Option source("source",
72 "PDAL.X = PDAL.X + 10;PDAL.X(1,1); PDAL.metadata"
73 );
74 xfilter_opts.add(source);
75 const Option args("pdalargs","pdalargs");
76 xfilter_opts.add(args);
77 }
78
79 StageFactory f;
80 {
81 FauxReader reader;
82
83 reader.setOptions(reader_opts);
84
85 Stage* xfilter(f.createStage("filters.matlab"));
86 LogPtr log = Log::makeLog("matlab.log", "stderr");
87 log->setLevel(LogLevel::Debug2);
88 xfilter->setLog(log);
89 xfilter->setOptions(xfilter_opts);
90 xfilter->setInput(reader);
91
92 PointTable table;
93 xfilter->prepare(table);
94 PointViewSet pvSet = xfilter->execute(table);
95
96 PointLayoutPtr layout(table.layout());
97 MetadataNode m = table.metadata();
98 m = m.findChild("filters.matlab");
99 MetadataNodeList l = m.children();
100
101 EXPECT_EQ(l.size(), 0u);
102 if (l.size())
103 {
104 // Matlab filter doesn't i/o metadata
105 EXPECT_EQ(l[0].name(), "filters.matlab");
106 EXPECT_EQ(l[0].value(), "52");
107 EXPECT_EQ(l[0].description(), "a filter description");
108
109 }
110
111

Callers

nothing calls this directly

Calls 12

datapathFunction · 0.85
setOptionsMethod · 0.80
createStageMethod · 0.80
addMethod · 0.45
setLogMethod · 0.45
prepareMethod · 0.45
executeMethod · 0.45
sizeMethod · 0.45
nameMethod · 0.45
valueMethod · 0.45
descriptionMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected