X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fprops%2Fprops_test.cxx;h=b310982149aa53da008836b2b60fa28cf73fc97a;hb=7479ae521ce3f8d713419f1a57d544c71e25cb30;hp=c525e0b879fc3e2b20b458f2c7603bb9e91559c7;hpb=d219c5c4c613e4f36d8ff1ce8af674fc96dcb543;p=simgear.git diff --git a/simgear/props/props_test.cxx b/simgear/props/props_test.cxx index c525e0b8..b3109821 100644 --- a/simgear/props/props_test.cxx +++ b/simgear/props/props_test.cxx @@ -5,13 +5,13 @@ #include -#include STL_IOSTREAM +#include #include "props.hxx" #include "props_io.hxx" -SG_USING_STD(cout); -SG_USING_STD(cerr); -SG_USING_STD(endl); +using std::cout; +using std::cerr; +using std::endl; @@ -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; }