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:
@@ -18,13 +18,12 @@ public:
|
||||
|
||||
void OnEvent(wxEvent& evt);
|
||||
|
||||
//wxEVT_ANY get the count for all events or a type can be specified
|
||||
int GetEventCount(wxEventType type = wxEVT_ANY);
|
||||
private:
|
||||
friend class EventCounter;
|
||||
|
||||
//Used to clear an event count, after disconnecting a counter for example
|
||||
int GetEventCount(wxEventType type);
|
||||
void ClearEventCount(wxEventType type);
|
||||
|
||||
private:
|
||||
wxLongToLongHashMap m_count;
|
||||
};
|
||||
|
||||
@@ -34,6 +33,9 @@ public:
|
||||
EventCounter(wxWindow* win, wxEventType type);
|
||||
~EventCounter();
|
||||
|
||||
int GetCount() { return m_frame->GetEventCount(m_type); }
|
||||
void Clear() { m_frame->ClearEventCount(m_type); }
|
||||
|
||||
private:
|
||||
wxEventType m_type;
|
||||
wxTestableFrame* m_frame;
|
||||
|
Reference in New Issue
Block a user