qeventloop.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/kernel/qeventloop.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QEventLoop::QEventLoop(QObject *parent)-
6 : QObject(*new QEventLoopPrivate, parent)-
7{-
8 QEventLoopPrivate * const d = d_func();-
9 if (!QCoreApplication::instance()
!QCoreApplication::instance()Description
TRUEevaluated 3 times by 3 tests
Evaluated by:
  • tst_QCoreApplication
  • tst_QDBusConnection_NoApplication
  • tst_QGuiApplication
FALSEevaluated 3964 times by 186 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • ...
&& QCoreApplicationPrivate::threadRequiresCoreApplication()
QCoreApplicati...eApplication()Description
TRUEnever evaluated
FALSEevaluated 3 times by 3 tests
Evaluated by:
  • tst_QCoreApplication
  • tst_QDBusConnection_NoApplication
  • tst_QGuiApplication
) {
0-3964
10 QMessageLogger(__FILE__, 103, __PRETTY_FUNCTION__).warning("QEventLoop: Cannot be used without QApplication");-
11 }
never executed: end of block
else if (!d->threadData->eventDispatcher.load()
!d->threadData...patcher.load()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QThread
FALSEevaluated 3965 times by 187 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • ...
) {
0-3965
12 QThreadPrivate::createEventDispatcher(d->threadData);-
13 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QThread
2
14}
executed 3967 times by 187 tests: end of block
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • ...
3967
15-
16-
17-
18-
19QEventLoop::~QEventLoop()-
20{ }-
21bool QEventLoop::processEvents(ProcessEventsFlags flags)-
22{-
23 QEventLoopPrivate * const d = d_func();-
24 if (!d->threadData->eventDispatcher.load()
!d->threadData...patcher.load()Description
TRUEnever evaluated
FALSEevaluated 220669 times by 339 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • ...
)
0-220669
25 return
never executed: return false;
false;
never executed: return false;
0
26 return
executed 220669 times by 339 tests: return d->threadData->eventDispatcher.load()->processEvents(flags);
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • ...
d->threadData->eventDispatcher.load()->processEvents(flags);
executed 220669 times by 339 tests: return d->threadData->eventDispatcher.load()->processEvents(flags);
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • ...
220669
27}-
28int QEventLoop::exec(ProcessEventsFlags flags)-
29{-
30 QEventLoopPrivate * const d = d_func();-
31-
32 QMutexLocker locker(&static_cast<QThreadPrivate *>(QObjectPrivate::get(d->threadData->thread))->mutex);-
33 if (d->threadData->quitNow
d->threadData->quitNowDescription
TRUEevaluated 7 times by 3 tests
Evaluated by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
  • tst_QThread
FALSEevaluated 4037 times by 187 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • ...
)
7-4037
34 return
executed 7 times by 3 tests: return -1;
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
  • tst_QThread
-1;
executed 7 times by 3 tests: return -1;
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
  • tst_QThread
7
35-
36 if (d->inExec
d->inExecDescription
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
FALSEevaluated 4035 times by 187 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • ...
) {
2-4035
37 QMessageLogger(__FILE__, 169, __PRETTY_FUNCTION__).warning("QEventLoop::exec: instance %p has already called exec()", this);-
38 return
executed 2 times by 2 tests: return -1;
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
-1;
executed 2 times by 2 tests: return -1;
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
2
39 }-
40-
41 struct LoopReference {-
42 QEventLoopPrivate *d;-
43 QMutexLocker &locker;-
44-
45 bool exceptionCaught;-
46 LoopReference(QEventLoopPrivate *d, QMutexLocker &locker) : d(d), locker(locker), exceptionCaught(true)-
47 {-
48 d->inExec = true;-
49 d->exit.storeRelease(false);-
50 ++d->threadData->loopLevel;-
51 d->threadData->eventLoops.push(d->q_func());-
52 locker.unlock();-
53 }
executed 4035 times by 187 tests: end of block
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • ...
4035
54-
55 ~LoopReference()-
56 {-
57 if (exceptionCaught
exceptionCaughtDescription
TRUEnever evaluated
FALSEevaluated 4039 times by 239 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QApplication
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_Delayed
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDBusPendingCall
  • tst_QDBusServiceWatcher
  • tst_QDBusThreading
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • ...
) {
0-4039
58 QMessageLogger(__FILE__, 190, __PRETTY_FUNCTION__).warning("Qt has caught an exception thrown from an event handler. Throwing\n"-
59 "exceptions from an event handler is not supported in Qt.\n"-
60 "You must not let any exception whatsoever propagate through Qt code.\n"-
61 "If that is not possible, in Qt 5 you must at least reimplement\n"-
62 "QCoreApplication::notify() and catch all exceptions there.\n");-
63 }
never executed: end of block
0
64 locker.relock();-
65 QEventLoop *eventLoop = d->threadData->eventLoops.pop();-
66 ((!(eventLoop == d->q_func())) ? qt_assert_x("QEventLoop::exec()", "internal error",__FILE__,198) : qt_noop());-
67 (void)eventLoop;;-
68 d->inExec = false;-
69 --d->threadData->loopLevel;-
70 }
executed 4039 times by 239 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QApplication
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_Delayed
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDBusPendingCall
  • tst_QDBusServiceWatcher
  • tst_QDBusThreading
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • ...
4039
71 };-
72 LoopReference ref(d, locker);-
73-
74-
75 QCoreApplication *app = QCoreApplication::instance();-
76 if (app
appDescription
TRUEevaluated 4032 times by 186 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • ...
FALSEevaluated 3 times by 3 tests
Evaluated by:
  • tst_QCoreApplication
  • tst_QDBusConnection_NoApplication
  • tst_QGuiApplication
&& app->thread() == thread()
app->thread() == thread()Description
TRUEevaluated 3007 times by 77 tests
Evaluated by:
  • tst_QAbstractScrollArea
  • tst_QApplication
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_Delayed
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDBusPendingCall
  • tst_QDBusServiceWatcher
  • tst_QDBusThreading
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontDialog
  • ...
FALSEevaluated 1025 times by 173 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • ...
)
3-4032
77 QCoreApplication::removePostedEvents(app, QEvent::Quit);
executed 3007 times by 77 tests: QCoreApplication::removePostedEvents(app, QEvent::Quit);
Executed by:
  • tst_QAbstractScrollArea
  • tst_QApplication
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_Delayed
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDBusPendingCall
  • tst_QDBusServiceWatcher
  • tst_QDBusThreading
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontDialog
  • ...
3007
78-
79 while (!d->exit.loadAcquire()
!d->exit.loadAcquire()Description
TRUEevaluated 220057 times by 339 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • ...
FALSEevaluated 4039 times by 239 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QApplication
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_Delayed
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDBusPendingCall
  • tst_QDBusServiceWatcher
  • tst_QDBusThreading
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • ...
)
4039-220057
80 processEvents(flags | WaitForMoreEvents | EventLoopExec);
executed 220057 times by 339 tests: processEvents(flags | WaitForMoreEvents | EventLoopExec);
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • ...
220057
81-
82 ref.exceptionCaught = false;-
83 return
executed 4039 times by 239 tests: return d->returnCode.load();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QApplication
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_Delayed
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDBusPendingCall
  • tst_QDBusServiceWatcher
  • tst_QDBusThreading
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • ...
d->returnCode.load();
executed 4039 times by 239 tests: return d->returnCode.load();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QApplication
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_Delayed
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDBusPendingCall
  • tst_QDBusServiceWatcher
  • tst_QDBusThreading
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • ...
4039
84}-
85void QEventLoop::processEvents(ProcessEventsFlags flags, int maxTime)-
86{-
87 QEventLoopPrivate * const d = d_func();-
88 if (!d->threadData->eventDispatcher.load()
!d->threadData...patcher.load()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
89 return;
never executed: return;
0
90-
91 QElapsedTimer start;-
92 start.start();-
93 while (processEvents(flags & ~WaitForMoreEvents)
processEvents(...ForMoreEvents)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
94 if (start.elapsed() > maxTime
start.elapsed() > maxTimeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
95 break;
never executed: break;
0
96 }
never executed: end of block
0
97}
never executed: end of block
0
98void QEventLoop::exit(int returnCode)-
99{-
100 QEventLoopPrivate * const d = d_func();-
101 if (!d->threadData->eventDispatcher.load()
!d->threadData...patcher.load()Description
TRUEnever evaluated
FALSEevaluated 4387 times by 239 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QApplication
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_Delayed
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDBusPendingCall
  • tst_QDBusServiceWatcher
  • tst_QDBusThreading
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • ...
)
0-4387
102 return;
never executed: return;
0
103-
104 d->returnCode.store(returnCode);-
105 d->exit.storeRelease(true);-
106 d->threadData->eventDispatcher.load()->interrupt();-
107}
executed 4387 times by 239 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QApplication
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_Delayed
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDBusPendingCall
  • tst_QDBusServiceWatcher
  • tst_QDBusThreading
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • ...
4387
108bool QEventLoop::isRunning() const-
109{-
110 const QEventLoopPrivate * const d = d_func();-
111 return
executed 8 times by 1 test: return !d->exit.loadAcquire();
Executed by:
  • tst_QGraphicsView
!d->exit.loadAcquire();
executed 8 times by 1 test: return !d->exit.loadAcquire();
Executed by:
  • tst_QGraphicsView
8
112}-
113-
114-
115-
116-
117-
118-
119void QEventLoop::wakeUp()-
120{-
121 QEventLoopPrivate * const d = d_func();-
122 if (!d->threadData->eventDispatcher.load()
!d->threadData...patcher.load()Description
TRUEnever evaluated
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
)
0-2
123 return;
never executed: return;
0
124 d->threadData->eventDispatcher.load()->wakeUp();-
125}
executed 2 times by 2 tests: end of block
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
2
126-
127-
128-
129-
130-
131bool QEventLoop::event(QEvent *event)-
132{-
133 if (event->type() == QEvent::Quit
event->type() == QEvent::QuitDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
FALSEevaluated 342 times by 14 tests
Evaluated by:
  • tst_QApplication
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QEventLoop
  • tst_QGuiApplication
  • tst_QGuiEventLoop
  • tst_QNetworkReply
  • tst_QObject
  • tst_QProcess
  • tst_QThread
  • tst_QTimer
) {
4-342
134 quit();-
135 return
executed 4 times by 2 tests: return true;
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
true;
executed 4 times by 2 tests: return true;
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
4
136 } else {-
137 return
executed 342 times by 14 tests: return QObject::event(event);
Executed by:
  • tst_QApplication
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QEventLoop
  • tst_QGuiApplication
  • tst_QGuiEventLoop
  • tst_QNetworkReply
  • tst_QObject
  • tst_QProcess
  • tst_QThread
  • tst_QTimer
QObject::event(event);
executed 342 times by 14 tests: return QObject::event(event);
Executed by:
  • tst_QApplication
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QEventLoop
  • tst_QGuiApplication
  • tst_QGuiEventLoop
  • tst_QNetworkReply
  • tst_QObject
  • tst_QProcess
  • tst_QThread
  • tst_QTimer
342
138 }-
139}-
140void QEventLoop::quit()-
141{ exit(0);
executed 646 times by 27 tests: exit(0);
Executed by:
  • tst_QApplication
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusMarshall
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFtp
  • tst_QGraphicsView
  • tst_QGuiApplication
  • tst_QGuiEventLoop
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QObject
  • tst_QProcess
  • tst_QProgressBar
  • tst_QSslSocket
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QThread
  • tst_QTimeLine
  • tst_QTimer
  • tst_QWidget
  • ...
}
646
142-
143-
144class QEventLoopLockerPrivate-
145{-
146public:-
147 explicit QEventLoopLockerPrivate(QEventLoopPrivate *loop)-
148 : loop(loop), type(EventLoop)-
149 {-
150 loop->ref();-
151 }
executed 22 times by 2 tests: end of block
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
22
152-
153 explicit QEventLoopLockerPrivate(QThreadPrivate *thread)-
154 : thread(thread), type(Thread)-
155 {-
156 thread->ref();-
157 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QThread
2
158-
159 explicit QEventLoopLockerPrivate(QCoreApplicationPrivate *app)-
160 : app(app), type(Application)-
161 {-
162 app->ref();-
163 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_QCoreApplication
  • tst_QGuiApplication
12
164-
165 ~QEventLoopLockerPrivate()-
166 {-
167 switch (type)-
168 {-
169 case
executed 22 times by 2 tests: case EventLoop:
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
EventLoop:
executed 22 times by 2 tests: case EventLoop:
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
22
170 loop->deref();-
171 break;
executed 22 times by 2 tests: break;
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
22
172 case
executed 1 time by 1 test: case Thread:
Executed by:
  • tst_QThread
Thread:
executed 1 time by 1 test: case Thread:
Executed by:
  • tst_QThread
1
173 thread->deref();-
174 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QThread
1
175 default
executed 12 times by 2 tests: default:
Executed by:
  • tst_QCoreApplication
  • tst_QGuiApplication
:
executed 12 times by 2 tests: default:
Executed by:
  • tst_QCoreApplication
  • tst_QGuiApplication
12
176 app->deref();-
177 break;
executed 12 times by 2 tests: break;
Executed by:
  • tst_QCoreApplication
  • tst_QGuiApplication
12
178 }-
179 }-
180-
181private:-
182 union {-
183 QEventLoopPrivate * loop;-
184 QThreadPrivate * thread;-
185 QCoreApplicationPrivate * app;-
186 };-
187 enum Type {-
188 EventLoop,-
189 Thread,-
190 Application-
191 };-
192 const Type type;-
193};-
194QEventLoopLocker::QEventLoopLocker()-
195 : d_ptr(new QEventLoopLockerPrivate(static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(QCoreApplication::instance()))))-
196{-
197-
198}
executed 12 times by 2 tests: end of block
Executed by:
  • tst_QCoreApplication
  • tst_QGuiApplication
12
199QEventLoopLocker::QEventLoopLocker(QEventLoop *loop)-
200 : d_ptr(new QEventLoopLockerPrivate(static_cast<QEventLoopPrivate*>(QObjectPrivate::get(loop))))-
201{-
202-
203}
executed 22 times by 2 tests: end of block
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
22
204QEventLoopLocker::QEventLoopLocker(QThread *thread)-
205 : d_ptr(new QEventLoopLockerPrivate(static_cast<QThreadPrivate*>(QObjectPrivate::get(thread))))-
206{-
207-
208}
executed 2 times by 1 test: end of block
Executed by:
  • tst_QThread
2
209-
210-
211-
212-
213QEventLoopLocker::~QEventLoopLocker()-
214{-
215 delete d_ptr;-
216}
executed 35 times by 5 tests: end of block
Executed by:
  • tst_QCoreApplication
  • tst_QEventLoop
  • tst_QGuiApplication
  • tst_QGuiEventLoop
  • tst_QThread
35
217-
218-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9