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 ); + } +}