activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r990894 - /activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/IdGeneratorTest.cpp
Date Mon, 30 Aug 2010 18:51:57 GMT
Author: tabish
Date: Mon Aug 30 18:51:57 2010
New Revision: 990894

URL: http://svn.apache.org/viewvc?rev=990894&view=rev
Log:
Add some additional test cases for the Id Generation.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/IdGeneratorTest.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/IdGeneratorTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/IdGeneratorTest.cpp?rev=990894&r1=990893&r2=990894&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/IdGeneratorTest.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/IdGeneratorTest.cpp Mon
Aug 30 18:51:57 2010
@@ -37,6 +37,21 @@ void IdGeneratorTest::testConstructor1()
 
     CPPUNIT_ASSERT( idGen.generateId() != "" );
     CPPUNIT_ASSERT( idGen.generateId() != "" );
+
+    std::string id1 = idGen.generateId();
+    std::string id2 = idGen.generateId();
+
+    CPPUNIT_ASSERT( id1 != id2 );
+
+    std::size_t idPos = id1.find("ID:");
+
+    CPPUNIT_ASSERT( idPos == 0 );
+
+    std::size_t firstColon = id1.find(':');
+    std::size_t lastColon = id1.rfind(':');
+
+    CPPUNIT_ASSERT( firstColon != lastColon );
+    CPPUNIT_ASSERT( ( lastColon - firstColon ) > 1 );
 }
 
 ////////////////////////////////////////////////////////////////////////////////



Mime
View raw message