activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r465296 - in /incubator/activemq/activemq-cpp/trunk/activemq-cpp/src: main/activemq/connector/openwire/marshal/HexTable.cpp test/activemq/connector/openwire/marshal/HexTableTest.h
Date Wed, 18 Oct 2006 16:51:57 GMT
Author: tabish
Date: Wed Oct 18 09:51:56 2006
New Revision: 465296

URL: http://svn.apache.org/viewvc?view=rev&rev=465296
Log:
Adding new code for Openwire Support

Modified:
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/HexTable.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/marshal/HexTableTest.h

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/HexTable.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/HexTable.cpp?view=diff&rev=465296&r1=465295&r2=465296
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/HexTable.cpp
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/HexTable.cpp
Wed Oct 18 09:51:56 2006
@@ -32,18 +32,15 @@
     
     const char values[] = 
         { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 
-          'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 
-          'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
-    const int count = 36;
+          'c', 'd', 'e', 'f' };
+    const int count = 16;
     
     for( int i = 0; i < count; ++i ) {
-        string entry( 1, values[i] );
-        
         for( int j = 0; j < count; ++j ) {
+            string entry( 1, values[i] );
             entry += values[j];
+            table.push_back( entry );
         }
-        
-        table.push_back( entry );
     }
 }
 

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/marshal/HexTableTest.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/marshal/HexTableTest.h?view=diff&rev=465296&r1=465295&r2=465296
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/marshal/HexTableTest.h
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/marshal/HexTableTest.h
Wed Oct 18 09:51:56 2006
@@ -43,10 +43,21 @@
             
             HexTable table;
             
-            CPPUNIT_ASSERT( table[0] == "00" ); 
-            CPPUNIT_ASSERT( table[255] == "FF" );
+            CPPUNIT_ASSERT( table[0] == "00" );
+            CPPUNIT_ASSERT( table[32] == "20" );
+            CPPUNIT_ASSERT( table[55] == "37" );
+            CPPUNIT_ASSERT( table[96] == "60" );
+            CPPUNIT_ASSERT( table[156] == "9c" );
+            CPPUNIT_ASSERT( table[232] == "e8" );
+            CPPUNIT_ASSERT( table[255] == "ff" );
 
-            CPPUNIT_ASSERT( table.size() == 255 );
+            CPPUNIT_ASSERT( table.size() == 256 );
+            
+            try{
+                std::string test = table[277];
+                CPPUNIT_ASSERT( false );
+            }
+            catch(...) {}
         }        
 
     };



Mime
View raw message