]> git.mxchange.org Git - simgear.git/blobdiff - simgear/misc/props_test.cxx
Patch from Frederic Bouvier:
[simgear.git] / simgear / misc / props_test.cxx
index 6f847b5538015776ac0184068a88a7b0599ae0eb..4e48b6c593e10042cbf2de24ced2f59fd5cfe17f 100644 (file)
@@ -53,7 +53,7 @@ static double getNum (int index) { return 1.0 / index; }
 static void
 show_values (const SGPropertyNode * node)
 {
-  cout << "Bool: " << node->getBoolValue() << endl;
+  cout << "Bool: " << (node->getBoolValue() ? "true" : "false") << endl;
   cout << "Int: " << node->getIntValue() << endl;
   cout << "Float: " << node->getFloatValue() << endl;
   cout << "Double: " << node->getDoubleValue() << endl;
@@ -275,7 +275,7 @@ test_value ()
 static void
 dump_node (const SGPropertyNode * node)
 {
-  writeProperties(cout, node);
+  writeProperties(cout, node, true);
 }
 
 static void
@@ -333,11 +333,15 @@ int main (int ac, char ** av)
   test_property_nodes();
 
   for (int i = 1; i < ac; i++) {
-    cout << "Reading " << av[i] << endl;
-    SGPropertyNode root;
-    readProperties(av[i], &root);
-    writeProperties(cout, &root);
-    cout << endl;
+    try {
+      cout << "Reading " << av[i] << endl;
+      SGPropertyNode root;
+      readProperties(av[i], &root);
+      writeProperties(cout, &root, true);
+      cout << endl;
+    } catch (string &message) {
+      cout << "Aborted with " << message << endl;
+    }
   }
 
   return 0;