activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r599942 - /activemq/activemq-cpp/decaf/trunk/src/test/decaf/nio/ByteBufferTest.cpp
Date Fri, 30 Nov 2007 20:11:42 GMT
Author: tabish
Date: Fri Nov 30 12:11:41 2007
New Revision: 599942

URL: http://svn.apache.org/viewvc?rev=599942&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103

Starting the NIO implementation

Modified:
    activemq/activemq-cpp/decaf/trunk/src/test/decaf/nio/ByteBufferTest.cpp

Modified: activemq/activemq-cpp/decaf/trunk/src/test/decaf/nio/ByteBufferTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/test/decaf/nio/ByteBufferTest.cpp?rev=599942&r1=599941&r2=599942&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/test/decaf/nio/ByteBufferTest.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/test/decaf/nio/ByteBufferTest.cpp Fri Nov 30 12:11:41
2007
@@ -17,6 +17,8 @@
 
 #include "ByteBufferTest.h"
 #include <decaf/lang/Integer.h>
+#include <decaf/lang/Double.h>
+#include <decaf/lang/Float.h>
 
 using namespace std;
 using namespace decaf;
@@ -760,7 +762,8 @@
         testBuffer1->mark();
         testBuffer1->putDouble( i + 48.25136 );
         testBuffer1->reset();
-        CPPUNIT_ASSERT( testBuffer1->getDouble() == ( i + 48.25136 ) );
+        CPPUNIT_ASSERT( Double::doubleToLongBits( testBuffer1->getDouble() )==
+                        Double::doubleToLongBits( 48.25136 + i ) );
     }
 
     CPPUNIT_ASSERT_THROW_MESSAGE(
@@ -788,7 +791,8 @@
         testBuffer1->mark();
         testBuffer1->putDouble( i, i + 99.99 );
         testBuffer1->reset();
-        CPPUNIT_ASSERT( testBuffer1->getDouble( i ) == i + 99.99 );
+        CPPUNIT_ASSERT( Double::doubleToLongBits( testBuffer1->getDouble( i ) )==
+                        Double::doubleToLongBits( 99.99 + i ) );
     }
 
     CPPUNIT_ASSERT_THROW_MESSAGE(
@@ -861,7 +865,8 @@
         testBuffer1->mark();
         testBuffer1->putFloat( i + 48.25136f );
         testBuffer1->reset();
-        CPPUNIT_ASSERT( testBuffer1->getFloat() == ( i + 48.25136f ) );
+        CPPUNIT_ASSERT( Float::floatToIntBits( testBuffer1->getFloat() ) ==
+                        Float::floatToIntBits( 48.25136f + i ) );
     }
 
     CPPUNIT_ASSERT_THROW_MESSAGE(
@@ -889,7 +894,8 @@
         testBuffer1->mark();
         testBuffer1->putFloat( i, i + 99.99f );
         testBuffer1->reset();
-        CPPUNIT_ASSERT( testBuffer1->getFloat( i ) == i + 99.99f );
+        CPPUNIT_ASSERT( Float::floatToIntBits( testBuffer1->getFloat( i ) )==
+                        Float::floatToIntBits( 99.99f + i ) );
     }
 
     CPPUNIT_ASSERT_THROW_MESSAGE(



Mime
View raw message