X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/232fdc630c42eb165f7659981043e794be03b3b7..e86aa7a62cc8be79ffaeb0d07b70161cb9ea2c74:/tests/controls/togglebuttontest.cpp?ds=sidebyside diff --git a/tests/controls/togglebuttontest.cpp b/tests/controls/togglebuttontest.cpp index 9d41429465..054b7c6574 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_TOGGLEBUTTON); 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_BUTTON); 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