From 9bc7a08b120d8ad7e158a29ead8a09baa538c56c Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Fri, 14 Nov 2014 01:24:18 +0100 Subject: added TestNode unit test --- src/core/dom/Node.cpp | 1 + src/core/dom/Node.hpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/core/dom') diff --git a/src/core/dom/Node.cpp b/src/core/dom/Node.cpp index df5bfcb..a65fc7f 100644 --- a/src/core/dom/Node.cpp +++ b/src/core/dom/Node.cpp @@ -87,6 +87,7 @@ std::vector> Node::resolve(const std::vector &path, resolve(res, path, filter, filterData, 0, visited, nullptr); return res; } + } } diff --git a/src/core/dom/Node.hpp b/src/core/dom/Node.hpp index 571eedd..9c006a1 100644 --- a/src/core/dom/Node.hpp +++ b/src/core/dom/Node.hpp @@ -123,7 +123,10 @@ public: * * @param mgr is a reference to the Manager instace the node belongs to. */ - Node(Manager &mgr) : Managed(mgr) {} + Node(Manager &mgr, Handle parent = nullptr) + : Managed(mgr), parent(acquire(parent)) + { + } /** * Constructs a new node with the given name and the given parent element. @@ -132,7 +135,7 @@ public: * @param name is the name of the Node. * @param parent is a handle pointing at the parent node. */ - Node(Manager &mgr, std::string name, Handle parent = Null) + Node(Manager &mgr, std::string name, Handle parent = nullptr) : Managed(mgr), name(name), parent(acquire(parent)) { } -- cgit v1.2.3