#include <simgear/compiler.h>
-#include STL_IOSTREAM
+#include <iostream>
#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;
\f
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)
{
}
}
+ test_addChild();
+
return 0;
}