]> git.mxchange.org Git - simgear.git/blobdiff - simgear/props/propertyObject_test.cxx
Revert "Use simgear internal stuff for the singleton class."
[simgear.git] / simgear / props / propertyObject_test.cxx
index b2c458ad5a12da9b33a52c601451fe1c35b0568e..b366d27af0ef65e927b44ec97fc2e900420be6c0 100644 (file)
@@ -1,3 +1,12 @@
+#ifdef HAVE_CONFIG_H
+#  include <simgear_config.h>
+#endif
+
+#ifdef NDEBUG
+// Always enable DEBUG mode in test application, otherwise "assert" test
+// statements have no effect and don't actually test anything (catch 17 ;-) ).
+#undef NDEBUG
+#endif
 
 #include <simgear/compiler.h>
 
@@ -5,6 +14,9 @@
 #include <cassert>
 #include <cstring>
 
+// working around MSVC weirdness with props.hxx and SGMathFwd
+#include <simgear/math/SGMath.hxx>
+
 #include "propertyObject.hxx"
 
 #include <simgear/structure/exception.hxx>
@@ -37,9 +49,11 @@ bool testBasic()
 
   double ff(aFoo);
   assert(ff == 12.0); // comparison with literal
+  if (ff != 12.0) cout << "Error: a/foo != 12!" << endl;
   
   const float fff(12.0f);
   assert(fff == aFoo); // comparion with float value
+  if (fff != aFoo) cout << "Error: 12 != a/foo" << endl;
 
   return true;
 }
@@ -135,8 +149,9 @@ void testReadMissing()
   PropertyObject<bool> b("not/found/honest");
 
   try {
-    bool v = b;    
+    bool v = b;
     assert(false && "read of missing property didn't throw");
+    (void) v; // don't warn about unused variable
   } catch (sg_exception& e) {
     // expected
   }