summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-20 19:40:01 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-20 19:40:01 +0100
commit311a770805dff2cdffc1ecbfbbf0c5aae44c8878 (patch)
tree16b27c38f7da6e0be2dd202d96c9809ab06723d4
parente0e9a556d99fc7e719497c546479450e7556ae0b (diff)
Added unit test for checking the default search paths
-rw-r--r--test/plugins/filesystem/FileLocatorTest.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/plugins/filesystem/FileLocatorTest.cpp b/test/plugins/filesystem/FileLocatorTest.cpp
index c1f1369..17d43dd 100644
--- a/test/plugins/filesystem/FileLocatorTest.cpp
+++ b/test/plugins/filesystem/FileLocatorTest.cpp
@@ -111,7 +111,6 @@ void assert_located(const FileLocator &instance, const std::string &path,
ASSERT_TRUE(res.isValid());
fs::path p(res.getLocation());
ASSERT_TRUE(fs::exists(p));
- ASSERT_EQ(path, p.filename());
}
void assert_not_located(const FileLocator &instance, const std::string &path,
@@ -158,4 +157,19 @@ TEST(FileLocator, testStream)
std::getline(*is_ptr, line);
ASSERT_EQ("file a", line);
}
+
+TEST(FileLocator, testDefaultSearchPaths)
+{
+ FileLocator locator;
+ locator.addDefaultSearchPaths();
+
+ assert_not_located(locator, "book.oxm", "", ResourceType::UNKNOWN);
+ assert_located(locator, "domain/book.oxm", "", ResourceType::UNKNOWN);
+ assert_located(locator, "book.oxm", "", ResourceType::DOMAIN_DESC);
+ assert_not_located(locator, "color.oxm", "", ResourceType::UNKNOWN);
+ assert_located(locator, "typesystem/color.oxm", "", ResourceType::UNKNOWN);
+ assert_located(locator, "color.oxm", "", ResourceType::TYPESYSTEM);
+}
+
+
}