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

Function TEST

test/unit/io/WriterTest.cpp:49–89  ·  view source on GitHub ↗

Make sure

Source from the content-addressed store, hash-verified

47
48// Make sure
49TEST(WriterTest, issue4261)
50{
51 std::string outfile(Support::temppath("#_#uuid#_foo.txt"));
52 std::string infile(Support::datapath("text/utm17_1.txt"));
53
54 FileUtils::deleteFile(outfile);
55
56 TextReader r;
57 Options ro;
58
59 ro.add("filename", infile);
60 r.setOptions(ro);
61
62 class FooWriter : public FlexWriter
63 {
64 public:
65 std::string getName() const override
66 { return "FooWriter"; }
67 void readyFile(const std::string& filename, const SpatialReference& srs) override
68 {
69 std::string s = FileUtils::getFilename(filename);
70 std::regex re("1_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}_foo.txt");
71 std::smatch sm;
72 EXPECT_TRUE(std::regex_match(s, sm, re));
73 }
74 void writeView(const PointViewPtr view) override
75 {}
76 };
77
78 FooWriter w;
79 Options wo;
80
81 wo.add("filename", outfile);
82 w.setOptions(wo);
83 w.setInput(r);
84
85 PointTable t;
86
87 w.prepare(t);
88 w.execute(t);
89}
90
91} // namespace pdal

Callers

nothing calls this directly

Calls 7

temppathFunction · 0.85
datapathFunction · 0.85
deleteFileFunction · 0.85
setOptionsMethod · 0.80
addMethod · 0.45
prepareMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected