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

Function TEST

plugins/spz/test/SpzWriterTest.cpp:38–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38TEST(SpzWriterTest, xyz_only_test)
39{
40 BufferReader r;
41 PointTable t;
42 PointViewPtr v = setXYZ(t);
43 r.addView(v);
44
45 SpzWriter writer;
46 Options opts;
47 std::string path = Support::temppath("out.spz");
48 opts.replace("filename", path);
49 writer.setInput(r);
50 writer.setOptions(opts);
51
52 writer.prepare(t);
53 writer.execute(t);
54
55 SpzReader reader;
56 // using same options, just the filename
57 reader.setOptions(opts);
58
59 PointTable readTable;
60 reader.prepare(readTable);
61 PointViewSet viewSet = reader.execute(readTable);
62 PointViewPtr readView = *viewSet.begin();
63 EXPECT_EQ(readView->size(), 3u);
64
65 // Checking X values. These are packed/unpacked with more precision
66 //than the other fields.
67 EXPECT_FLOAT_EQ(readView->getFieldAs<float>(Dimension::Id::X, 0), 1.0);
68 EXPECT_FLOAT_EQ(readView->getFieldAs<float>(Dimension::Id::X, 1), 2.0);
69 EXPECT_FLOAT_EQ(readView->getFieldAs<float>(Dimension::Id::X, 2), 1.0);
70}
71
72TEST(SpzWriterTest, all_dimensions_test)
73{

Callers

nothing calls this directly

Calls 11

setXYZFunction · 0.85
temppathFunction · 0.85
setOptionsMethod · 0.80
assignDimMethod · 0.80
replaceMethod · 0.45
prepareMethod · 0.45
executeMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45
setFieldMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected