]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/controls/frametest.cpp
Add test for absence of events from wxSpinCtrlDouble ctor.
[wxWidgets.git] / tests / controls / frametest.cpp
index dcdb22acc1ff959785b2c69a5bce6e6f23cbf5b2..f1d28a3a724333bc815527e31e6fa46d4c0c6461 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     wxFrame  unit test
 // Author:      Steven Lamerton
 // Created:     2010-07-10
-// RCS-ID:      $Id$
 // Copyright:   (c) 2010 Steven Lamerton
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -56,32 +55,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());
 }