X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/232fdc630c42eb165f7659981043e794be03b3b7..5dec941a5ba3c08870ab4b415dd6e5be368fa0f0:/tests/testableframe.cpp diff --git a/tests/testableframe.cpp b/tests/testableframe.cpp index efa7396f26..9617cfde09 100644 --- a/tests/testableframe.cpp +++ b/tests/testableframe.cpp @@ -2,9 +2,9 @@ // Name: testableframe.cpp // Purpose: An improved wxFrame for unit-testing // Author: Steven Lamerton -// RCS-ID: $Id:$ +// RCS-ID: $Id$ // Copyright: (c) 2010 Steven Lamerton -// Licence: wxWidgets licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx/wx.h". @@ -54,6 +54,11 @@ int wxTestableFrame::GetEventCount(wxEventType type) } } +void wxTestableFrame::ClearEventCount(wxEventType type) +{ + m_count[type] = 0; +} + EventCounter::EventCounter(wxWindow* win, wxEventType type) : m_type(type), m_win(win) @@ -74,6 +79,9 @@ EventCounter::~EventCounter() NULL, m_frame); + //This stops spurious counts from previous tests + m_frame->ClearEventCount(m_type); + m_frame = NULL; m_win = NULL; }