Move getting the unit test event count from wxTestableFrame to the EventCounter class. This reduces the need to have wxTestableFrame pointers all over the unit testing code and should reduce bugs caused by counting the wrong events.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -62,26 +62,20 @@ void FrameTestCase::tearDown()
|
||||
void FrameTestCase::Iconize()
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
wxTestableFrame* testframe = wxStaticCast(wxTheApp->GetTopWindow(),
|
||||
wxTestableFrame);
|
||||
|
||||
EventCounter count(m_frame, wxEVT_ICONIZE);
|
||||
EventCounter iconize(m_frame, wxEVT_ICONIZE);
|
||||
|
||||
m_frame->Iconize();
|
||||
m_frame->Iconize(false);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(2, testframe->GetEventCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2, iconize.GetCount());
|
||||
#endif
|
||||
}
|
||||
|
||||
void FrameTestCase::Close()
|
||||
{
|
||||
wxTestableFrame* testframe = wxStaticCast(wxTheApp->GetTopWindow(),
|
||||
wxTestableFrame);
|
||||
|
||||
EventCounter count(m_frame, wxEVT_CLOSE_WINDOW);
|
||||
EventCounter close(m_frame, wxEVT_CLOSE_WINDOW);
|
||||
|
||||
m_frame->Close();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1, testframe->GetEventCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1, close.GetCount());
|
||||
}
|
||||
|
Reference in New Issue
Block a user