From 2fb8e32104fb9504e196ed276972fa5f6f2455ee Mon Sep 17 00:00:00 2001 From: ehofman Date: Mon, 25 May 2009 11:12:59 +0000 Subject: [PATCH] test for addChild also --- simgear/props/props_test.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/simgear/props/props_test.cxx b/simgear/props/props_test.cxx index 7e67e352..b3109821 100644 --- a/simgear/props/props_test.cxx +++ b/simgear/props/props_test.cxx @@ -324,6 +324,26 @@ test_property_nodes () cout << endl; } +void test_addChild() +{ + SGPropertyNode root; + + cout << "Testing the addChild function " << endl; + cout << "Created root node " << root.getPath() << endl; + + SGPropertyNode *test = root.getChild("test", 0, true); + SGPropertyNode *n = test->getNode("foo", true); + n->getChild("child", 1, true)->setIntValue(1); + n->getChild("child", 2, true)->setIntValue(2); + n->getChild("child", 4, true)->setIntValue(2); + dump_node(&root); + + SGPropertyNode *ch = n->addChild("child"); + ch->setIntValue(3); + cerr << endl << "ADDED: " << ch->getPath() << endl << endl; + dump_node(&root); +} + int main (int ac, char ** av) { @@ -342,5 +362,7 @@ int main (int ac, char ** av) } } + test_addChild(); + return 0; } -- 2.39.5