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

Function writerTest_testColorRanges

plugins/e57/test/E57WriterTest.cpp:122–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void writerTest_testColorRanges(pdal::Reader* r, std::string infile, int min, int max)
123{
124 std::string outfile(Support::datapath("e57/test.e57"));
125 remove(outfile.c_str());
126
127 Options ro;
128
129 ro.add("filename", infile);
130 r->setOptions(ro);
131
132 {
133 E57Writer w;
134 Options wo;
135
136 wo.add("filename", outfile);
137 w.setOptions(wo);
138 w.setInput(*r);
139
140 PointTable t;
141
142 w.prepare(t);
143 w.execute(t);
144 }
145 e57::ImageFile imf(outfile, "r");
146
147 e57::VectorNode data3D(imf.root().get("/data3D"));
148 auto colorLimits = (e57::StructureNode)((e57::StructureNode)data3D.get(0))
149 .get("colorLimits");
150 std::vector<std::string> minDims{"colorRedMinimum", "colorGreenMinimum",
151 "colorBlueMinimum"};
152 std::vector<std::string> maxDims{"colorRedMaximum", "colorGreenMaximum",
153 "colorBlueMaximum"};
154
155 for (auto& dim : minDims)
156 {
157 ASSERT_EQ(((e57::IntegerNode)colorLimits.get(dim)).value(), min);
158 }
159
160 for (auto& dim : maxDims)
161 {
162 ASSERT_EQ(((e57::IntegerNode)colorLimits.get(dim)).value(), max);
163 }
164
165 remove(outfile.c_str());
166}
167
168TEST(E57WriterTest, testWriteRanges)
169{

Callers 1

TESTFunction · 0.85

Calls 9

datapathFunction · 0.85
removeFunction · 0.85
setOptionsMethod · 0.80
addMethod · 0.45
prepareMethod · 0.45
executeMethod · 0.45
getMethod · 0.45
rootMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected