Make sure
| 47 | |
| 48 | // Make sure |
| 49 | TEST(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 |
nothing calls this directly
no test coverage detected