X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d377e9fe754e638f326a6885d7907910c77019e0..8f96683438e5b588caafecc442bba6a2da801e17:/tests/controls/buttontest.cpp?ds=sidebyside diff --git a/tests/controls/buttontest.cpp b/tests/controls/buttontest.cpp index 64247d03f3..249fa67464 100644 --- a/tests/controls/buttontest.cpp +++ b/tests/controls/buttontest.cpp @@ -3,7 +3,6 @@ // Purpose: wxButton unit test // Author: Steven Lamerton // Created: 2010-06-21 -// RCS-ID: $Id$ // Copyright: (c) 2010 Steven Lamerton /////////////////////////////////////////////////////////////////////////////// @@ -61,7 +60,7 @@ private: // register in the unnamed registry so that these tests are run by default CPPUNIT_TEST_SUITE_REGISTRATION( ButtonTestCase ); -// 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( ButtonTestCase, "ButtonTestCase" ); void ButtonTestCase::setUp() @@ -80,12 +79,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 +93,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 +111,7 @@ void ButtonTestCase::Disabled() sim.MouseClick(); wxYield(); - CPPUNIT_ASSERT_EQUAL( 0, frame->GetEventCount() ); + CPPUNIT_ASSERT_EQUAL( 0, clicked.GetCount() ); } #endif // wxUSE_UIACTIONSIMULATOR @@ -147,7 +140,7 @@ void ButtonTestCase::Auth() void ButtonTestCase::BitmapMargins() { - //Some functions only work on specific platfroms in which case we can use + //Some functions only work on specific platforms in which case we can use //a preprocessor check #ifdef __WXMSW__ //We must set a bitmap before we can set its margins, when writing unit