X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3778b4d9c7eebc39f496a9dd055638e06fb9140..f321d0bc0caf4d78ccc5426e926fc25c46297439:/tests/controls/bitmaptogglebuttontest.cpp?ds=inline diff --git a/tests/controls/bitmaptogglebuttontest.cpp b/tests/controls/bitmaptogglebuttontest.cpp index 2ff0d8d0c9..25783069ad 100644 --- a/tests/controls/bitmaptogglebuttontest.cpp +++ b/tests/controls/bitmaptogglebuttontest.cpp @@ -74,10 +74,7 @@ void BitmapToggleButtonTestCase::tearDown() void BitmapToggleButtonTestCase::Click() { #if wxUSE_UIACTIONSIMULATOR - wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(), - wxTestableFrame); - - EventCounter count(m_button, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED); + EventCounter clicked(m_button, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED); wxUIActionSimulator sim; @@ -88,25 +85,23 @@ void BitmapToggleButtonTestCase::Click() sim.MouseClick(); wxYield(); - CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount()); + CPPUNIT_ASSERT_EQUAL(1, clicked.GetCount()); CPPUNIT_ASSERT(m_button->GetValue()); + clicked.Clear(); wxMilliSleep(1000); sim.MouseClick(); wxYield(); - CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount()); + CPPUNIT_ASSERT_EQUAL(1, clicked.GetCount()); CPPUNIT_ASSERT(!m_button->GetValue()); #endif // wxUSE_UIACTIONSIMULATOR } void BitmapToggleButtonTestCase::Value() { - wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(), - wxTestableFrame); - - EventCounter count(m_button, wxEVT_COMMAND_BUTTON_CLICKED); + EventCounter clicked(m_button, wxEVT_COMMAND_BUTTON_CLICKED); m_button->SetValue(true); @@ -116,7 +111,7 @@ void BitmapToggleButtonTestCase::Value() CPPUNIT_ASSERT(!m_button->GetValue()); - CPPUNIT_ASSERT_EQUAL( 0, frame->GetEventCount() ); + CPPUNIT_ASSERT_EQUAL( 0, clicked.GetCount() ); } #endif // wxHAS_BITMAPTOGGLEBUTTON