From be5b25b18a56c690a71d7241dfc680c0b5375e1b Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Fri, 30 Jan 2015 11:47:55 +0100 Subject: added a unit test for absolute paths. --- test/plugins/filesystem/FileLocatorTest.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/plugins/filesystem/FileLocatorTest.cpp') diff --git a/test/plugins/filesystem/FileLocatorTest.cpp b/test/plugins/filesystem/FileLocatorTest.cpp index 75d9f33..87a9223 100644 --- a/test/plugins/filesystem/FileLocatorTest.cpp +++ b/test/plugins/filesystem/FileLocatorTest.cpp @@ -142,6 +142,17 @@ TEST(FileLocator, locate) assert_not_located(locator, "c.txt", "", ResourceType::SCRIPT); } +TEST(FileLocator, locateAbsolute){ + FileLocator locator; + // construct the absolute path by utilizing SpecialPaths and + fs::path testdataDir {SpecialPaths::getDebugTestdataDir()}; + fs::path absolute = fs::canonical(testdataDir); + absolute /= "filesystem"; + absolute /= "a.txt"; + Resource resA; + ASSERT_TRUE(locator.locate(resA, absolute.string())); +} + TEST(FileLocator, locateRelative) { FileLocator locator; -- cgit v1.2.3