]> git.saurik.com Git - wxWidgets.git/commitdiff
added test for wxVector<T> iterators (fails miserably)
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 21 Aug 2007 10:59:57 +0000 (10:59 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 21 Aug 2007 10:59:57 +0000 (10:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/vectors/vectors.cpp

index ca75e21942230d4a2e3773bf915fab2555b7bead..8d17541c559f3d38d0902a8fb9ce44450517b040 100644 (file)
@@ -35,9 +35,11 @@ public:
 private:
     CPPUNIT_TEST_SUITE( VectorsTestCase );
         CPPUNIT_TEST( PushTest );
+        CPPUNIT_TEST( Iterators );
     CPPUNIT_TEST_SUITE_END();
 
     void PushTest();
+    void Iterators();
 
     DECLARE_NO_COPY_CLASS(VectorsTestCase)
 };
@@ -64,3 +66,18 @@ void VectorsTestCase::PushTest()
     CPPUNIT_ASSERT( v[1] == 2 );
     CPPUNIT_ASSERT( v[2] == 42 );
 }
+
+void VectorsTestCase::Iterators()
+{
+    wxVector<int> v;
+    v.push_back(1);
+    v.push_back(2);
+    v.push_back(3);
+    v.push_back(4);
+
+    int value = 1;
+    for ( wxVector<int>::iterator i = v.begin(); i != v.end(); ++i, ++value )
+    {
+        CPPUNIT_ASSERT_EQUAL( value, *i );
+    }
+}