]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/window/clientsize.cpp
Don't ignore child process output if it exits with -1 exit code.
[wxWidgets.git] / tests / window / clientsize.cpp
index 8f87ed9b8b2384061d11df79a9fb11a1a7afa823..57089680ef9ac813f3b41cec585f8e48e660352a 100644 (file)
@@ -37,10 +37,12 @@ public:
 private:
     CPPUNIT_TEST_SUITE( ClientSizeTestCase );
         CPPUNIT_TEST( ClientToWindow );
+        CPPUNIT_TEST( ClientSizeNotNegative );
         CPPUNIT_TEST( WindowToClient );
     CPPUNIT_TEST_SUITE_END();
 
     void ClientToWindow();
+    void ClientSizeNotNegative();
     void WindowToClient();
 
     wxWindow *m_win;
@@ -51,7 +53,7 @@ private:
 // register in the unnamed registry so that these tests are run by default
 CPPUNIT_TEST_SUITE_REGISTRATION( ClientSizeTestCase );
 
-// 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( ClientSizeTestCase, "ClientSizeTestCase" );
 
 // ----------------------------------------------------------------------------
@@ -78,6 +80,18 @@ void ClientSizeTestCase::ClientToWindow()
                    m_win->ClientToWindowSize(m_win->GetClientSize()));
 }
 
+void ClientSizeTestCase::ClientSizeNotNegative()
+{
+    wxWindow* w = new wxWindow(wxTheApp->GetTopWindow(), -1,
+                               wxDefaultPosition, wxDefaultSize,
+                               wxBORDER_THEME);
+    w->SetSize(wxSize(1,1));
+    const wxSize szw = w->GetClientSize();
+    CPPUNIT_ASSERT(szw.GetWidth() >= 0);
+    CPPUNIT_ASSERT(szw.GetHeight() >= 0);
+    w->Destroy();
+}
+
 void ClientSizeTestCase::WindowToClient()
 {
     CPPUNIT_ASSERT(m_win->GetClientSize() ==