OpenCoverage

qcore_unix.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/kernel/qcore_unix.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15static inline bool time_update(struct timespec *tv, const struct timespec &start,-
16 const struct timespec &timeout)-
17{-
18-
19-
20 struct timespec now = qt_gettime();-
21 *tv = timeout + start - now;-
22 return
executed 2108 times by 24 tests: return tv->tv_sec >= 0;
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
tv->tv_sec >= 0;
executed 2108 times by 24 tests: return tv->tv_sec >= 0;
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
2108
23}-
24-
25-
26static inline int timespecToMillisecs(const struct timespec *ts)-
27{-
28 return
executed 324551 times by 56 tests: return (ts == __null) ? -1 : (ts->tv_sec * 1000) + (ts->tv_nsec / 1000000);
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • ...
(ts == __null) ? -1 :
executed 324551 times by 56 tests: return (ts == __null) ? -1 : (ts->tv_sec * 1000) + (ts->tv_nsec / 1000000);
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • ...
324551
29 (ts->tv_sec * 1000) + (ts->tv_nsec / 1000000);
executed 324551 times by 56 tests: return (ts == __null) ? -1 : (ts->tv_sec * 1000) + (ts->tv_nsec / 1000000);
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • ...
324551
30}-
31-
32-
33-
34int qt_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts);-
35-
36static inline int qt_ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts)-
37{-
38-
39-
40-
41 return
executed 324551 times by 56 tests: return ::poll(fds, nfds, timespecToMillisecs(timeout_ts));
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • ...
::poll(fds, nfds, timespecToMillisecs(timeout_ts));
executed 324551 times by 56 tests: return ::poll(fds, nfds, timespecToMillisecs(timeout_ts));
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • ...
324551
42-
43-
44-
45}-
46int qt_safe_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts)-
47{-
48 if (!timeout_ts
!timeout_tsDescription
TRUEevaluated 765 times by 13 tests
Evaluated by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
  • tst_QXmlSimpleReader
  • tst_qmake
  • tst_qmakelib
FALSEevaluated 321646 times by 52 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • ...
) {
765-321646
49-
50 int ret;-
51 do { ret = qt_ppoll(fds, nfds, nullptr); }
executed 797 times by 13 tests: end of block
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
  • tst_QXmlSimpleReader
  • tst_qmake
  • tst_qmakelib
while (ret == -1
ret == -1Description
TRUEevaluated 32 times by 3 tests
Evaluated by:
  • tst_QProcess
  • tst_qmake
  • tst_qmakelib
FALSEevaluated 765 times by 13 tests
Evaluated by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
  • tst_QXmlSimpleReader
  • tst_qmake
  • tst_qmakelib
&& (*
(*__errno_location ()) == 4Description
TRUEevaluated 32 times by 3 tests
Evaluated by:
  • tst_QProcess
  • tst_qmake
  • tst_qmakelib
FALSEnever evaluated
__errno_location ()) == 4
(*__errno_location ()) == 4Description
TRUEevaluated 32 times by 3 tests
Evaluated by:
  • tst_QProcess
  • tst_qmake
  • tst_qmakelib
FALSEnever evaluated
);
0-797
52 return
executed 765 times by 13 tests: return ret;
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
  • tst_QXmlSimpleReader
  • tst_qmake
  • tst_qmakelib
ret;
executed 765 times by 13 tests: return ret;
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
  • tst_QXmlSimpleReader
  • tst_qmake
  • tst_qmakelib
765
53 }-
54-
55 timespec start = qt_gettime();-
56 timespec timeout = *timeout_ts;-
57-
58-
59 for(;;) {-
60 const int ret = qt_ppoll(fds, nfds, &timeout);-
61 if (ret != -1
ret != -1Description
TRUEevaluated 321646 times by 53 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • ...
FALSEevaluated 2108 times by 24 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
|| (*
(*__errno_location ()) != 4Description
TRUEnever evaluated
FALSEevaluated 2108 times by 24 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
__errno_location ()) != 4
(*__errno_location ()) != 4Description
TRUEnever evaluated
FALSEevaluated 2108 times by 24 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
)
0-321646
62 return
executed 321646 times by 53 tests: return ret;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • ...
ret;
executed 321646 times by 53 tests: return ret;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • ...
321646
63-
64-
65 if (!time_update(&timeout, start, *timeout_ts)
!time_update(&..., *timeout_ts)Description
TRUEnever evaluated
FALSEevaluated 2108 times by 24 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
) {
0-2108
66-
67-
68 return
never executed: return 0;
0;
never executed: return 0;
0
69 }-
70 }
executed 2108 times by 24 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
2108
71}
never executed: end of block
0
72-
73-
Switch to Source codePreprocessed file

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