]> git.mxchange.org Git - simgear.git/blobdiff - simgear/props/props_test.cxx
cppbind: automatic conversion of SGReferenced derived pointers.
[simgear.git] / simgear / props / props_test.cxx
index c3466a90b42db96d686dd81f7182fccfcc3b40de..debf79d78debb7a09ce1797ee32a726d5a058370 100644 (file)
@@ -19,7 +19,7 @@ using std::cerr;
 using std::endl;
 
 
-\f
+
 ////////////////////////////////////////////////////////////////////////
 // Sample object.
 ////////////////////////////////////////////////////////////////////////
@@ -38,7 +38,7 @@ private:
 };
 
 
-\f
+
 ////////////////////////////////////////////////////////////////////////
 // Sample function.
 ////////////////////////////////////////////////////////////////////////
@@ -48,7 +48,7 @@ static int get100 () { return 100; }
 static double getNum (int index) { return 1.0 / index; }
 
 
-\f
+
 ////////////////////////////////////////////////////////////////////////
 // Show a value.
 ////////////////////////////////////////////////////////////////////////
@@ -64,7 +64,7 @@ show_values (const SGPropertyNode * node)
 }
 
 
-\f
+
 ////////////////////////////////////////////////////////////////////////
 // Test individual values.
 ////////////////////////////////////////////////////////////////////////
@@ -270,7 +270,7 @@ test_value ()
 }
 
 
-\f
+
 ////////////////////////////////////////////////////////////////////////
 // Check property nodes.
 ////////////////////////////////////////////////////////////////////////
@@ -357,20 +357,28 @@ void test_addChild()
       cerr << "** FAILED to create child node at expected index #5" << endl;
   cerr << endl << "ADDED: " << ch->getPath() << endl << endl;
 
-  cout << "Testing appending child node at first empty index" << endl;
-  ch = n->addChild("child", 0, false);
+  cout << "Testing appending child node at first empty index (Skipping 0)" << endl;
+  ch = n->addChild("child", 1, false);
   ch->setIntValue(3);
   if (n->getChild("child", 3, false) != ch)
       cerr << "** FAILED to create child node at expected index #3" << endl;
 
+  cout << "Testing appending child node at first empty index" << endl;
+  ch = n->addChild("child", 0, false);
+  ch->setIntValue(0);
+  if (n->getChild("child", 0, false) != ch)
+      cerr << "** FAILED to create child node at expected index #0" << endl;
+
   cout << "Testing appending child node" << endl;
   ch = n->addChild("first", 0, false);
   if (ch == 0)
       cerr << "** Failed to add child node" << endl;
+  else
+      ch->setStringValue("append first");
   if (n->getChild("first", 0, false) != ch)
       cerr << "** FAILED to append child node with expected index #0" << endl;
   cerr << "ADDED: " << ch->getPath() << endl;
-  if (root.getChild("test/foo/first", false) != ch)
+  if (root.getNode("test/foo/first", false) != ch)
       cerr << "** FAILED to append child node at expected path 'test/foo/first'" << endl;
 
   dump_node(&root);