activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r555110 - /activemq/activemq-cpp/trunk/src/test/activemq/util/SetTest.cpp
Date Tue, 10 Jul 2007 23:13:18 GMT
Author: tabish
Date: Tue Jul 10 16:13:17 2007
New Revision: 555110

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

Adding Iterator to the Collections classes to avoid having to call toArray as much.

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

Modified: activemq/activemq-cpp/trunk/src/test/activemq/util/SetTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/util/SetTest.cpp?view=diff&rev=555110&r1=555109&r2=555110
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/util/SetTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/util/SetTest.cpp Tue Jul 10 16:13:17 2007
@@ -123,17 +123,27 @@
     set.add( "fred2" );
     set.add( "fred3" );
 
-    Iterator<string>* iterator = set.iterator();
-    CPPUNIT_ASSERT( iterator != NULL );
-    CPPUNIT_ASSERT( iterator->hasNext() == true );
+    Iterator<string>* iterator1 = set.iterator();
+    CPPUNIT_ASSERT( iterator1 != NULL );
+    CPPUNIT_ASSERT( iterator1->hasNext() == true );
 
     size_t count = 0;
-    while( iterator->hasNext() ) {
-        iterator->next();
+    while( iterator1->hasNext() ) {
+        iterator1->next();
         ++count;
     }
 
     CPPUNIT_ASSERT( count == set.size() );
 
-    delete iterator;
+    Iterator<string>* iterator2 = set.iterator();
+
+    while( iterator2->hasNext() ) {
+        iterator2->next();
+        iterator2->remove();
+    }
+
+    CPPUNIT_ASSERT( set.isEmpty() );
+
+    delete iterator1;
+    delete iterator2;
 }



Mime
View raw message