You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2006/12/28 20:47:24 UTC
svn commit: r490777 -
/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/io/DataOutputStreamTest.h
Author: tabish
Date: Thu Dec 28 11:47:23 2006
New Revision: 490777
URL: http://svn.apache.org/viewvc?view=rev&rev=490777
Log:
http://issues.apache.org/activemq/browse/AMQCPP-37
Modified:
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/io/DataOutputStreamTest.h
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/io/DataOutputStreamTest.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/io/DataOutputStreamTest.h?view=diff&rev=490777&r1=490776&r2=490777
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/io/DataOutputStreamTest.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/io/DataOutputStreamTest.h Thu Dec 28 11:47:23 2006
@@ -49,6 +49,8 @@
unsigned char arrayVal[3] = {
'a', 'b', 'c'
};
+ std::string stringVal1 = "ASCII_String";
+ std::string stringVal2 = "UTF8_String";
// Create the stream with the buffer we just wrote to.
ByteArrayOutputStream myStream;
@@ -61,7 +63,8 @@
writer.writeFloat( floatVal );
writer.writeDouble( doubleVal );
writer.write( arrayVal, 3 );
-
+ writer.writeBytes( stringVal1 );
+ writer.writeUTF( stringVal2 );
const unsigned char* buffer = myStream.getByteArray();
int ix = 0;
@@ -89,6 +92,19 @@
double tempDouble = util::Endian::byteSwap( *(double*)(buffer+ix) );
CPPUNIT_ASSERT( tempDouble == doubleVal );
ix += sizeof( tempDouble );
+
+ char tempChar1 = *(char*)(buffer+ix);
+ CPPUNIT_ASSERT( tempChar1 == arrayVal[0] );
+ ix += sizeof( tempChar1 );
+
+ char tempChar2 = *(char*)(buffer+ix);
+ CPPUNIT_ASSERT( tempChar2 == arrayVal[1] );
+ ix += sizeof( tempChar2 );
+
+ char tempChar3 = *(char*)(buffer+ix);
+ CPPUNIT_ASSERT( tempChar3 == arrayVal[2] );
+ ix += sizeof( tempChar3 );
+
}
};