activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1085822 - /activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LinkedListTest.cpp
Date Sat, 26 Mar 2011 22:59:48 GMT
Author: tabish
Date: Sat Mar 26 22:59:47 2011
New Revision: 1085822

URL: http://svn.apache.org/viewvc?rev=1085822&view=rev
Log:
Implement a test case that was forgotten.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LinkedListTest.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LinkedListTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LinkedListTest.cpp?rev=1085822&r1=1085821&r2=1085822&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LinkedListTest.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LinkedListTest.cpp Sat Mar
26 22:59:47 2011
@@ -1233,23 +1233,27 @@ void LinkedListTest::testRemoveFirstOccu
 ////////////////////////////////////////////////////////////////////////////////
 void LinkedListTest::testRemoveLastOccurrence() {
 
-//    CPPUNIT_ASSERT(list.offerLast(testObjOne));
-//    CPPUNIT_ASSERT(list.offerLast(testObjTwo));
-//    CPPUNIT_ASSERT(list.offerLast(testObjOne));
-//    CPPUNIT_ASSERT(list.offerLast(testObjThree));
-//    CPPUNIT_ASSERT(list.offerLast(testObjOne));
-//    CPPUNIT_ASSERT_EQUAL(5, list.size());
-//    CPPUNIT_ASSERT(list.removeLastOccurrence(testObjOne));
-//    assertFalse(list.removeLastOccurrence(testObjFour));
-//    CPPUNIT_ASSERT_EQUAL(testObjOne, list.peekFirst());
-//    CPPUNIT_ASSERT_EQUAL(testObjThree, list.peekLast());
-//    CPPUNIT_ASSERT_EQUAL(4, list.size());
-//    CPPUNIT_ASSERT(list.removeLastOccurrence(testObjOne));
-//    CPPUNIT_ASSERT_EQUAL(3, list.size());
-//    CPPUNIT_ASSERT_EQUAL(testObjOne, list.peekFirst());
-//    CPPUNIT_ASSERT_EQUAL(testObjThree, list.peekLast());
-//    CPPUNIT_ASSERT(list.removeLastOccurrence(testObjOne));
-//    CPPUNIT_ASSERT_EQUAL(2, list.size());
-//    CPPUNIT_ASSERT_EQUAL(testObjThree, list.peekLast());
-//    assertFalse(list.removeLastOccurrence(testObjOne));
+    LinkedList<int> list;
+    std::auto_ptr< Iterator<int> > iter( list.descendingIterator() );
+
+    CPPUNIT_ASSERT( list.offerLast(1) );
+    CPPUNIT_ASSERT( list.offerLast(2) );
+    CPPUNIT_ASSERT( list.offerLast(1) );
+    CPPUNIT_ASSERT( list.offerLast(3) );
+    CPPUNIT_ASSERT( list.offerLast(1) );
+
+    CPPUNIT_ASSERT_EQUAL( 5, list.size() );
+
+    CPPUNIT_ASSERT( list.removeLastOccurrence(1) );
+    CPPUNIT_ASSERT( !list.removeLastOccurrence(4) );
+    CPPUNIT_ASSERT_EQUAL( 1, list.getFirst() );
+    CPPUNIT_ASSERT_EQUAL( 3, list.getLast() );
+    CPPUNIT_ASSERT_EQUAL( 4, list.size() );
+    CPPUNIT_ASSERT( list.removeLastOccurrence(1) );
+    CPPUNIT_ASSERT_EQUAL( 3, list.size() );
+    CPPUNIT_ASSERT_EQUAL( 3, list.getLast() );
+    CPPUNIT_ASSERT( list.removeLastOccurrence(1) );
+    CPPUNIT_ASSERT_EQUAL( 2, list.size() );
+    CPPUNIT_ASSERT_EQUAL( 3, list.getLast() );
+    CPPUNIT_ASSERT( !list.removeLastOccurrence(1) );
 }



Mime
View raw message