X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..23fd114fcd326ffa2a374cc6f107dac4fc876c63:/tests/lists/lists.cpp diff --git a/tests/lists/lists.cpp b/tests/lists/lists.cpp index fb37655b8d..64b1f2b2ae 100644 --- a/tests/lists/lists.cpp +++ b/tests/lists/lists.cpp @@ -152,11 +152,20 @@ void ListsTestCase::wxStdListTest() list1.clear(); CPPUNIT_ASSERT( list1.empty() ); - list1.insert(list1.end(), (int *)1); - list1.insert(list1.end(), (int *)2); + it = list1.insert(list1.end(), (int *)1); + CPPUNIT_ASSERT_EQUAL( (int *)1, *it ); + CPPUNIT_ASSERT( it == list1.begin() ); CPPUNIT_ASSERT_EQUAL( (int *)1, list1.front() ); + + it = list1.insert(list1.end(), (int *)2); + CPPUNIT_ASSERT_EQUAL( (int *)2, *it ); + CPPUNIT_ASSERT( ++it == list1.end() ); CPPUNIT_ASSERT_EQUAL( (int *)2, list1.back() ); + it = list1.begin(); + wxListInt::iterator it2 = list1.insert(++it, (int *)3); + CPPUNIT_ASSERT_EQUAL( (int *)3, *it2 ); + it = list1.begin(); it = list1.erase(++it, list1.end()); CPPUNIT_ASSERT_EQUAL( 1, list1.size() );