]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/controls/bookctrlbasetest.cpp
Fix configure on GNU Hurd.
[wxWidgets.git] / tests / controls / bookctrlbasetest.cpp
index c5065607e286997cd0dcc05bc688dab3ab5618fc..3aa4cbda63937ed9a2115ac71cf61e5f60977a70 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     wxBookCtrlBase unit test
 // Author:      Steven Lamerton
 // Created:     2010-07-02
-// RCS-ID:      $Id$
 // Copyright:   (c) 2010 Steven Lamerton
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -95,19 +94,25 @@ void BookCtrlBaseTestCase::PageManagement()
     CPPUNIT_ASSERT_EQUAL(0, base->GetSelection());
     CPPUNIT_ASSERT_EQUAL(4, base->GetPageCount());
 
+    // Change the selection to verify that deleting a page before the currently
+    // selected one correctly updates the selection.
+    base->SetSelection(2);
+    CPPUNIT_ASSERT_EQUAL(2, base->GetSelection());
+
     base->DeletePage(1);
 
     CPPUNIT_ASSERT_EQUAL(3, base->GetPageCount());
+    CPPUNIT_ASSERT_EQUAL(1, base->GetSelection());
 
     base->RemovePage(0);
 
     CPPUNIT_ASSERT_EQUAL(2, base->GetPageCount());
+    CPPUNIT_ASSERT_EQUAL(0, base->GetSelection());
 
     base->DeleteAllPages();
 
     CPPUNIT_ASSERT_EQUAL(0, base->GetPageCount());
-
-    AddPanels();
+    CPPUNIT_ASSERT_EQUAL(-1, base->GetSelection());
 }
 
 void BookCtrlBaseTestCase::ChangeEvents()