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

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