X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3778b4d9c7eebc39f496a9dd055638e06fb9140..3287f62ad3bd6dfcc78a8fcef0ac44d9ece904af:/tests/window/clientsize.cpp diff --git a/tests/window/clientsize.cpp b/tests/window/clientsize.cpp index 1b075fa1f6..172bcd2597 100644 --- a/tests/window/clientsize.cpp +++ b/tests/window/clientsize.cpp @@ -3,7 +3,6 @@ // Purpose: Client vs. window size handling unit test // Author: Vaclav Slavik // Created: 2008-02-12 -// RCS-ID: $Id$ // Copyright: (c) 2008 Vaclav Slavik /////////////////////////////////////////////////////////////////////////////// @@ -37,10 +36,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; @@ -78,6 +79,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() ==