summaryrefslogtreecommitdiff
path: root/test/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'test/plugins')
-rw-r--r--test/plugins/css/CSSParserTest.cpp4
-rw-r--r--test/plugins/filesystem/FileLocatorTest.cpp20
-rw-r--r--test/plugins/xml/XmlParserTest.cpp5
3 files changed, 21 insertions, 8 deletions
diff --git a/test/plugins/css/CSSParserTest.cpp b/test/plugins/css/CSSParserTest.cpp
index 84522b3..774c345 100644
--- a/test/plugins/css/CSSParserTest.cpp
+++ b/test/plugins/css/CSSParserTest.cpp
@@ -26,8 +26,6 @@
#include <core/parser/StandaloneParserContext.hpp>
namespace ousia {
-namespace parser {
-namespace css {
TEST(CSSParser, testParseSelectors)
{
// create a string describing a SelectorTree
@@ -296,5 +294,3 @@ TEST(CSSParser, testParseExceptions)
assertException("A > ");
}
}
-}
-}
diff --git a/test/plugins/filesystem/FileLocatorTest.cpp b/test/plugins/filesystem/FileLocatorTest.cpp
index 17d43dd..beb091d 100644
--- a/test/plugins/filesystem/FileLocatorTest.cpp
+++ b/test/plugins/filesystem/FileLocatorTest.cpp
@@ -142,6 +142,26 @@ TEST(FileLocator, testLocate)
assert_not_located(locator, "c.txt", "", ResourceType::SCRIPT);
}
+TEST(FileLocator, testLocateRelative)
+{
+ FileLocator locator;
+ locator.addUnittestSearchPath("filesystem");
+
+ // Add the respective search path
+ locator.addUnittestSearchPath("filesystem/b");
+
+ Resource resA, resC;
+ ASSERT_TRUE(locator.locate(resA, "a.txt"));
+ ASSERT_TRUE(locator.locate(resC, "c.txt"));
+
+ Resource resD;
+ ASSERT_TRUE(locator.locate(resD, "d.txt"));
+ ASSERT_TRUE(locator.locate(resD, "d.txt", ResourceType::UNKNOWN, resA));
+ ASSERT_TRUE(locator.locate(resD, "d.txt", ResourceType::UNKNOWN, resC));
+ ASSERT_FALSE(locator.locate(resD, "./d.txt", ResourceType::UNKNOWN, resA));
+ ASSERT_TRUE(locator.locate(resD, "./d.txt", ResourceType::UNKNOWN, resC));
+}
+
TEST(FileLocator, testStream)
{
FileLocator locator;
diff --git a/test/plugins/xml/XmlParserTest.cpp b/test/plugins/xml/XmlParserTest.cpp
index f1956e0..7785ae2 100644
--- a/test/plugins/xml/XmlParserTest.cpp
+++ b/test/plugins/xml/XmlParserTest.cpp
@@ -20,14 +20,13 @@
#include <gtest/gtest.h>
+#include <core/common/CharReader.hpp>
#include <core/common/Logger.hpp>
#include <core/parser/StandaloneParserContext.hpp>
#include <plugins/xml/XmlParser.hpp>
namespace ousia {
-namespace parser {
-namespace xml {
static TerminalLogger logger(std::cerr, true);
@@ -94,6 +93,4 @@ TEST(XmlParser, namespaces)
}
}
}
-}
-}