activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r587155 - /activemq/activemq-cpp/trunk/src/test/activemq/connector/openwire/marshal/BaseDataStreamMarshallerTest.cpp
Date Mon, 22 Oct 2007 17:05:01 GMT
Author: tabish
Date: Mon Oct 22 10:04:59 2007
New Revision: 587155

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

Cleaning up the marshaling test code.

Modified:
    activemq/activemq-cpp/trunk/src/test/activemq/connector/openwire/marshal/BaseDataStreamMarshallerTest.cpp

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/openwire/marshal/BaseDataStreamMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/openwire/marshal/BaseDataStreamMarshallerTest.cpp?rev=587155&r1=587154&r2=587155&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/openwire/marshal/BaseDataStreamMarshallerTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/openwire/marshal/BaseDataStreamMarshallerTest.cpp
Mon Oct 22 10:04:59 2007
@@ -41,10 +41,10 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void BaseDataStreamMarshallerTest::testLooseMarshal()
-{   
+{
     SimpleDataStructureMarshaller* simpleMarshaller = new SimpleDataStructureMarshaller();
     ComplexDataStructureMarshaller* complexMarshaller = new ComplexDataStructureMarshaller();
-    Properties props;    
+    Properties props;
     OpenWireFormat openWireFormat(props);
     openWireFormat.addMarshaller( simpleMarshaller );
     openWireFormat.addMarshaller( complexMarshaller );
@@ -52,19 +52,19 @@
     // Marshal the dataStructure to a byte array.
     ByteArrayOutputStream baos;
     DataOutputStream looseOut( &baos );
-    looseOut.writeByte( dataStructure->getDataStructureType() );    
+    looseOut.writeByte( dataStructure->getDataStructureType() );
     complexMarshaller->looseMarshal( &openWireFormat, dataStructure, &looseOut
);
-    
+
     // Now read it back in and make sure it's all right.
     ByteArrayInputStream bais( baos.getByteArray(), baos.getByteArraySize() );
     DataInputStream looseIn( &bais );
-    
+
     unsigned char dataType = looseIn.readByte();
     CPPUNIT_ASSERT( dataType == dataStructure->getDataStructureType() );
 
     ComplexDataStructure ds;
     complexMarshaller->looseUnmarshal( &openWireFormat, &ds, &looseIn );
-    
+
     CPPUNIT_ASSERT( ds.boolValue == dataStructure->boolValue );
     CPPUNIT_ASSERT( ds.cachedChild != NULL );
     CPPUNIT_ASSERT( ds.cachedChild->boolValue == dataStructure->cachedChild->boolValue
);
@@ -78,10 +78,10 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void BaseDataStreamMarshallerTest::testTightMarshal()
-{   
+{
     SimpleDataStructureMarshaller* simpleMarshaller = new SimpleDataStructureMarshaller();
     ComplexDataStructureMarshaller* complexMarshaller = new ComplexDataStructureMarshaller();
-    Properties props;    
+    Properties props;
     OpenWireFormat openWireFormat(props);
     openWireFormat.addMarshaller( simpleMarshaller );
     openWireFormat.addMarshaller( complexMarshaller );
@@ -89,23 +89,22 @@
     // Marshal the dataStructure to a byte array.
     ByteArrayOutputStream baos;
     DataOutputStream dataOut( &baos );
-    
+
     // Phase 1 - count the size
     int size = 1;
     BooleanStream bs;
     size += complexMarshaller->tightMarshal1( &openWireFormat, dataStructure, &bs
);
     size += bs.marshalledSize();
-    
+
     // Phase 2 - marshal
     dataOut.writeByte( dataStructure->getDataStructureType() );
     bs.marshal( &dataOut );
     complexMarshaller->tightMarshal2( &openWireFormat, dataStructure, &dataOut,
&bs );
-    
-    
+
     // Now read it back in and make sure it's all right.
     ByteArrayInputStream bais( baos.getByteArray(), baos.getByteArraySize() );
     DataInputStream dataIn( &bais );
-    
+
     unsigned char dataType = dataIn.readByte();
     CPPUNIT_ASSERT( dataType == dataStructure->getDataStructureType() );
 
@@ -113,7 +112,7 @@
     bs.clear();
     bs.unmarshal( &dataIn );
     complexMarshaller->tightUnmarshal( &openWireFormat, &ds, &dataIn, &bs
);
-    
+
     CPPUNIT_ASSERT( ds.boolValue == dataStructure->boolValue );
     CPPUNIT_ASSERT( ds.cachedChild != NULL );
     CPPUNIT_ASSERT( ds.cachedChild->boolValue == dataStructure->cachedChild->boolValue
);
@@ -122,8 +121,5 @@
     CPPUNIT_ASSERT( ds.cachedChild->intValue == dataStructure->cachedChild->intValue
);
     CPPUNIT_ASSERT( ds.cachedChild->floatValue == dataStructure->cachedChild->floatValue
);
     CPPUNIT_ASSERT( ds.cachedChild->doubleValue == dataStructure->cachedChild->doubleValue
);
-    printf("string1[%s,%d] string2[%s,%d]\n",ds.cachedChild->stringValue.c_str(), (int)ds.cachedChild->stringValue.size(),
dataStructure->cachedChild->stringValue.c_str(), (int)dataStructure->cachedChild->stringValue.size()
);
     CPPUNIT_ASSERT( ds.cachedChild->stringValue == dataStructure->cachedChild->stringValue
);
 }
-
-



Mime
View raw message