X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/232fdc630c42eb165f7659981043e794be03b3b7..f321d0bc0caf4d78ccc5426e926fc25c46297439:/tests/controls/togglebuttontest.cpp diff --git a/tests/controls/togglebuttontest.cpp b/tests/controls/togglebuttontest.cpp index 9d41429465..295627e810 100644 --- a/tests/controls/togglebuttontest.cpp +++ b/tests/controls/togglebuttontest.cpp @@ -48,7 +48,7 @@ private: // register in the unnamed registry so that these tests are run by default CPPUNIT_TEST_SUITE_REGISTRATION( ToggleButtonTestCase ); -// 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( ToggleButtonTestCase, "ToggleButtonTestCase" ); void ToggleButtonTestCase::setUp() @@ -64,10 +64,7 @@ void ToggleButtonTestCase::tearDown() void ToggleButtonTestCase::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; @@ -78,23 +75,21 @@ void ToggleButtonTestCase::Click() sim.MouseClick(); wxYield(); - CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount()); + CPPUNIT_ASSERT_EQUAL(1, clicked.GetCount()); CPPUNIT_ASSERT(m_button->GetValue()); + clicked.Clear(); sim.MouseClick(); wxYield(); - CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount()); + CPPUNIT_ASSERT_EQUAL(1, clicked.GetCount()); CPPUNIT_ASSERT(!m_button->GetValue()); #endif } void ToggleButtonTestCase::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); @@ -104,7 +99,7 @@ void ToggleButtonTestCase::Value() CPPUNIT_ASSERT(!m_button->GetValue()); - CPPUNIT_ASSERT_EQUAL( 0, frame->GetEventCount() ); + CPPUNIT_ASSERT_EQUAL( 0, clicked.GetCount() ); } #endif //wxUSE_TOGGLEBTN