+#define WX_ASSERT_EVENT_OCCURS(eventcounter, count) \
+{\
+ wxStopWatch sw; \
+ wxEventLoopBase* loop = wxEventLoopBase::GetActive(); \
+ while(eventcounter.GetCount() < count) \
+ { \
+ if(sw.Time() < 100) \
+ loop->Dispatch(); \
+ else \
+ { \
+ CPPUNIT_FAIL(wxString::Format("timeout reached with %d " \
+ "events received, %d expected", \
+ eventcounter.GetCount(), count).ToStdString()); \
+ break; \
+ } \
+ } \
+ eventcounter.Clear(); \
+}
+