summaryrefslogtreecommitdiff
path: root/test/model/GraphNode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/model/GraphNode.cpp')
-rw-r--r--test/model/GraphNode.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/model/GraphNode.cpp b/test/model/GraphNode.cpp
index a5596f5..7f6f2f9 100644
--- a/test/model/GraphNode.cpp
+++ b/test/model/GraphNode.cpp
@@ -21,14 +21,31 @@
#include <model/GraphNode.hpp>
namespace ousia {
+namespace model {
+
+// Make the protected constructor of GraphNode available
+class TestGraphNode : public GraphNode {
+
+public:
+ TestGraphNode(GraphNodeType type, std::shared_ptr<GraphNode> parent,
+ const std::string &name) :
+ GraphNode(type, parent, name)
+ {
+ // Do nothing here
+ }
+
+};
TEST(GraphNodeTest, FullyQuallifiedNameTest)
{
- std::shared_ptr<GraphNode> nd1{new GraphNode("node1")};
- std::shared_ptr<GraphNode> nd2{new GraphNode("node2", nd1)};
+ std::shared_ptr<GraphNode> nd1{new TestGraphNode(
+ GraphNodeType::None, nullptr, "node1")};
+ std::shared_ptr<GraphNode> nd2{new TestGraphNode(
+ GraphNodeType::None, nd1, "node2")};
ASSERT_STREQ("node1.node2", nd2->getFullyQualifiedName().c_str());
}
}
+}