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

Function TEST

test/unit/SupportTest.cpp:45–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43using namespace std;
44
45TEST(SupportTest, test_paths)
46{
47 // does the data path work?
48 string data_file = Support::datapath("las/simple.las");
49 EXPECT_TRUE(FileUtils::fileExists(data_file));
50
51 // make sure we have read access
52 istream* istr = FileUtils::openFile(data_file);
53 string yow;
54 *istr >> yow;
55 FileUtils::closeFile(istr);
56
57 // does the temp path work?
58 string temp_file_ok = Support::temppath("README.txt");
59 EXPECT_TRUE(FileUtils::fileExists(temp_file_ok));
60 string temp_file = Support::temppath("my_temp_file.dat");
61 EXPECT_TRUE(!FileUtils::fileExists(temp_file));
62
63 // make sure we have write access to the temp dir
64 ostream* ostr = FileUtils::createFile(temp_file);
65 *ostr << "yow";
66 FileUtils::closeFile(ostr);
67 EXPECT_TRUE(FileUtils::fileExists(temp_file));
68 EXPECT_TRUE(FileUtils::deleteFile(temp_file));
69 EXPECT_TRUE(!FileUtils::fileExists(temp_file));
70
71 // does binpath (and exename) work?
72 string this_bin = Support::exename("pdal");
73#ifdef _WIN32
74 EXPECT_EQ(this_bin, "pdal.exe");
75#else
76 EXPECT_EQ(this_bin, "pdal");
77#endif
78 this_bin = Support::binpath(this_bin);
79 EXPECT_TRUE(FileUtils::fileExists(this_bin));
80}
81
82
83TEST(SupportTest, test_diff_file)

Callers

nothing calls this directly

Calls 13

datapathFunction · 0.85
temppathFunction · 0.85
deleteFileFunction · 0.85
exenameFunction · 0.85
binpathFunction · 0.85
diff_filesFunction · 0.85
compare_filesFunction · 0.85
diff_text_filesFunction · 0.85
compare_text_filesFunction · 0.85
fileExistsFunction · 0.50
openFileFunction · 0.50
closeFileFunction · 0.50

Tested by

no test coverage detected