OpenCoverage

qfsfileengine_unix.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qfsfileengine_unix.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtCore module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qplatformdefs.h"-
41#include "private/qabstractfileengine_p.h"-
42#include "private/qfsfileengine_p.h"-
43#include "private/qcore_unix_p.h"-
44#include "qfilesystementry_p.h"-
45#include "qfilesystemengine_p.h"-
46#include "qcoreapplication.h"-
47-
48#ifndef QT_NO_FSFILEENGINE-
49-
50#include "qfile.h"-
51#include "qdir.h"-
52#include "qdatetime.h"-
53#include "qvarlengtharray.h"-
54-
55#include <sys/mman.h>-
56#include <stdlib.h>-
57#include <limits.h>-
58#include <errno.h>-
59#if !defined(QWS) && defined(Q_OS_MAC)-
60# include <private/qcore_mac_p.h>-
61#endif-
62-
63QT_BEGIN_NAMESPACE-
64-
65/*!-
66 \internal-
67-
68 Returns the stdlib open string corresponding to a QIODevice::OpenMode.-
69*/-
70static inline QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QFileSystemEntry &fileEntry,-
71 QFileSystemMetaData &metaData)-
72{-
73 QByteArray mode;-
74 if ((flags & QIODevice::ReadOnly) && !(flags & QIODevice::Truncate)) {
(flags & QIODevice::ReadOnly)Description
TRUEnever evaluated
FALSEnever evaluated
!(flags & QIODevice::Truncate)Description
TRUEnever evaluated
FALSEnever evaluated
0
75 mode = "rb";-
76 if (flags & QIODevice::WriteOnly) {
flags & QIODevice::WriteOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
0
77 metaData.clearFlags(QFileSystemMetaData::FileType);-
78 if (!fileEntry.isEmpty()
!fileEntry.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
79 && QFileSystemEngine::fillMetaData(fileEntry, metaData, QFileSystemMetaData::FileType)
QFileSystemEng...ata::FileType)Description
TRUEnever evaluated
FALSEnever evaluated
0
80 && metaData.isFile()) {
metaData.isFile()Description
TRUEnever evaluated
FALSEnever evaluated
0
81 mode += '+';-
82 } else {
never executed: end of block
0
83 mode = "wb+";-
84 }
never executed: end of block
0
85 }-
86 } else if (flags & QIODevice::WriteOnly) {
never executed: end of block
flags & QIODevice::WriteOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
0
87 mode = "wb";-
88 if (flags & QIODevice::ReadOnly)
flags & QIODevice::ReadOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
0
89 mode += '+';
never executed: mode += '+';
0
90 }
never executed: end of block
0
91 if (flags & QIODevice::Append) {
flags & QIODevice::AppendDescription
TRUEnever evaluated
FALSEnever evaluated
0
92 mode = "ab";-
93 if (flags & QIODevice::ReadOnly)
flags & QIODevice::ReadOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
0
94 mode += '+';
never executed: mode += '+';
0
95 }
never executed: end of block
0
96-
97#if defined(__GLIBC__) && (__GLIBC__ * 0x100 + __GLIBC_MINOR__) >= 0x0207-
98 // must be glibc >= 2.7-
99 mode += 'e';-
100#endif-
101-
102 return mode;
never executed: return mode;
0
103}-
104-
105/*!-
106 \internal-
107-
108 Returns the stdio open flags corresponding to a QIODevice::OpenMode.-
109*/-
110static inline int openModeToOpenFlags(QIODevice::OpenMode mode)-
111{-
112 int oflags = QT_OPEN_RDONLY;-
113#ifdef QT_LARGEFILE_SUPPORT-
114 oflags |= QT_OPEN_LARGEFILE;-
115#endif-
116-
117 if ((mode & QFile::ReadWrite) == QFile::ReadWrite) {
(mode & QFile:...ile::ReadWriteDescription
TRUEevaluated 635 times by 17 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QColorDialog
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QNetworkDiskCache
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_QTextStream
  • tst_languageChange
FALSEevaluated 31782 times by 185 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • ...
635-31782
118 oflags = QT_OPEN_RDWR | QT_OPEN_CREAT;-
119 } else if (mode & QFile::WriteOnly) {
executed 635 times by 17 tests: end of block
Executed by:
  • tst_QAbstractFileEngine
  • tst_QColorDialog
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QNetworkDiskCache
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_QTextStream
  • tst_languageChange
mode & QFile::WriteOnlyDescription
TRUEevaluated 1785 times by 38 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QIcon
  • tst_QImage
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QPainterPath
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QSaveFile
  • tst_QSettings
  • ...
FALSEevaluated 29997 times by 181 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • ...
635-29997
120 oflags = QT_OPEN_WRONLY | QT_OPEN_CREAT;-
121 }
executed 1785 times by 38 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QIcon
  • tst_QImage
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QPainterPath
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QSaveFile
  • tst_QSettings
  • ...
1785
122-
123 if (mode & QFile::Append) {
mode & QFile::AppendDescription
TRUEevaluated 257 times by 6 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_qfileopenevent
  • tst_qmakelib
FALSEevaluated 32160 times by 185 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • ...
257-32160
124 oflags |= QT_OPEN_APPEND;-
125 } else if (mode & QFile::WriteOnly) {
executed 257 times by 6 tests: end of block
Executed by:
  • tst_QAbstractFileEngine
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_qfileopenevent
  • tst_qmakelib
mode & QFile::WriteOnlyDescription
TRUEevaluated 2163 times by 43 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QPainterPath
  • ...
FALSEevaluated 29997 times by 181 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • ...
257-29997
126 if ((mode & QFile::Truncate) || !(mode & QFile::ReadOnly))
!(mode & QFile::ReadOnly)Description
TRUEnever evaluated
FALSEevaluated 627 times by 17 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QColorDialog
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QNetworkDiskCache
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_QTextStream
  • tst_languageChange
0-627
127 oflags |= QT_OPEN_TRUNC;
executed 1536 times by 39 tests: oflags |= 01000;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QIcon
  • tst_QImage
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QPainterPath
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QSaveFile
  • ...
1536
128 }
executed 2163 times by 43 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QPainterPath
  • ...
2163
129-
130 return oflags;
executed 32417 times by 185 tests: return oflags;
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • ...
32417
131}-
132-
133/*!-
134 \internal-
135-
136 Sets the file descriptor to close on exec. That is, the file-
137 descriptor is not inherited by child processes.-
138*/-
139static inline bool setCloseOnExec(int fd)-
140{-
141 return fd != -1 && fcntl(fd, F_SETFD, FD_CLOEXEC) != -1;
never executed: return fd != -1 && fcntl(fd, 2, 1) != -1;
0
142}-
143-
144static inline QString msgOpenDirectory()-
145{-
146 const char message[] = QT_TRANSLATE_NOOP("QIODevice", "file to open is a directory");-
147#ifndef QT_BOOTSTRAPPED-
148 return QIODevice::tr(message);
executed 10 times by 4 tests: return QIODevice::tr(message);
Executed by:
  • tst_QFile
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_qmakelib
10
149#else-
150 return QLatin1String(message);-
151#endif-
152}-
153-
154/*!-
155 \internal-
156*/-
157bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)-
158{-
159 Q_Q(QFSFileEngine);-
160-
161 if (openMode & QIODevice::Unbuffered) {
openMode & QIO...ce::UnbufferedDescription
TRUEevaluated 32417 times by 185 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • ...
FALSEnever evaluated
0-32417
162 int flags = openModeToOpenFlags(openMode);-
163-
164 // Try to open the file in unbuffered mode.-
165 do {-
166 fd = QT_OPEN(fileEntry.nativeFilePath().constData(), flags, 0666);-
167 } while (fd == -1 && errno == EINTR);
executed 32417 times by 185 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • ...
fd == -1Description
TRUEevaluated 3474 times by 50 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTime
  • tst_QDir
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QGlobal
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • ...
FALSEevaluated 28943 times by 169 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
(*__errno_location ()) == 4Description
TRUEnever evaluated
FALSEevaluated 3474 times by 50 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTime
  • tst_QDir
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QGlobal
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • ...
0-32417
168-
169 // On failure, return and report the error.-
170 if (fd == -1) {
fd == -1Description
TRUEevaluated 3474 times by 50 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTime
  • tst_QDir
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QGlobal
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • ...
FALSEevaluated 28943 times by 169 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
3474-28943
171 q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError,-
172 qt_error_string(errno));-
173 return false;
executed 3474 times by 50 tests: return false;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTime
  • tst_QDir
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QGlobal
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • ...
3474
174 }-
175-
176 if (!(openMode & QIODevice::WriteOnly)) {
!(openMode & Q...ce::WriteOnly)Description
TRUEevaluated 26563 times by 165 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
FALSEevaluated 2380 times by 43 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QPainterPath
  • ...
2380-26563
177 // we don't need this check if we tried to open for writing because then-
178 // we had received EISDIR anyway.-
179 if (QFileSystemEngine::fillMetaData(fd, metaData)
QFileSystemEng...(fd, metaData)Description
TRUEevaluated 26563 times by 165 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
FALSEnever evaluated
0-26563
180 && metaData.isDirectory()) {
metaData.isDirectory()Description
TRUEevaluated 10 times by 4 tests
Evaluated by:
  • tst_QFile
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_qmakelib
FALSEevaluated 26553 times by 165 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
10-26553
181 q->setError(QFile::OpenError, msgOpenDirectory());-
182 QT_CLOSE(fd);-
183 return false;
executed 10 times by 4 tests: return false;
Executed by:
  • tst_QFile
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_qmakelib
10
184 }-
185 }
executed 26553 times by 165 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
26553
186-
187 // Seek to the end when in Append mode.-
188 if (flags & QFile::Append) {
flags & QFile::AppendDescription
TRUEnever evaluated
FALSEevaluated 28933 times by 169 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
0-28933
189 int ret;-
190 do {-
191 ret = QT_LSEEK(fd, 0, SEEK_END);-
192 } while (ret == -1 && errno == EINTR);
never executed: end of block
ret == -1Description
TRUEnever evaluated
FALSEnever evaluated
(*__errno_location ()) == 4Description
TRUEnever evaluated
FALSEnever evaluated
0
193-
194 if (ret == -1) {
ret == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
195 q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError,-
196 qt_error_string(int(errno)));-
197 return false;
never executed: return false;
0
198 }-
199 }
never executed: end of block
0
200-
201 fh = 0;-
202 } else {
executed 28933 times by 169 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
28933
203 QByteArray fopenMode = openModeToFopenMode(openMode, fileEntry, metaData);-
204-
205 // Try to open the file in buffered mode.-
206 do {-
207 fh = QT_FOPEN(fileEntry.nativeFilePath().constData(), fopenMode.constData());-
208 } while (!fh && errno == EINTR);
never executed: end of block
!fhDescription
TRUEnever evaluated
FALSEnever evaluated
(*__errno_location ()) == 4Description
TRUEnever evaluated
FALSEnever evaluated
0
209-
210 // On failure, return and report the error.-
211 if (!fh) {
!fhDescription
TRUEnever evaluated
FALSEnever evaluated
0
212 q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError,-
213 qt_error_string(int(errno)));-
214 return false;
never executed: return false;
0
215 }-
216-
217 if (!(openMode & QIODevice::WriteOnly)) {
!(openMode & Q...ce::WriteOnly)Description
TRUEnever evaluated
FALSEnever evaluated
0
218 // we don't need this check if we tried to open for writing because then-
219 // we had received EISDIR anyway.-
220 if (QFileSystemEngine::fillMetaData(QT_FILENO(fh), metaData)
QFileSystemEng...fh), metaData)Description
TRUEnever evaluated
FALSEnever evaluated
0
221 && metaData.isDirectory()) {
metaData.isDirectory()Description
TRUEnever evaluated
FALSEnever evaluated
0
222 q->setError(QFile::OpenError, msgOpenDirectory());-
223 fclose(fh);-
224 return false;
never executed: return false;
0
225 }-
226 }
never executed: end of block
0
227-
228 setCloseOnExec(fileno(fh)); // ignore failure-
229-
230 // Seek to the end when in Append mode.-
231 if (openMode & QIODevice::Append) {
openMode & QIODevice::AppendDescription
TRUEnever evaluated
FALSEnever evaluated
0
232 int ret;-
233 do {-
234 ret = QT_FSEEK(fh, 0, SEEK_END);-
235 } while (ret == -1 && errno == EINTR);
never executed: end of block
ret == -1Description
TRUEnever evaluated
FALSEnever evaluated
(*__errno_location ()) == 4Description
TRUEnever evaluated
FALSEnever evaluated
0
236-
237 if (ret == -1) {
ret == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
238 q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError,-
239 qt_error_string(int(errno)));-
240 return false;
never executed: return false;
0
241 }-
242 }
never executed: end of block
0
243-
244 fd = -1;-
245 }
never executed: end of block
0
246-
247 closeFileHandle = true;-
248 return true;
executed 28933 times by 169 tests: return true;
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
28933
249}-
250-
251/*!-
252 \internal-
253*/-
254bool QFSFileEnginePrivate::nativeClose()-
255{-
256 return closeFdFh();
executed 33415 times by 208 tests: return closeFdFh();
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
33415
257}-
258-
259/*!-
260 \internal-
261-
262*/-
263bool QFSFileEnginePrivate::nativeFlush()-
264{-
265 return fh ? flushFh() : fd != -1;
executed 28697 times by 53 tests: return fh ? flushFh() : fd != -1;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • ...
28697
266}-
267-
268/*!-
269 \internal-
270 \since 5.1-
271*/-
272bool QFSFileEnginePrivate::nativeSyncToDisk()-
273{-
274 Q_Q(QFSFileEngine);-
275#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0-
276 const int ret = fdatasync(nativeHandle());-
277#else-
278 const int ret = fsync(nativeHandle());-
279#endif-
280 if (ret != 0)
ret != 0Description
TRUEnever evaluated
FALSEevaluated 574 times by 7 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
0-574
281 q->setError(QFile::WriteError, qt_error_string(errno));
never executed: q->setError(QFile::WriteError, qt_error_string((*__errno_location ())));
0
282 return ret == 0;
executed 574 times by 7 tests: return ret == 0;
Executed by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
574
283}-
284-
285/*!-
286 \internal-
287*/-
288qint64 QFSFileEnginePrivate::nativeRead(char *data, qint64 len)-
289{-
290 Q_Q(QFSFileEngine);-
291-
292 if (fh && nativeIsSequential()) {
fhDescription
TRUEevaluated 394 times by 3 tests
Evaluated by:
  • tst_QFile
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEevaluated 86518 times by 102 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
nativeIsSequential()Description
TRUEevaluated 389 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QFile
5-86518
293 size_t readBytes = 0;-
294 int oldFlags = fcntl(QT_FILENO(fh), F_GETFL);-
295 for (int i = 0; i < 2; ++i) {
i < 2Description
TRUEevaluated 399 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEnever evaluated
0-399
296 // Unix: Make the underlying file descriptor non-blocking-
297 if ((oldFlags & O_NONBLOCK) == 0)
(oldFlags & 04000) == 0Description
TRUEevaluated 399 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEnever evaluated
0-399
298 fcntl(QT_FILENO(fh), F_SETFL, oldFlags | O_NONBLOCK);
executed 399 times by 2 tests: fcntl(fileno(fh), 4, oldFlags | 04000);
Executed by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
399
299-
300 // Cross platform stdlib read-
301 size_t read = 0;-
302 do {-
303 read = fread(data + readBytes, 1, size_t(len - readBytes), fh);-
304 } while (read == 0 && !feof(fh) && errno == EINTR);
executed 399 times by 2 tests: end of block
Executed by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
read == 0Description
TRUEevaluated 137 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEevaluated 262 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
!feof(fh)Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qnetworkreply - unknown status
FALSEevaluated 127 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
(*__errno_location ()) == 4Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qnetworkreply - unknown status
0-399
305 if (read > 0) {
read > 0Description
TRUEevaluated 262 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEevaluated 137 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
137-262
306 readBytes += read;-
307 break;
executed 262 times by 2 tests: break;
Executed by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
262
308 } else {-
309 if (readBytes)
readBytesDescription
TRUEnever evaluated
FALSEevaluated 137 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
0-137
310 break;
never executed: break;
0
311 readBytes = read;-
312 }
executed 137 times by 2 tests: end of block
Executed by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
137
313-
314 // Unix: Restore the blocking state of the underlying socket-
315 if ((oldFlags & O_NONBLOCK) == 0) {
(oldFlags & 04000) == 0Description
TRUEevaluated 137 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEnever evaluated
0-137
316 fcntl(QT_FILENO(fh), F_SETFL, oldFlags);-
317 if (readBytes == 0) {
readBytes == 0Description
TRUEevaluated 137 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEnever evaluated
0-137
318 int readByte = 0;-
319 do {-
320 readByte = fgetc(fh);-
321 } while (readByte == -1 && errno == EINTR);
executed 137 times by 2 tests: end of block
Executed by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
readByte == -1Description
TRUEevaluated 127 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qnetworkreply - unknown status
(*__errno_location ()) == 4Description
TRUEnever evaluated
FALSEevaluated 127 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
0-137
322 if (readByte != -1) {
readByte != -1Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qnetworkreply - unknown status
FALSEevaluated 127 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
10-127
323 *data = uchar(readByte);-
324 readBytes += 1;-
325 } else {
executed 10 times by 1 test: end of block
Executed by:
  • tst_qnetworkreply - unknown status
10
326 break;
executed 127 times by 2 tests: break;
Executed by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
127
327 }-
328 }-
329 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qnetworkreply - unknown status
10
330 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qnetworkreply - unknown status
10
331 // Unix: Restore the blocking state of the underlying socket-
332 if ((oldFlags & O_NONBLOCK) == 0) {
(oldFlags & 04000) == 0Description
TRUEevaluated 389 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEnever evaluated
0-389
333 fcntl(QT_FILENO(fh), F_SETFL, oldFlags);-
334 }
executed 389 times by 2 tests: end of block
Executed by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
389
335 if (readBytes == 0 && !feof(fh)) {
readBytes == 0Description
TRUEevaluated 127 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEevaluated 262 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
!feof(fh)Description
TRUEnever evaluated
FALSEevaluated 127 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
0-262
336 // if we didn't read anything and we're not at EOF, it must be an error-
337 q->setError(QFile::ReadError, qt_error_string(int(errno)));-
338 return -1;
never executed: return -1;
0
339 }-
340 return readBytes;
executed 389 times by 2 tests: return readBytes;
Executed by:
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
389
341 }-
342-
343 return readFdFh(data, len);
executed 86523 times by 102 tests: return readFdFh(data, len);
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
86523
344}-
345-
346/*!-
347 \internal-
348*/-
349qint64 QFSFileEnginePrivate::nativeReadLine(char *data, qint64 maxlen)-
350{-
351 return readLineFdFh(data, maxlen);
executed 8 times by 1 test: return readLineFdFh(data, maxlen);
Executed by:
  • tst_QFile
8
352}-
353-
354/*!-
355 \internal-
356*/-
357qint64 QFSFileEnginePrivate::nativeWrite(const char *data, qint64 len)-
358{-
359 return writeFdFh(data, len);
executed 19139 times by 46 tests: return writeFdFh(data, len);
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QPainterPath
  • ...
19139
360}-
361-
362/*!-
363 \internal-
364*/-
365qint64 QFSFileEnginePrivate::nativePos() const-
366{-
367 return posFdFh();
executed 282 times by 7 tests: return posFdFh();
Executed by:
  • tst_QAbstractFileEngine
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QNetworkReply
  • tst_QTemporaryFile
282
368}-
369-
370/*!-
371 \internal-
372*/-
373bool QFSFileEnginePrivate::nativeSeek(qint64 pos)-
374{-
375 return seekFdFh(pos);
executed 224254 times by 50 tests: return seekFdFh(pos);
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QDataStream
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLockFile
  • tst_QMimeDatabase
  • ...
224254
376}-
377-
378/*!-
379 \internal-
380*/-
381int QFSFileEnginePrivate::nativeHandle() const-
382{-
383 return fh ? fileno(fh) : fd;
executed 35000 times by 127 tests: return fh ? fileno(fh) : fd;
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • ...
35000
384}-
385-
386/*!-
387 \internal-
388*/-
389bool QFSFileEnginePrivate::nativeIsSequential() const-
390{-
391 return isSequentialFdFh();
executed 26944 times by 109 tests: return isSequentialFdFh();
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • ...
26944
392}-
393-
394bool QFSFileEngine::remove()-
395{-
396 Q_D(QFSFileEngine);-
397 QSystemError error;-
398 bool ret = QFileSystemEngine::removeFile(d->fileEntry, error);-
399 d->metaData.clear();-
400 if (!ret) {
!retDescription
TRUEevaluated 596 times by 21 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QIODevice
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSharedMemory
  • tst_QTextStream
  • tst_QXmlStream
  • tst_qmake
  • tst_qstandardpaths
  • tst_selftests - unknown status
FALSEevaluated 12669 times by 76 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • ...
596-12669
401 setError(QFile::RemoveError, error.toString());-
402 }
executed 596 times by 21 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QIODevice
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSharedMemory
  • tst_QTextStream
  • tst_QXmlStream
  • tst_qmake
  • tst_qstandardpaths
  • tst_selftests - unknown status
596
403 return ret;
executed 13265 times by 76 tests: return ret;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • ...
13265
404}-
405-
406bool QFSFileEngine::copy(const QString &newName)-
407{-
408 Q_D(QFSFileEngine);-
409 QSystemError error;-
410 bool ret = QFileSystemEngine::copyFile(d->fileEntry, QFileSystemEntry(newName), error);-
411 if (!ret) {
!retDescription
TRUEevaluated 100 times by 2 tests
Evaluated by:
  • tst_QFile
  • tst_QImageReader
FALSEnever evaluated
0-100
412 setError(QFile::CopyError, error.toString());-
413 }
executed 100 times by 2 tests: end of block
Executed by:
  • tst_QFile
  • tst_QImageReader
100
414 return ret;
executed 100 times by 2 tests: return ret;
Executed by:
  • tst_QFile
  • tst_QImageReader
100
415}-
416-
417bool QFSFileEngine::renameOverwrite(const QString &newName)-
418{-
419 // On Unix, rename() overwrites.-
420 return rename(newName);
executed 573 times by 7 tests: return rename(newName);
Executed by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
573
421}-
422-
423bool QFSFileEngine::rename(const QString &newName)-
424{-
425 Q_D(QFSFileEngine);-
426 QSystemError error;-
427 bool ret = QFileSystemEngine::renameFile(d->fileEntry, QFileSystemEntry(newName), error);-
428-
429 if (!ret) {
!retDescription
TRUEevaluated 4 times by 4 tests
Evaluated by:
  • tst_QDir
  • tst_QFile
  • tst_QSaveFile
  • tst_QTemporaryFile
FALSEevaluated 820 times by 20 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_languageChange
4-820
430 setError(QFile::RenameError, error.toString());-
431 }
executed 4 times by 4 tests: end of block
Executed by:
  • tst_QDir
  • tst_QFile
  • tst_QSaveFile
  • tst_QTemporaryFile
4
432-
433 return ret;
executed 824 times by 20 tests: return ret;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_languageChange
824
434}-
435-
436bool QFSFileEngine::link(const QString &newName)-
437{-
438 Q_D(QFSFileEngine);-
439 QSystemError error;-
440 bool ret = QFileSystemEngine::createLink(d->fileEntry, QFileSystemEntry(newName), error);-
441 if (!ret) {
!retDescription
TRUEnever evaluated
FALSEevaluated 161 times by 8 tests
Evaluated by:
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qstandardpaths
0-161
442 setError(QFile::RenameError, error.toString());-
443 }
never executed: end of block
0
444 return ret;
executed 161 times by 8 tests: return ret;
Executed by:
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qstandardpaths
161
445}-
446-
447qint64 QFSFileEnginePrivate::nativeSize() const-
448{-
449 return sizeFdFh();
executed 133807 times by 159 tests: return sizeFdFh();
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • ...
133807
450}-
451-
452bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) const-
453{-
454 return QFileSystemEngine::createDirectory(QFileSystemEntry(name), createParentDirectories);
never executed: return QFileSystemEngine::createDirectory(QFileSystemEntry(name), createParentDirectories);
0
455}-
456-
457bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) const-
458{-
459 return QFileSystemEngine::removeDirectory(QFileSystemEntry(name), recurseParentDirectories);
never executed: return QFileSystemEngine::removeDirectory(QFileSystemEntry(name), recurseParentDirectories);
0
460}-
461-
462bool QFSFileEngine::caseSensitive() const-
463{-
464 return true;
never executed: return true;
0
465}-
466-
467bool QFSFileEngine::setCurrentPath(const QString &path)-
468{-
469 return QFileSystemEngine::setCurrentPath(QFileSystemEntry(path));
never executed: return QFileSystemEngine::setCurrentPath(QFileSystemEntry(path));
0
470}-
471-
472QString QFSFileEngine::currentPath(const QString &)-
473{-
474 return QFileSystemEngine::currentPath().filePath();
never executed: return QFileSystemEngine::currentPath().filePath();
0
475}-
476-
477QString QFSFileEngine::homePath()-
478{-
479 return QFileSystemEngine::homePath();
never executed: return QFileSystemEngine::homePath();
0
480}-
481-
482QString QFSFileEngine::rootPath()-
483{-
484 return QFileSystemEngine::rootPath();
executed 78 times by 13 tests: return QFileSystemEngine::rootPath();
Executed by:
  • tst_QCompleter
  • tst_QDir
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QPrinter
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_languageChange
78
485}-
486-
487QString QFSFileEngine::tempPath()-
488{-
489 return QFileSystemEngine::tempPath();
never executed: return QFileSystemEngine::tempPath();
0
490}-
491-
492QFileInfoList QFSFileEngine::drives()-
493{-
494 QFileInfoList ret;-
495 ret.append(QFileInfo(rootPath()));-
496 return ret;
executed 78 times by 13 tests: return ret;
Executed by:
  • tst_QCompleter
  • tst_QDir
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QPrinter
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_languageChange
78
497}-
498-
499bool QFSFileEnginePrivate::doStat(QFileSystemMetaData::MetaDataFlags flags) const-
500{-
501 if (!tried_stat || !metaData.hasFlags(flags)) {
!tried_statDescription
TRUEevaluated 162212 times by 171 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
FALSEevaluated 35463 times by 132 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDir
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • ...
!metaData.hasFlags(flags)Description
TRUEevaluated 370 times by 37 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • ...
FALSEevaluated 35093 times by 129 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDir
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • ...
370-162212
502 tried_stat = 1;-
503-
504 int localFd = fd;-
505 if (fh && fileEntry.isEmpty())
fhDescription
TRUEevaluated 374 times by 5 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEevaluated 162208 times by 170 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
fileEntry.isEmpty()Description
TRUEevaluated 374 times by 5 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEnever evaluated
0-162208
506 localFd = QT_FILENO(fh);
executed 374 times by 5 tests: localFd = fileno(fh);
Executed by:
  • tst_LargeFile
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
374
507 if (localFd != -1)
localFd != -1Description
TRUEevaluated 159818 times by 169 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
FALSEevaluated 2764 times by 57 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLineEdit
  • ...
2764-159818
508 QFileSystemEngine::fillMetaData(localFd, metaData);
executed 159818 times by 169 tests: QFileSystemEngine::fillMetaData(localFd, metaData);
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
159818
509-
510 if (metaData.missingFlags(flags) && !fileEntry.isEmpty())
!fileEntry.isEmpty()Description
TRUEevaluated 3131 times by 59 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
1-3131
511 QFileSystemEngine::fillMetaData(fileEntry, metaData, metaData.missingFlags(flags));
executed 3131 times by 59 tests: QFileSystemEngine::fillMetaData(fileEntry, metaData, metaData.missingFlags(flags));
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
3131
512 }
executed 162582 times by 171 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
162582
513-
514 return metaData.exists();
executed 197675 times by 171 tests: return metaData.exists();
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
197675
515}-
516-
517bool QFSFileEnginePrivate::isSymlink() const-
518{-
519 if (!metaData.hasFlags(QFileSystemMetaData::LinkType))
!metaData.hasF...ata::LinkType)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFile
FALSEnever evaluated
0-2
520 QFileSystemEngine::fillMetaData(fileEntry, metaData, QFileSystemMetaData::LinkType);
executed 2 times by 1 test: QFileSystemEngine::fillMetaData(fileEntry, metaData, QFileSystemMetaData::LinkType);
Executed by:
  • tst_QFile
2
521-
522 return metaData.isLink();
executed 2 times by 1 test: return metaData.isLink();
Executed by:
  • tst_QFile
2
523}-
524-
525/*!-
526 \reimp-
527*/-
528QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const-
529{-
530 Q_D(const QFSFileEngine);-
531-
532 if (type & Refresh)
type & RefreshDescription
TRUEevaluated 2390 times by 56 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
FALSEevaluated 165 times by 11 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qmakelib
  • tst_qstandardpaths
165-2390
533 d->metaData.clear();
executed 2390 times by 56 tests: d->metaData.clear();
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
2390
534-
535 QAbstractFileEngine::FileFlags ret = 0;-
536-
537 if (type & FlagsMask)
type & FlagsMaskDescription
TRUEevaluated 2395 times by 56 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
FALSEevaluated 160 times by 10 tests
Evaluated by:
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qmakelib
  • tst_qstandardpaths
160-2395
538 ret |= LocalDiskFlag;
executed 2395 times by 56 tests: ret |= LocalDiskFlag;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
2395
539-
540 bool exists;-
541 {-
542 QFileSystemMetaData::MetaDataFlags queryFlags = 0;-
543-
544 queryFlags |= QFileSystemMetaData::MetaDataFlags(uint(type))-
545 & QFileSystemMetaData::Permissions;-
546-
547 if (type & TypesMask)
type & TypesMaskDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QAbstractFileEngine
FALSEevaluated 2550 times by 59 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
5-2550
548 queryFlags |= QFileSystemMetaData::AliasType
executed 5 times by 1 test: queryFlags |= QFileSystemMetaData::AliasType | QFileSystemMetaData::LinkType | QFileSystemMetaData::FileType | QFileSystemMetaData::DirectoryType | QFileSystemMetaData::BundleType;
Executed by:
  • tst_QAbstractFileEngine
5
549 | QFileSystemMetaData::LinkType
executed 5 times by 1 test: queryFlags |= QFileSystemMetaData::AliasType | QFileSystemMetaData::LinkType | QFileSystemMetaData::FileType | QFileSystemMetaData::DirectoryType | QFileSystemMetaData::BundleType;
Executed by:
  • tst_QAbstractFileEngine
5
550 | QFileSystemMetaData::FileType
executed 5 times by 1 test: queryFlags |= QFileSystemMetaData::AliasType | QFileSystemMetaData::LinkType | QFileSystemMetaData::FileType | QFileSystemMetaData::DirectoryType | QFileSystemMetaData::BundleType;
Executed by:
  • tst_QAbstractFileEngine
5
551 | QFileSystemMetaData::DirectoryType
executed 5 times by 1 test: queryFlags |= QFileSystemMetaData::AliasType | QFileSystemMetaData::LinkType | QFileSystemMetaData::FileType | QFileSystemMetaData::DirectoryType | QFileSystemMetaData::BundleType;
Executed by:
  • tst_QAbstractFileEngine
5
552 | QFileSystemMetaData::BundleType;
executed 5 times by 1 test: queryFlags |= QFileSystemMetaData::AliasType | QFileSystemMetaData::LinkType | QFileSystemMetaData::FileType | QFileSystemMetaData::DirectoryType | QFileSystemMetaData::BundleType;
Executed by:
  • tst_QAbstractFileEngine
5
553-
554 if (type & FlagsMask)
type & FlagsMaskDescription
TRUEevaluated 2395 times by 56 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
FALSEevaluated 160 times by 10 tests
Evaluated by:
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qmakelib
  • tst_qstandardpaths
160-2395
555 queryFlags |= QFileSystemMetaData::HiddenAttribute
executed 2395 times by 56 tests: queryFlags |= QFileSystemMetaData::HiddenAttribute | QFileSystemMetaData::ExistsAttribute;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
2395
556 | QFileSystemMetaData::ExistsAttribute;
executed 2395 times by 56 tests: queryFlags |= QFileSystemMetaData::HiddenAttribute | QFileSystemMetaData::ExistsAttribute;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
2395
557-
558 queryFlags |= QFileSystemMetaData::LinkType;-
559-
560 exists = d->doStat(queryFlags);-
561 }-
562-
563 if (!exists && !d->metaData.isLink())
!existsDescription
TRUEevaluated 1249 times by 20 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QDir
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QIcon
  • tst_QImage
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QPixmap
  • tst_QProcess
  • tst_QSettings
  • tst_QStyleSheetStyle
  • tst_QTemporaryFile
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_rcc
FALSEevaluated 1306 times by 53 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
!d->metaData.isLink()Description
TRUEevaluated 1249 times by 20 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QDir
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QIcon
  • tst_QImage
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QPixmap
  • tst_QProcess
  • tst_QSettings
  • tst_QStyleSheetStyle
  • tst_QTemporaryFile
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_rcc
FALSEnever evaluated
0-1306
564 return ret;
executed 1249 times by 20 tests: return ret;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QDir
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QIcon
  • tst_QImage
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QPixmap
  • tst_QProcess
  • tst_QSettings
  • tst_QStyleSheetStyle
  • tst_QTemporaryFile
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_rcc
1249
565-
566 if (exists && (type & PermsMask))
existsDescription
TRUEevaluated 1306 times by 53 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
FALSEnever evaluated
0-1306
567 ret |= FileFlags(uint(d->metaData.permissions()));
executed 160 times by 10 tests: ret |= FileFlags(uint(d->metaData.permissions()));
Executed by:
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qmakelib
  • tst_qstandardpaths
160
568-
569 if (type & TypesMask) {
type & TypesMaskDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QAbstractFileEngine
FALSEevaluated 1303 times by 53 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
3-1303
570 if (d->metaData.isAlias()) {
d->metaData.isAlias()Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QAbstractFileEngine
0-3
571 ret |= LinkType;-
572 } else {
never executed: end of block
0
573 if ((type & LinkType) && d->metaData.isLink())
d->metaData.isLink()Description
TRUEnever evaluated
FALSEnever evaluated
0
574 ret |= LinkType;
never executed: ret |= LinkType;
0
575 if (exists) {
existsDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QAbstractFileEngine
FALSEnever evaluated
0-3
576 if (d->metaData.isFile()) {
d->metaData.isFile()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QAbstractFileEngine
FALSEnever evaluated
0-3
577 ret |= FileType;-
578 } else if (d->metaData.isDirectory()) {
executed 3 times by 1 test: end of block
Executed by:
  • tst_QAbstractFileEngine
d->metaData.isDirectory()Description
TRUEnever evaluated
FALSEnever evaluated
0-3
579 ret |= DirectoryType;-
580 if ((type & BundleType) && d->metaData.isBundle())
(type & BundleType)Description
TRUEnever evaluated
FALSEnever evaluated
d->metaData.isBundle()Description
TRUEnever evaluated
FALSEnever evaluated
0
581 ret |= BundleType;
never executed: ret |= BundleType;
0
582 }
never executed: end of block
0
583 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QAbstractFileEngine
3
584 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QAbstractFileEngine
3
585 }-
586-
587 if (type & FlagsMask) {
type & FlagsMaskDescription
TRUEevaluated 1146 times by 50 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
FALSEevaluated 160 times by 10 tests
Evaluated by:
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qmakelib
  • tst_qstandardpaths
160-1146
588 if (exists)
existsDescription
TRUEevaluated 1146 times by 50 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
FALSEnever evaluated
0-1146
589 ret |= ExistsFlag;
executed 1146 times by 50 tests: ret |= ExistsFlag;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
1146
590 if (d->fileEntry.isRoot())
d->fileEntry.isRoot()Description
TRUEnever evaluated
FALSEevaluated 1146 times by 50 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
0-1146
591 ret |= RootFlag;
never executed: ret |= RootFlag;
0
592 else if (d->metaData.isHidden())
d->metaData.isHidden()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
FALSEevaluated 1134 times by 50 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
12-1134
593 ret |= HiddenFlag;
executed 12 times by 1 test: ret |= HiddenFlag;
Executed by:
  • tst_QTemporaryFile
12
594 }
executed 1146 times by 50 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
1146
595-
596 return ret;
executed 1306 times by 53 tests: return ret;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
1306
597}-
598-
599QString QFSFileEngine::fileName(FileName file) const-
600{-
601 Q_D(const QFSFileEngine);-
602 if (file == BundleName) {
file == BundleNameDescription
TRUEnever evaluated
FALSEevaluated 7361 times by 67 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
0-7361
603 return QFileSystemEngine::bundleName(d->fileEntry);
never executed: return QFileSystemEngine::bundleName(d->fileEntry);
0
604 } else if (file == BaseName) {
file == BaseNameDescription
TRUEnever evaluated
FALSEevaluated 7361 times by 67 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
0-7361
605 return d->fileEntry.fileName();
never executed: return d->fileEntry.fileName();
0
606 } else if (file == PathName) {
file == PathNameDescription
TRUEnever evaluated
FALSEevaluated 7361 times by 67 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
0-7361
607 return d->fileEntry.path();
never executed: return d->fileEntry.path();
0
608 } else if (file == AbsoluteName || file == AbsolutePathName) {
file == AbsoluteNameDescription
TRUEnever evaluated
FALSEevaluated 7361 times by 67 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
file == AbsolutePathNameDescription
TRUEnever evaluated
FALSEevaluated 7361 times by 67 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
0-7361
609 QFileSystemEntry entry(QFileSystemEngine::absoluteName(d->fileEntry));-
610 if (file == AbsolutePathName) {
file == AbsolutePathNameDescription
TRUEnever evaluated
FALSEnever evaluated
0
611 return entry.path();
never executed: return entry.path();
0
612 }-
613 return entry.filePath();
never executed: return entry.filePath();
0
614 } else if (file == CanonicalName || file == CanonicalPathName) {
file == CanonicalNameDescription
TRUEnever evaluated
FALSEevaluated 7361 times by 67 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
file == CanonicalPathNameDescription
TRUEnever evaluated
FALSEevaluated 7361 times by 67 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
0-7361
615 QFileSystemEntry entry(QFileSystemEngine::canonicalName(d->fileEntry, d->metaData));-
616 if (file == CanonicalPathName)
file == CanonicalPathNameDescription
TRUEnever evaluated
FALSEnever evaluated
0
617 return entry.path();
never executed: return entry.path();
0
618 return entry.filePath();
never executed: return entry.filePath();
0
619 } else if (file == LinkName) {
file == LinkNameDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 7359 times by 67 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
2-7359
620 if (d->isSymlink()) {
d->isSymlink()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFile
FALSEnever evaluated
0-2
621 QFileSystemEntry entry = QFileSystemEngine::getLinkTarget(d->fileEntry, d->metaData);-
622 return entry.filePath();
executed 2 times by 1 test: return entry.filePath();
Executed by:
  • tst_QFile
2
623 }-
624 return QString();
never executed: return QString();
0
625 }-
626 return d->fileEntry.filePath();
executed 7359 times by 67 tests: return d->fileEntry.filePath();
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
7359
627}-
628-
629bool QFSFileEngine::isRelativePath() const-
630{-
631 Q_D(const QFSFileEngine);-
632 return d->fileEntry.filePath().length() ? d->fileEntry.filePath()[0] != QLatin1Char('/') : true;
never executed: return d->fileEntry.filePath().length() ? d->fileEntry.filePath()[0] != QLatin1Char('/') : true;
0
633}-
634-
635uint QFSFileEngine::ownerId(FileOwner own) const-
636{-
637 Q_D(const QFSFileEngine);-
638 static const uint nobodyID = (uint) -2;-
639-
640 if (d->doStat(QFileSystemMetaData::OwnerIds))
d->doStat(QFil...ata::OwnerIds)Description
TRUEnever evaluated
FALSEnever evaluated
0
641 return d->metaData.ownerId(own);
never executed: return d->metaData.ownerId(own);
0
642-
643 return nobodyID;
never executed: return nobodyID;
0
644}-
645-
646QString QFSFileEngine::owner(FileOwner own) const-
647{-
648 if (own == OwnerUser)
own == OwnerUserDescription
TRUEnever evaluated
FALSEnever evaluated
0
649 return QFileSystemEngine::resolveUserName(ownerId(own));
never executed: return QFileSystemEngine::resolveUserName(ownerId(own));
0
650 return QFileSystemEngine::resolveGroupName(ownerId(own));
never executed: return QFileSystemEngine::resolveGroupName(ownerId(own));
0
651}-
652-
653bool QFSFileEngine::setPermissions(uint perms)-
654{-
655 Q_D(QFSFileEngine);-
656 QSystemError error;-
657 if (!QFileSystemEngine::setPermissions(d->fileEntry, QFile::Permissions(perms), error, 0)) {
!QFileSystemEn...ms), error, 0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 1074 times by 22 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QDir
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_languageChange
  • tst_qmakelib
  • tst_qstandardpaths
1-1074
658 setError(QFile::PermissionsError, error.toString());-
659 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QFile
1
660 }-
661 return true;
executed 1074 times by 22 tests: return true;
Executed by:
  • tst_QColorDialog
  • tst_QDir
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_languageChange
  • tst_qmakelib
  • tst_qstandardpaths
1074
662}-
663-
664bool QFSFileEngine::setSize(qint64 size)-
665{-
666 Q_D(QFSFileEngine);-
667 bool ret = false;-
668 if (d->fd != -1)
d->fd != -1Description
TRUEevaluated 281 times by 7 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QNetworkReply
  • tst_QTemporaryFile
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QFile
10-281
669 ret = QT_FTRUNCATE(d->fd, size) == 0;
executed 281 times by 7 tests: ret = ::ftruncate64(d->fd, size) == 0;
Executed by:
  • tst_QAbstractFileEngine
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QNetworkReply
  • tst_QTemporaryFile
281
670 else if (d->fh)
d->fhDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QFile
1-9
671 ret = QT_FTRUNCATE(QT_FILENO(d->fh), size) == 0;
executed 1 time by 1 test: ret = ::ftruncate64(fileno(d->fh), size) == 0;
Executed by:
  • tst_QFile
1
672 else-
673 ret = QT_TRUNCATE(d->fileEntry.nativeFilePath().constData(), size) == 0;
executed 9 times by 2 tests: ret = ::truncate64(d->fileEntry.nativeFilePath().constData(), size) == 0;
Executed by:
  • tst_QAbstractFileEngine
  • tst_QFile
9
674 if (!ret)
!retDescription
TRUEnever evaluated
FALSEevaluated 291 times by 7 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QNetworkReply
  • tst_QTemporaryFile
0-291
675 setError(QFile::ResizeError, qt_error_string(errno));
never executed: setError(QFile::ResizeError, qt_error_string((*__errno_location ())));
0
676 return ret;
executed 291 times by 7 tests: return ret;
Executed by:
  • tst_QAbstractFileEngine
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QNetworkReply
  • tst_QTemporaryFile
291
677}-
678-
679QDateTime QFSFileEngine::fileTime(FileTime time) const-
680{-
681 Q_D(const QFSFileEngine);-
682-
683 if (d->doStat(QFileSystemMetaData::Times))
d->doStat(QFil...taData::Times)Description
TRUEnever evaluated
FALSEnever evaluated
0
684 return d->metaData.fileTime(time);
never executed: return d->metaData.fileTime(time);
0
685-
686 return QDateTime();
never executed: return QDateTime();
0
687}-
688-
689uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags)-
690{-
691 Q_Q(QFSFileEngine);-
692 Q_UNUSED(flags);-
693 if (openMode == QIODevice::NotOpen) {
openMode == QIODevice::NotOpenDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 34371 times by 121 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
8-34371
694 q->setError(QFile::PermissionsError, qt_error_string(int(EACCES)));-
695 return 0;
executed 8 times by 1 test: return 0;
Executed by:
  • tst_QFile
8
696 }-
697-
698 if (offset < 0 || offset != qint64(QT_OFF_T(offset))
offset < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 34370 times by 121 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
offset != qint...f64_t(offset))Description
TRUEnever evaluated
FALSEevaluated 34370 times by 121 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
0-34370
699 || size < 0 || quint64(size) > quint64(size_t(-1))) {
size < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 34369 times by 121 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
quint64(size) ...64(size_t(-1))Description
TRUEnever evaluated
FALSEevaluated 34369 times by 121 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
0-34369
700 q->setError(QFile::UnspecifiedError, qt_error_string(int(EINVAL)));-
701 return 0;
executed 2 times by 1 test: return 0;
Executed by:
  • tst_QFile
2
702 }-
703-
704 // If we know the mapping will extend beyond EOF, fail early to avoid-
705 // undefined behavior. Otherwise, let mmap have its say.-
706 if (doStat(QFileSystemMetaData::SizeAttribute)
doStat(QFileSy...SizeAttribute)Description
TRUEevaluated 34369 times by 121 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
FALSEnever evaluated
0-34369
707 && (QT_OFF_T(size) > metaData.size() - QT_OFF_T(offset)))
(off64_t(size)...f64_t(offset))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_LargeFile
FALSEevaluated 34368 times by 121 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
1-34368
708 qWarning("QFSFileEngine::map: Mapping a file beyond its size is not portable");
executed 1 time by 1 test: QMessageLogger(__FILE__, 708, __PRETTY_FUNCTION__).warning("QFSFileEngine::map: Mapping a file beyond its size is not portable");
Executed by:
  • tst_LargeFile
1
709-
710 int access = 0;-
711 if (openMode & QIODevice::ReadOnly) access |= PROT_READ;
executed 34369 times by 121 tests: access |= 0x1;
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
openMode & QIODevice::ReadOnlyDescription
TRUEevaluated 34369 times by 121 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
FALSEnever evaluated
0-34369
712 if (openMode & QIODevice::WriteOnly) access |= PROT_WRITE;
executed 37 times by 2 tests: access |= 0x2;
Executed by:
  • tst_QFile
  • tst_QTemporaryFile
openMode & QIO...ice::WriteOnlyDescription
TRUEevaluated 37 times by 2 tests
Evaluated by:
  • tst_QFile
  • tst_QTemporaryFile
FALSEevaluated 34332 times by 120 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
37-34332
713-
714 int sharemode = MAP_SHARED;-
715 if (flags & QFileDevice::MapPrivateOption) {
flags & QFileD...pPrivateOptionDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 34367 times by 121 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
2-34367
716 sharemode = MAP_PRIVATE;-
717 access |= PROT_WRITE;-
718 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QFile
2
719-
720#if defined(Q_OS_INTEGRITY)-
721 int pageSize = sysconf(_SC_PAGESIZE);-
722#else-
723 int pageSize = getpagesize();-
724#endif-
725 int extra = offset % pageSize;-
726-
727 if (quint64(size + extra) > quint64((size_t)-1)) {
quint64(size +...64((size_t)-1)Description
TRUEnever evaluated
FALSEevaluated 34369 times by 121 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
0-34369
728 q->setError(QFile::UnspecifiedError, qt_error_string(int(EINVAL)));-
729 return 0;
never executed: return 0;
0
730 }-
731-
732 size_t realSize = (size_t)size + extra;-
733 QT_OFF_T realOffset = QT_OFF_T(offset);-
734 realOffset &= ~(QT_OFF_T(pageSize - 1));-
735-
736 void *mapAddress = QT_MMAP((void*)0, realSize,-
737 access, sharemode, nativeHandle(), realOffset);-
738 if (MAP_FAILED != mapAddress) {
((void *) -1) != mapAddressDescription
TRUEevaluated 34363 times by 121 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QFile
6-34363
739 uchar *address = extra + static_cast<uchar*>(mapAddress);-
740 maps[address] = QPair<int,size_t>(extra, realSize);-
741 return address;
executed 34363 times by 121 tests: return address;
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • ...
34363
742 }-
743-
744 switch(errno) {-
745 case EBADF:
executed 5 times by 1 test: case 9:
Executed by:
  • tst_QFile
5
746 q->setError(QFile::PermissionsError, qt_error_string(int(EACCES)));-
747 break;
executed 5 times by 1 test: break;
Executed by:
  • tst_QFile
5
748 case ENFILE:
never executed: case 23:
0
749 case ENOMEM:
never executed: case 12:
0
750 q->setError(QFile::ResourceError, qt_error_string(int(errno)));-
751 break;
never executed: break;
0
752 case EINVAL:
executed 1 time by 1 test: case 22:
Executed by:
  • tst_QFile
1
753 // size are out of bounds-
754 default:
never executed: default:
0
755 q->setError(QFile::UnspecifiedError, qt_error_string(int(errno)));-
756 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QFile
1
757 }-
758 return 0;
executed 6 times by 1 test: return 0;
Executed by:
  • tst_QFile
6
759}-
760-
761bool QFSFileEnginePrivate::unmap(uchar *ptr)-
762{-
763#if !defined(Q_OS_INTEGRITY)-
764 Q_Q(QFSFileEngine);-
765 if (!maps.contains(ptr)) {
!maps.contains(ptr)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 34363 times by 153 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • ...
8-34363
766 q->setError(QFile::PermissionsError, qt_error_string(EACCES));-
767 return false;
executed 8 times by 1 test: return false;
Executed by:
  • tst_QFile
8
768 }-
769-
770 uchar *start = ptr - maps[ptr].first;-
771 size_t len = maps[ptr].second;-
772 if (-1 == munmap(start, len)) {
-1 == munmap(start, len)Description
TRUEnever evaluated
FALSEevaluated 34363 times by 153 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • ...
0-34363
773 q->setError(QFile::UnspecifiedError, qt_error_string(errno));-
774 return false;
never executed: return false;
0
775 }-
776 maps.remove(ptr);-
777 return true;
executed 34363 times by 153 tests: return true;
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • ...
34363
778#else-
779 return false;-
780#endif-
781}-
782-
783QT_END_NAMESPACE-
784-
785#endif // QT_NO_FSFILEENGINE-
Source codeSwitch to Preprocessed file

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