added test for wxVector<T> iterators (fails miserably)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2007-08-21 10:59:57 +00:00
parent 9cf3337215
commit 6757b667fd

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