summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2014-11-21 11:10:31 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2014-11-21 11:10:31 +0100
commit08e654dcda7fa6d764558ea184fe1a47bc4001c8 (patch)
tree0d97c16706ebb7832a7797146963f13bc33f24b1
parentca2040ba16459f5b3dfe8a86a14680eecea7ef7d (diff)
Finished last commits moving action by also moving the tests and correcting all references and namespaces in the code.
-rw-r--r--CMakeLists.txt28
-rw-r--r--src/core/BufferedCharReader.cpp3
-rw-r--r--src/core/BufferedCharReader.hpp8
-rw-r--r--src/core/CSSParser.cpp2
-rw-r--r--src/core/CSSParser.hpp16
-rw-r--r--src/core/CodeTokenizer.cpp2
-rw-r--r--src/core/CodeTokenizer.hpp6
-rw-r--r--src/core/Node.cpp3
-rw-r--r--src/core/Node.hpp8
-rw-r--r--src/core/RangeSet.hpp9
-rw-r--r--src/core/Tokenizer.cpp2
-rw-r--r--src/core/Tokenizer.hpp6
-rw-r--r--src/core/Typesystem.hpp11
-rw-r--r--src/core/script/ScriptEngine.hpp2
-rw-r--r--test/core/BufferedCharReaderTest.cpp (renamed from test/core/utils/BufferedCharReaderTest.cpp)5
-rw-r--r--test/core/CSSParserTest.cpp (renamed from test/core/utils/CSSParserTest.cpp)5
-rw-r--r--test/core/CodeTokenizerTest.cpp (renamed from test/core/utils/CodeTokenizerTest.cpp)9
-rw-r--r--test/core/NodeTest.cpp (renamed from test/core/dom/NodeTest.cpp)2
-rw-r--r--test/core/RangeSetTest.cpp (renamed from test/core/utils/RangeSetTest.cpp)4
-rw-r--r--test/core/TokenizerTest.cpp (renamed from test/core/utils/TokenizerTest.cpp)7
-rw-r--r--test/core/UtilsTest.cpp (renamed from test/core/utils/UtilsTest.cpp)2
21 files changed, 54 insertions, 86 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c375e79..3e3d3c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,16 +98,16 @@ ADD_DEFINITIONS(
# TODO: This is not only the script library.
ADD_LIBRARY(ousia_core
src/core/Managed
- src/core/dom/Node
+ src/core/Node
src/core/script/Function
src/core/script/Object
src/core/script/ScriptEngine
src/core/script/Variant
- src/core/utils/BufferedCharReader
- src/core/utils/CodeTokenizer
- src/core/utils/CSSParser
- src/core/utils/Tokenizer
- src/core/utils/Utils
+ src/core/BufferedCharReader
+ src/core/CodeTokenizer
+ src/core/CSSParser
+ src/core/Tokenizer
+ src/core/Utils
)
# ousia_plugin_mozjs library
@@ -136,17 +136,17 @@ IF(TEST)
# Add all unit test files
ADD_EXECUTABLE(ousia_test_core
- test/core/ManagedTest
- test/core/dom/NodeTest
+# test/core/ManagedTest
+ test/core/NodeTest
test/core/script/FunctionTest
test/core/script/ObjectTest
test/core/script/VariantTest
- test/core/utils/BufferedCharReaderTest
- test/core/utils/CodeTokenizerTest
- test/core/utils/CSSParserTest
- test/core/utils/RangeSetTest
- test/core/utils/TokenizerTest
- test/core/utils/UtilsTest
+ test/core/BufferedCharReaderTest
+ test/core/CodeTokenizerTest
+ test/core/CSSParserTest
+ test/core/RangeSetTest
+ test/core/TokenizerTest
+ test/core/UtilsTest
)
TARGET_LINK_LIBRARIES(ousia_test_core
diff --git a/src/core/BufferedCharReader.cpp b/src/core/BufferedCharReader.cpp
index c13628f..15aa6c0 100644
--- a/src/core/BufferedCharReader.cpp
+++ b/src/core/BufferedCharReader.cpp
@@ -19,7 +19,6 @@
#include "BufferedCharReader.hpp"
namespace ousia {
-namespace utils {
// Constants used within the linebreak statemachine.
static const uint8_t LB_STATE_NONE = 0x00;
@@ -212,5 +211,3 @@ bool BufferedCharReader::atEnd()
}
}
-}
-
diff --git a/src/core/BufferedCharReader.hpp b/src/core/BufferedCharReader.hpp
index b13cde6..0d72347 100644
--- a/src/core/BufferedCharReader.hpp
+++ b/src/core/BufferedCharReader.hpp
@@ -16,15 +16,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _OUSIA_UTILS_BUFFERED_CHAR_READER_H_
-#define _OUSIA_UTILS_BUFFERED_CHAR_READER_H_
+#ifndef _OUSIA_BUFFERED_CHAR_READER_H_
+#define _OUSIA_BUFFERED_CHAR_READER_H_
#include <deque>
#include <string>
#include <cstdint>
namespace ousia {
-namespace utils {
/**
* The BufferedCharReader class is used for storing incomming data that
@@ -234,7 +233,6 @@ public:
};
}
-}
-#endif /* _OUSIA_UTILS_BUFFERED_CHAR_READER_H_ */
+#endif /* _OUSIA_BUFFERED_CHAR_READER_H_ */
diff --git a/src/core/CSSParser.cpp b/src/core/CSSParser.cpp
index 1763cc2..00d9c72 100644
--- a/src/core/CSSParser.cpp
+++ b/src/core/CSSParser.cpp
@@ -23,7 +23,6 @@
#include "CSSParser.hpp"
namespace ousia {
-namespace utils {
// CSS code tokens
static const int CURLY_OPEN = 1;
@@ -78,4 +77,3 @@ StyleNode CSSParser::parse(BufferedCharReader &input)
// TODO: implement
}
}
-}
diff --git a/src/core/CSSParser.hpp b/src/core/CSSParser.hpp
index c8b772d..8c15e8e 100644
--- a/src/core/CSSParser.hpp
+++ b/src/core/CSSParser.hpp
@@ -16,21 +16,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _OUSIA_UTILS_CSS_PARSER_HPP_
-#define _OUSIA_UTILS_CSS_PARSER_HPP_
+#ifndef _OUSIA_CSS_PARSER_HPP_
+#define _OUSIA_CSS_PARSER_HPP_
#include <istream>
#include <map>
#include <vector>
#include <tuple>
-#include <core/Managed.hpp>
-#include <core/dom/Node.hpp>
-
#include "BufferedCharReader.hpp"
+#include "Managed.hpp"
+#include "Node.hpp"
namespace ousia {
-namespace utils {
/*
* The Specificity or Precedence of a CSS RuleSet, which decides which
@@ -107,7 +105,7 @@ public:
enum class SelectionOperator { DESCENDANT, DIRECT_DESCENDANT };
-class StyleNode : public dom::Node {
+class StyleNode : public Node {
public:
class StyleEdge : public Managed {
private:
@@ -141,7 +139,7 @@ public:
PseudoSelector pseudoSelector,
const std::vector<Handle<StyleEdge>> &edges,
const std::vector<Handle<RuleSet>> &ruleSets)
- : dom::Node(mgr, std::move(name)),
+ : Node(mgr, std::move(name)),
pseudoSelector(std::move(pseudoSelector)),
edges(acquire(edges)),
ruleSets(acquire(ruleSets))
@@ -163,5 +161,5 @@ public:
StyleNode parse(BufferedCharReader &input);
};
}
-}
+
#endif
diff --git a/src/core/CodeTokenizer.cpp b/src/core/CodeTokenizer.cpp
index e5b8610..ce4afe5 100644
--- a/src/core/CodeTokenizer.cpp
+++ b/src/core/CodeTokenizer.cpp
@@ -21,7 +21,6 @@
#include "CodeTokenizer.hpp"
namespace ousia {
-namespace utils {
Token CodeTokenizer::constructToken(const Token &t)
{
@@ -163,4 +162,3 @@ bool CodeTokenizer::doPrepare(const Token &t, std::deque<Token> &peeked)
assert(false);
}
}
-}
diff --git a/src/core/CodeTokenizer.hpp b/src/core/CodeTokenizer.hpp
index 0fc0862..b392c11 100644
--- a/src/core/CodeTokenizer.hpp
+++ b/src/core/CodeTokenizer.hpp
@@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _OUSIA_UTILS_CODE_TOKENIZER_HPP_
-#define _OUSIA_UTILS_CODE_TOKENIZER_HPP_
+#ifndef _OUSIA_CODE_TOKENIZER_HPP_
+#define _OUSIA_CODE_TOKENIZER_HPP_
#include <map>
#include <sstream>
@@ -26,7 +26,6 @@
#include "Tokenizer.hpp"
namespace ousia {
-namespace utils {
/*
* This enum contains all special Token the CodeTokenizer supports, namely:
@@ -125,6 +124,5 @@ public:
}
};
}
-}
#endif
diff --git a/src/core/Node.cpp b/src/core/Node.cpp
index c9651fb..c18adb4 100644
--- a/src/core/Node.cpp
+++ b/src/core/Node.cpp
@@ -19,7 +19,6 @@
#include "Node.hpp"
namespace ousia {
-namespace dom {
/* Class Node */
@@ -141,5 +140,3 @@ bool Node::triggerEvent(Event &event, bool fromChild) {
}
}
-}
-
diff --git a/src/core/Node.hpp b/src/core/Node.hpp
index 249d1f2..262a611 100644
--- a/src/core/Node.hpp
+++ b/src/core/Node.hpp
@@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _OUSIA_DOM_NODE_HPP_
-#define _OUSIA_DOM_NODE_HPP_
+#ifndef _OUSIA_NODE_HPP_
+#define _OUSIA_NODE_HPP_
#include <functional>
#include <map>
@@ -28,7 +28,6 @@
#include <core/Managed.hpp>
namespace ousia {
-namespace dom {
/* Forward declarations */
class Node;
@@ -512,7 +511,6 @@ public:
bool triggerEvent(Event &event, bool fromChild = false);
};
}
-}
-#endif /* _OUSIA_DOM_NODE_HPP_ */
+#endif /* _OUSIA_NODE_HPP_ */
diff --git a/src/core/RangeSet.hpp b/src/core/RangeSet.hpp
index 841d476..bb9102d 100644
--- a/src/core/RangeSet.hpp
+++ b/src/core/RangeSet.hpp
@@ -16,14 +16,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _OUSIA_MODEL_RANGE_SET_HPP_
-#define _OUSIA_MODEL_RANGE_SET_HPP_
+#ifndef _OUSIA_RANGE_SET_HPP_
+#define _OUSIA_RANGE_SET_HPP_
#include <limits>
#include <set>
namespace ousia {
-namespace model {
/**
* The Range structure represents an interval of numerical values of type T.
*/
@@ -320,7 +319,7 @@ public:
};
}
-}
-#endif /* _OUSIA_MODEL_RANGE_SET_HPP_ */
+
+#endif /* _OUSIA_RANGE_SET_HPP_ */
diff --git a/src/core/Tokenizer.cpp b/src/core/Tokenizer.cpp
index a0ca3aa..f0cd944 100644
--- a/src/core/Tokenizer.cpp
+++ b/src/core/Tokenizer.cpp
@@ -21,7 +21,6 @@
#include "Tokenizer.hpp"
namespace ousia {
-namespace utils {
static std::map<char, TokenTreeNode> buildChildren(
const std::map<std::string, int> &inputs)
@@ -209,4 +208,3 @@ void Tokenizer::consumePeek()
}
}
}
-}
diff --git a/src/core/Tokenizer.hpp b/src/core/Tokenizer.hpp
index 2debc75..f962ead 100644
--- a/src/core/Tokenizer.hpp
+++ b/src/core/Tokenizer.hpp
@@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _OUSIA_UTILS_TOKENIZER_HPP_
-#define _OUSIA_UTILS_TOKENIZER_HPP_
+#ifndef _OUSIA_TOKENIZER_HPP_
+#define _OUSIA_TOKENIZER_HPP_
#include <istream>
#include <map>
@@ -26,7 +26,6 @@
#include "BufferedCharReader.hpp"
namespace ousia {
-namespace utils {
/**
* This exception is currently only thrown if errors are made during the
@@ -226,6 +225,5 @@ public:
void consumePeek();
};
}
-}
#endif
diff --git a/src/core/Typesystem.hpp b/src/core/Typesystem.hpp
index 201aed2..47e7517 100644
--- a/src/core/Typesystem.hpp
+++ b/src/core/Typesystem.hpp
@@ -16,18 +16,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _OUSIA_DOM_TYPESYSTEM_HPP_
-#define _OUSIA_DOM_TYPESYSTEM_HPP_
+#ifndef _OUSIA_TYPESYSTEM_HPP_
+#define _OUSIA_TYPESYSTEM_HPP_
#include <string>
#include <vector>
-#include <core/Managed.hpp>
-
+#include "Managed.hpp"
#include "Node.hpp"
namespace ousia {
-namespace dom {
class Type;
@@ -81,7 +79,6 @@ public:
}
};
}
-}
-#endif /* _OUSIA_DOM_TYPESYSTEM_HPP_ */
+#endif /* _OUSIA_TYPESYSTEM_HPP_ */
diff --git a/src/core/script/ScriptEngine.hpp b/src/core/script/ScriptEngine.hpp
index 6c048aa..3c61cb0 100644
--- a/src/core/script/ScriptEngine.hpp
+++ b/src/core/script/ScriptEngine.hpp
@@ -23,7 +23,7 @@
#include <string>
#include <exception>
-#include <core/utils/Utils.hpp>
+#include <core/Utils.hpp>
#include "Variant.hpp"
diff --git a/test/core/utils/BufferedCharReaderTest.cpp b/test/core/BufferedCharReaderTest.cpp
index 69c0974..41e70ce 100644
--- a/test/core/utils/BufferedCharReaderTest.cpp
+++ b/test/core/BufferedCharReaderTest.cpp
@@ -21,10 +21,9 @@
#include "gtest/gtest.h"
-#include <core/utils/BufferedCharReader.hpp>
+#include <core/BufferedCharReader.hpp>
namespace ousia{
-namespace utils{
TEST(BufferedCharReaderTest, SimpleReadTest)
{
@@ -200,4 +199,4 @@ TEST(BufferedCharReaderTest, RowColumnCounterUTF8Test)
}
}
-}
+
diff --git a/test/core/utils/CSSParserTest.cpp b/test/core/CSSParserTest.cpp
index 920752b..a09c8ff 100644
--- a/test/core/utils/CSSParserTest.cpp
+++ b/test/core/CSSParserTest.cpp
@@ -18,10 +18,9 @@
#include <gtest/gtest.h>
-#include <core/utils/CSSParser.hpp>
+#include <core/CSSParser.hpp>
namespace ousia {
-namespace utils {
TEST(Specificity, testOperators)
{
Specificity s1{0,0,1};
@@ -113,4 +112,4 @@ TEST(Specificity, testOperators)
ASSERT_FALSE(s5 > s5);
}
}
-}
+
diff --git a/test/core/utils/CodeTokenizerTest.cpp b/test/core/CodeTokenizerTest.cpp
index 0b9d7b3..1432564 100644
--- a/test/core/utils/CodeTokenizerTest.cpp
+++ b/test/core/CodeTokenizerTest.cpp
@@ -18,10 +18,9 @@
#include <gtest/gtest.h>
-#include <core/utils/CodeTokenizer.hpp>
+#include <core/CodeTokenizer.hpp>
namespace ousia {
-namespace utils {
static const int BLOCK_COMMENT = 30;
static const int LINE_COMMENT = 31;
@@ -40,8 +39,8 @@ TEST(CodeTokenizer, testTokenizer)
reader.feed("var my_string = 'My \\'String\\'';\n"); // 4
reader.feed("// and a line comment\n"); // 5
reader.feed("var my_obj = { a = 4;}"); // 6
- // 123456789012345678901234567890123456789012345678901234567890123456789
- // 0 1 2 3 4 5 6
+ // 123456789012345678901234567890123456789
+ // 0 1 2 3
TokenTreeNode root{{{"/*", 1},
{"*/", 2},
{"//", 3},
@@ -99,4 +98,4 @@ TEST(CodeTokenizer, testTokenizer)
ASSERT_FALSE(tokenizer.next(t));
}
}
-}
+
diff --git a/test/core/dom/NodeTest.cpp b/test/core/NodeTest.cpp
index 1291d60..9537d29 100644
--- a/test/core/dom/NodeTest.cpp
+++ b/test/core/NodeTest.cpp
@@ -20,7 +20,7 @@
#include <core/Managed.hpp>
-#include <core/dom/Node.hpp>
+#include <core/Node.hpp>
namespace ousia {
namespace dom {
diff --git a/test/core/utils/RangeSetTest.cpp b/test/core/RangeSetTest.cpp
index 9be4c17..e158233 100644
--- a/test/core/utils/RangeSetTest.cpp
+++ b/test/core/RangeSetTest.cpp
@@ -18,10 +18,9 @@
#include <gtest/gtest.h>
-#include <core/utils/RangeSet.hpp>
+#include <core/RangeSet.hpp>
namespace ousia {
-namespace model {
TEST(Range, IsValid)
{
@@ -218,5 +217,4 @@ TEST(RangeSet, Contains)
}
}
-}
diff --git a/test/core/utils/TokenizerTest.cpp b/test/core/TokenizerTest.cpp
index 79cc01d..da6b578 100644
--- a/test/core/utils/TokenizerTest.cpp
+++ b/test/core/TokenizerTest.cpp
@@ -18,12 +18,11 @@
#include <gtest/gtest.h>
-#include <core/utils/BufferedCharReader.hpp>
+#include <core/BufferedCharReader.hpp>
-#include <core/utils/Tokenizer.hpp>
+#include <core/Tokenizer.hpp>
namespace ousia {
-namespace utils {
TEST(TokenTreeNode, testConstructor)
{
TokenTreeNode root{{{"a", 1}, {"aab", 2}, {"aac", 3}, {"abd", 4}}};
@@ -122,4 +121,4 @@ TEST(Tokenizer, testIncompleteTokens)
ASSERT_FALSE(tokenizer.next(t));
}
}
-}
+
diff --git a/test/core/utils/UtilsTest.cpp b/test/core/UtilsTest.cpp
index d349c6f..4f754a5 100644
--- a/test/core/utils/UtilsTest.cpp
+++ b/test/core/UtilsTest.cpp
@@ -18,7 +18,7 @@
#include <gtest/gtest.h>
-#include <core/utils/Utils.hpp>
+#include <core/Utils.hpp>
namespace ousia {