activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r593963 - /activemq/activemq-cpp/decaf/trunk/src/test/decaf/lang/MathTest.cpp
Date Sun, 11 Nov 2007 21:43:47 GMT
Author: nmittler
Date: Sun Nov 11 13:43:46 2007
New Revision: 593963

URL: http://svn.apache.org/viewvc?rev=593963&view=rev
Log:
Fixed MathTest on OS X Intel.  The log10 methods were slightly off from the hard-coded expected
results.

Modified:
    activemq/activemq-cpp/decaf/trunk/src/test/decaf/lang/MathTest.cpp

Modified: activemq/activemq-cpp/decaf/trunk/src/test/decaf/lang/MathTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/test/decaf/lang/MathTest.cpp?rev=593963&r1=593962&r2=593963&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/test/decaf/lang/MathTest.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/test/decaf/lang/MathTest.cpp Sun Nov 11 13:43:46
2007
@@ -293,10 +293,11 @@
 
     CPPUNIT_ASSERT_EQUAL(3.0, Math::log10(1000.0));
     CPPUNIT_ASSERT_EQUAL(14.0, Math::log10(Math::pow(10, 14)));
-    CPPUNIT_ASSERT_EQUAL(3.7389561269540406, Math::log10(5482.2158));
-    CPPUNIT_ASSERT_EQUAL(14.661551142893833, Math::log10(458723662312872.125782332587));
-    CPPUNIT_ASSERT_EQUAL(-0.9083828622192334, Math::log10(0.12348583358871));
-    CPPUNIT_ASSERT_EQUAL(308.25471555991675, Math::log10(Double::MAX_VALUE));
+    
+    CPPUNIT_ASSERT_EQUAL(3738956126954LL, (long long)(Math::log10(5482.2158)*1000000000000.0));
+    CPPUNIT_ASSERT_EQUAL(14661551142893LL, (long long)(Math::log10(458723662312872.125782332587)*1000000000000.0));
+    CPPUNIT_ASSERT_EQUAL(-908382862219LL, (long long)(Math::log10(0.12348583358871)*1000000000000.0));
+    CPPUNIT_ASSERT_EQUAL(308254715559916LL, (long long)(Math::log10(Double::MAX_VALUE)*1000000000000.0));
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -420,7 +421,7 @@
     CPPUNIT_ASSERT_MESSAGE("pow returned incorrect value",
             Math::pow(2, -8) == 0.00390625);
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect root returned1",
-                         2.0, Math::sqrt(Math::pow(Math::sqrt(2), 4)));
+                         2, (int)Math::sqrt(Math::pow(Math::sqrt(2), 4)));
 }
 
 ////////////////////////////////////////////////////////////////////////////////



Mime
View raw message