X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/232fdc630c42eb165f7659981043e794be03b3b7..e86aa7a62cc8be79ffaeb0d07b70161cb9ea2c74:/tests/controls/frametest.cpp diff --git a/tests/controls/frametest.cpp b/tests/controls/frametest.cpp index 0cce6e3040..449c411142 100644 --- a/tests/controls/frametest.cpp +++ b/tests/controls/frametest.cpp @@ -45,7 +45,7 @@ private: // register in the unnamed registry so that these tests are run by default CPPUNIT_TEST_SUITE_REGISTRATION( FrameTestCase ); -// 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( FrameTestCase, "FrameTestCase" ); void FrameTestCase::setUp() @@ -56,32 +56,26 @@ void FrameTestCase::setUp() void FrameTestCase::tearDown() { - wxDELETE(m_frame); + m_frame->Destroy(); } void FrameTestCase::Iconize() { #ifdef __WXMSW__ - wxTestableFrame* testframe = wxStaticCast(wxTheApp->GetTopWindow(), - wxTestableFrame); - - EventCounter count(m_frame, wxEVT_ICONIZE); + EventCounter iconize(m_frame, wxEVT_ICONIZE); m_frame->Iconize(); m_frame->Iconize(false); - CPPUNIT_ASSERT_EQUAL(2, testframe->GetEventCount()); + CPPUNIT_ASSERT_EQUAL(2, iconize.GetCount()); #endif } void FrameTestCase::Close() { - wxTestableFrame* testframe = wxStaticCast(wxTheApp->GetTopWindow(), - wxTestableFrame); - - EventCounter count(m_frame, wxEVT_CLOSE_WINDOW); + EventCounter close(m_frame, wxEVT_CLOSE_WINDOW); m_frame->Close(); - CPPUNIT_ASSERT_EQUAL(1, testframe->GetEventCount()); + CPPUNIT_ASSERT_EQUAL(1, close.GetCount()); }