Dwarf::Path path(rawBaseDir, rawSubDir, rawFile);
CHECK_EQ(expectedBaseDir, path.baseDir())
- << "Path(" << rawBaseDir << ", " << rawSubDir << ", " << rawFile << ")";
+ << "Path(" << rawBaseDir << ", " << rawSubDir << ", " << rawFile << ")";
CHECK_EQ(expectedSubDir, path.subDir())
- << "Path(" << rawBaseDir << ", " << rawSubDir << ", " << rawFile << ")";
+ << "Path(" << rawBaseDir << ", " << rawSubDir << ", " << rawFile << ")";
CHECK_EQ(expectedFile, path.file())
- << "Path(" << rawBaseDir << ", " << rawSubDir << ", " << rawFile << ")";
+ << "Path(" << rawBaseDir << ", " << rawSubDir << ", " << rawFile << ")";
CHECK_EQ(expectedPath, path.toString());
}
TEST(Dwarf, Path) {
+ checkPath("hello.cpp", "", "", "hello.cpp", "", "", "hello.cpp");
+ checkPath("foo/hello.cpp", "foo", "", "hello.cpp", "foo", "", "hello.cpp");
+ checkPath("foo/hello.cpp", "foo", "", "hello.cpp", "", "foo", "hello.cpp");
+ checkPath("hello.cpp", "", "", "hello.cpp", "./////", "./////", "hello.cpp");
+ checkPath("/hello.cpp", "/", "", "hello.cpp", "/////", "./////", "hello.cpp");
checkPath(
- "hello.cpp",
- "",
- "",
- "hello.cpp",
- "",
- "",
- "hello.cpp");
- checkPath(
- "foo/hello.cpp",
- "foo",
- "",
- "hello.cpp",
- "foo",
- "",
- "hello.cpp");
- checkPath(
- "foo/hello.cpp",
- "foo",
- "",
- "hello.cpp",
- "",
- "foo",
- "hello.cpp");
- checkPath(
- "hello.cpp",
- "",
- "",
- "hello.cpp",
- "./////",
- "./////",
- "hello.cpp");
- checkPath(
- "/hello.cpp",
- "/",
- "",
- "hello.cpp",
- "/////",
- "./////",
- "hello.cpp");
- checkPath(
- "/hello.cpp",
- "/",
- "",
- "hello.cpp",
- "/./././././././",
- "",
- "hello.cpp");
+ "/hello.cpp", "/", "", "hello.cpp", "/./././././././", "", "hello.cpp");
}