X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3778b4d9c7eebc39f496a9dd055638e06fb9140..4776f0c8c5cab0816974874140a3b429ae126fe0:/tests/controls/buttontest.cpp?ds=sidebyside diff --git a/tests/controls/buttontest.cpp b/tests/controls/buttontest.cpp index fbfb1b239d..bb7d684428 100644 --- a/tests/controls/buttontest.cpp +++ b/tests/controls/buttontest.cpp @@ -80,12 +80,9 @@ void ButtonTestCase::tearDown() void ButtonTestCase::Click() { - wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(), - wxTestableFrame); - //We use the internal class EventCounter which handles connecting and //disconnecting the control to the wxTestableFrame - EventCounter count(m_button, wxEVT_COMMAND_BUTTON_CLICKED); + EventCounter clicked(m_button, wxEVT_BUTTON); wxUIActionSimulator sim; @@ -97,15 +94,12 @@ void ButtonTestCase::Click() sim.MouseClick(); wxYield(); - CPPUNIT_ASSERT_EQUAL( 1, frame->GetEventCount() ); + CPPUNIT_ASSERT_EQUAL( 1, clicked.GetCount() ); } void ButtonTestCase::Disabled() { - wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(), - wxTestableFrame); - - EventCounter count(m_button, wxEVT_COMMAND_BUTTON_CLICKED); + EventCounter clicked(m_button, wxEVT_BUTTON); wxUIActionSimulator sim; @@ -118,7 +112,7 @@ void ButtonTestCase::Disabled() sim.MouseClick(); wxYield(); - CPPUNIT_ASSERT_EQUAL( 0, frame->GetEventCount() ); + CPPUNIT_ASSERT_EQUAL( 0, clicked.GetCount() ); } #endif // wxUSE_UIACTIONSIMULATOR