]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/lists/lists.cpp
Don't delete wxTaskBarIcon in wxMSW wxNotificationMessage if we don't own it.
[wxWidgets.git] / tests / lists / lists.cpp
index 907e87c70af0e636eadb1211aab0962c081aae0f..c3ffc3385917f83513204630d01accae2f5b68de 100644 (file)
@@ -49,7 +49,7 @@ private:
 // register in the unnamed registry so that these tests are run by default
 CPPUNIT_TEST_SUITE_REGISTRATION( ListsTestCase );
 
 // register in the unnamed registry so that these tests are run by default
 CPPUNIT_TEST_SUITE_REGISTRATION( ListsTestCase );
 
-// also include in it's own registry so that these tests can be run alone
+// also include in its own registry so that these tests can be run alone
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ListsTestCase, "ListsTestCase" );
 
 class Baz // Foo is already taken in the hash test
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ListsTestCase, "ListsTestCase" );
 
 class Baz // Foo is already taken in the hash test
@@ -152,11 +152,20 @@ void ListsTestCase::wxStdListTest()
     list1.clear();
     CPPUNIT_ASSERT( list1.empty() );
 
     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() );
     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() );
 
     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() );
     it = list1.begin();
     it = list1.erase(++it, list1.end());
     CPPUNIT_ASSERT_EQUAL( 1, list1.size() );
@@ -178,8 +187,8 @@ void ListsTestCase::wxListCtorTest()
 {
     {
         wxListBazs list1;
 {
     {
         wxListBazs list1;
-        list1.Append(new Baz(_T("first")));
-        list1.Append(new Baz(_T("second")));
+        list1.Append(new Baz(wxT("first")));
+        list1.Append(new Baz(wxT("second")));
 
         CPPUNIT_ASSERT( list1.GetCount() == 2 );
         CPPUNIT_ASSERT( Baz::GetNumber() == 2 );
 
         CPPUNIT_ASSERT( list1.GetCount() == 2 );
         CPPUNIT_ASSERT( Baz::GetNumber() == 2 );