[Mobies-commit] [commit] r4061 - UDM/trunk/tests/test_generic

endre at redhat1.isis.vanderbilt.edu endre at redhat1.isis.vanderbilt.edu
Fri Jun 29 02:49:35 CDT 2012


Author: endre
Date: Fri Jun 29 02:49:35 2012
New Revision: 4061

Log:
testing for UDM#83

Modified:
   UDM/trunk/tests/test_generic/genericTest.cpp

Modified: UDM/trunk/tests/test_generic/genericTest.cpp
==============================================================================
--- UDM/trunk/tests/test_generic/genericTest.cpp	Fri Jun 29 02:17:32 2012	(r4060)
+++ UDM/trunk/tests/test_generic/genericTest.cpp	Fri Jun 29 02:49:35 2012	(r4061)
@@ -15,6 +15,7 @@
 #endif	//WIN32
 
 #include <cstdlib>
+#include <limits>
 
 
 // Registers the fixture into the 'registry'
@@ -115,6 +116,8 @@
 			
 			
 				vector<double> b;
+				b.push_back(-numeric_limits<double>::infinity());
+				b.push_back(numeric_limits<double>::infinity());
 				b.push_back(2.4);
 				b.push_back(1.1);
 				b.push_back(3.141592653589793234);
@@ -122,21 +125,25 @@
 				doubleBulbLamp.ArrayReal() = b;
 
 				//the attribute is ordered array, the order is also checked
-				CPPUNIT_ASSERT_EQUAL((double)9.9999999999999991e-005L, (double)doubleBulbLamp.ArrayReal()[0]);
-				CPPUNIT_ASSERT(doubleBulbLamp.ArrayReal()[1] == 1.1);
-				CPPUNIT_ASSERT(doubleBulbLamp.ArrayReal()[2] == 2.4);
-				CPPUNIT_ASSERT(doubleBulbLamp.ArrayReal()[3] == 3.141592653589793234);
+				CPPUNIT_ASSERT(doubleBulbLamp.ArrayReal()[0] == -numeric_limits<double>::infinity());
+				CPPUNIT_ASSERT_EQUAL((double)9.9999999999999991e-005L, (double)doubleBulbLamp.ArrayReal()[1]);
+				CPPUNIT_ASSERT(doubleBulbLamp.ArrayReal()[2] == 1.1);
+				CPPUNIT_ASSERT(doubleBulbLamp.ArrayReal()[3] == 2.4);
+				CPPUNIT_ASSERT(doubleBulbLamp.ArrayReal()[4] == 3.141592653589793234);
+				CPPUNIT_ASSERT(doubleBulbLamp.ArrayReal()[5] == numeric_limits<double>::infinity());
 				//getting non-existing items - they should be zero
-				CPPUNIT_ASSERT(doubleBulbLamp.ArrayReal()[4] == 0);
+				CPPUNIT_ASSERT(doubleBulbLamp.ArrayReal()[6] == 0);
 			
 
 				//testing non-persistent array attributes
 				doubleBulbLamp.TempArrayReal() = b;			//assign
 				b = doubleBulbLamp.TempArrayReal();			//retrieve
 
-				CPPUNIT_ASSERT(b[1] == 1.1);
-				CPPUNIT_ASSERT(b[2] == 2.4);
-				CPPUNIT_ASSERT(b[3] == 3.141592653589793234);
+				CPPUNIT_ASSERT(b[0] == -numeric_limits<double>::infinity());
+				CPPUNIT_ASSERT(b[2] == 1.1);
+				CPPUNIT_ASSERT(b[3] == 2.4);
+				CPPUNIT_ASSERT(b[4] == 3.141592653589793234);
+				CPPUNIT_ASSERT(b[5] == numeric_limits<double>::infinity());
 				
 				vector<bool> c;
 				c.push_back(true);


More information about the Mobies-commit mailing list