From: Václav Slavík Date: Tue, 21 Aug 2007 10:59:57 +0000 (+0000) Subject: added test for wxVector iterators (fails miserably) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6757b667fdda54df2b9d62168df5a1574fa5e332 added test for wxVector iterators (fails miserably) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/tests/vectors/vectors.cpp b/tests/vectors/vectors.cpp index ca75e21942..8d17541c55 100644 --- a/tests/vectors/vectors.cpp +++ b/tests/vectors/vectors.cpp @@ -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 v; + v.push_back(1); + v.push_back(2); + v.push_back(3); + v.push_back(4); + + int value = 1; + for ( wxVector::iterator i = v.begin(); i != v.end(); ++i, ++value ) + { + CPPUNIT_ASSERT_EQUAL( value, *i ); + } +}