diff options
-rw-r--r-- | tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp b/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp index a3732f2d95..2fff160ceb 100644 --- a/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp +++ b/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp @@ -65,6 +65,8 @@ public: private slots: void initTestCase(); + void cleanup(); + void registerTimer(); /* void registerSocketNotifier(); */ // Not implemented here, see tst_QSocketNotifier instead @@ -111,6 +113,12 @@ void tst_QEventDispatcher::initTestCase() } } +// consume pending posted events to avoid impact on the next test function +void tst_QEventDispatcher::cleanup() +{ + eventDispatcher->processEvents(QEventLoop::AllEvents); +} + class TimerManager { Q_DISABLE_COPY(TimerManager) |