qfsfileengine.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qfsfileengine.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 "qfsfileengine_p.h"-
35#include "qfsfileengine_iterator_p.h"-
36#include "qfilesystemengine_p.h"-
37#include "qdatetime.h"-
38#include "qdiriterator.h"-
39#include "qset.h"-
40#include <QtCore/qdebug.h>-
41-
42#ifndef QT_NO_FSFILEENGINE-
43-
44#if !defined(Q_OS_WINCE)-
45#include <errno.h>-
46#endif-
47#if defined(Q_OS_UNIX)-
48#include "private/qcore_unix_p.h"-
49#endif-
50#include <stdio.h>-
51#include <stdlib.h>-
52#if defined(Q_OS_MAC)-
53# include <private/qcore_mac_p.h>-
54#endif-
55-
56QT_BEGIN_NAMESPACE-
57-
58#ifdef Q_OS_WIN-
59# ifndef S_ISREG-
60# define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)-
61# endif-
62# ifndef S_ISCHR-
63# define S_ISCHR(x) (((x) & S_IFMT) == S_IFCHR)-
64# endif-
65# ifndef S_ISFIFO-
66# define S_ISFIFO(x) false-
67# endif-
68# ifndef S_ISSOCK-
69# define S_ISSOCK(x) false-
70# endif-
71# ifndef INVALID_FILE_ATTRIBUTES-
72# define INVALID_FILE_ATTRIBUTES (DWORD (-1))-
73# endif-
74#endif-
75-
76#ifdef Q_OS_WIN-
77// on Windows, read() and write() use int and unsigned int-
78typedef int SignedIOType;-
79typedef unsigned int UnsignedIOType;-
80#else-
81typedef ssize_t SignedIOType;-
82typedef size_t UnsignedIOType;-
83Q_STATIC_ASSERT_X(sizeof(SignedIOType) == sizeof(UnsignedIOType),-
84 "Unsupported: read/write return a type with different size as the len parameter");-
85#endif-
86-
87/*! \class QFSFileEngine-
88 \inmodule QtCore-
89 \brief The QFSFileEngine class implements Qt's default file engine.-
90 \since 4.1-
91 \internal-
92-
93 This class is part of the file engine framework in Qt. If you only want to-
94 access files or directories, use QFile, QFileInfo or QDir instead.-
95-
96 QFSFileEngine is the default file engine for accessing regular files. It-
97 is provided for convenience; by subclassing this class, you can alter its-
98 behavior slightly, without having to write a complete QAbstractFileEngine-
99 subclass. To install your custom file engine, you must also subclass-
100 QAbstractFileEngineHandler and create an instance of your handler.-
101-
102 It can also be useful to create a QFSFileEngine object directly if you-
103 need to use the local file system inside QAbstractFileEngine::create(), in-
104 order to avoid recursion (as higher-level classes tend to call-
105 QAbstractFileEngine::create()).-
106*/-
107-
108//**************** QFSFileEnginePrivate-
109QFSFileEnginePrivate::QFSFileEnginePrivate() : QAbstractFileEnginePrivate()-
110{-
111 init();-
112}
executed 45646 times by 210 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
  • ...
45646
113-
114/*!-
115 \internal-
116*/-
117void QFSFileEnginePrivate::init()-
118{-
119 is_sequential = 0;-
120 tried_stat = 0;-
121#if !defined(Q_OS_WINCE)-
122 need_lstat = 1;-
123 is_link = 0;-
124#endif-
125 openMode = QIODevice::NotOpen;-
126 fd = -1;-
127 fh = 0;-
128 lastIOCommand = IOFlushCommand;-
129 lastFlushFailed = false;-
130 closeFileHandle = false;-
131#ifdef Q_OS_WIN-
132 fileAttrib = INVALID_FILE_ATTRIBUTES;-
133 fileHandle = INVALID_HANDLE_VALUE;-
134 mapHandle = NULL;-
135#ifndef Q_OS_WINCE-
136 cachedFd = -1;-
137#endif-
138#endif-
139}
executed 45898 times by 210 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
  • ...
45898
140-
141/*!-
142 Constructs a QFSFileEngine for the file name \a file.-
143*/-
144QFSFileEngine::QFSFileEngine(const QString &file)-
145 : QAbstractFileEngine(*new QFSFileEnginePrivate)-
146{-
147 Q_D(QFSFileEngine);-
148 d->fileEntry = QFileSystemEntry(file);-
149}
executed 43098 times by 205 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
  • ...
43098
150-
151/*!-
152 Constructs a QFSFileEngine.-
153*/-
154QFSFileEngine::QFSFileEngine() : QAbstractFileEngine(*new QFSFileEnginePrivate)-
155{-
156}
executed 2548 times by 30 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QPrinterInfo
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • ...
2548
157-
158/*!-
159 \internal-
160*/-
161QFSFileEngine::QFSFileEngine(QFSFileEnginePrivate &dd)-
162 : QAbstractFileEngine(dd)-
163{-
164}
never executed: end of block
0
165-
166/*!-
167 Destructs the QFSFileEngine.-
168*/-
169QFSFileEngine::~QFSFileEngine()-
170{-
171 Q_D(QFSFileEngine);-
172 if (d->closeFileHandle) {
d->closeFileHandleDescription
TRUEevaluated 27812 times by 175 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 17824 times by 119 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QApplication
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • ...
17824-27812
173 if (d->fh) {
d->fhDescription
TRUEnever evaluated
FALSEevaluated 27812 times by 175 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-27812
174 fclose(d->fh);-
175 } else if (d->fd != -1) {
never executed: end of block
d->fd != -1Description
TRUEnever evaluated
FALSEevaluated 27812 times by 175 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-27812
176 QT_CLOSE(d->fd);-
177 }
never executed: end of block
0
178 }
executed 27812 times by 175 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
  • ...
27812
179 d->unmapAll();-
180}
executed 45636 times by 212 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
  • ...
45636
181-
182/*!-
183 \reimp-
184*/-
185void QFSFileEngine::setFileName(const QString &file)-
186{-
187 Q_D(QFSFileEngine);-
188 d->init();-
189 d->fileEntry = QFileSystemEntry(file);-
190}
executed 252 times by 15 tests: end of block
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
252
191-
192/*!-
193 \reimp-
194*/-
195bool QFSFileEngine::open(QIODevice::OpenMode openMode)-
196{-
197 Q_D(QFSFileEngine);-
198 if (d->fileEntry.isEmpty()) {
d->fileEntry.isEmpty()Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QFile
  • tst_QNetworkDiskCache
FALSEevaluated 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
  • ...
3-29427
199 qWarning("QFSFileEngine::open: No file name specified");-
200 setError(QFile::OpenError, QLatin1String("No file name specified"));-
201 return false;
executed 3 times by 2 tests: return false;
Executed by:
  • tst_QFile
  • tst_QNetworkDiskCache
3
202 }-
203-
204 // Append implies WriteOnly.-
205 if (openMode & QFile::Append)
openMode & 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
206 openMode |= QFile::WriteOnly;
executed 257 times by 6 tests: openMode |= QFile::WriteOnly;
Executed by:
  • tst_QAbstractFileEngine
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_qfileopenevent
  • tst_qmakelib
257
207-
208 // WriteOnly implies Truncate if neither ReadOnly nor Append are sent.-
209 if ((openMode & QFile::WriteOnly) && !(openMode & (QFile::ReadOnly | QFile::Append)))
!(openMode & (...File::Append))Description
TRUEevaluated 1513 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 890 times by 20 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QColorDialog
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QNetworkDiskCache
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_QTextStream
  • tst_languageChange
  • tst_qfileopenevent
  • tst_qmakelib
890-1513
210 openMode |= QFile::Truncate;
executed 1513 times by 37 tests: openMode |= QFile::Truncate;
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
  • ...
1513
211-
212 d->openMode = openMode;-
213 d->lastFlushFailed = false;-
214 d->tried_stat = 0;-
215 d->fh = 0;-
216 d->fd = -1;-
217-
218 return d->nativeOpen(openMode);
executed 29427 times by 183 tests: return d->nativeOpen(openMode);
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
219}-
220-
221/*!-
222 Opens the file handle \a fh in \a openMode mode. Returns \c true on-
223 success; otherwise returns \c false.-
224*/-
225bool QFSFileEngine::open(QIODevice::OpenMode openMode, FILE *fh)-
226{-
227 return open(openMode, fh, QFile::DontCloseHandle);
never executed: return open(openMode, fh, QFile::DontCloseHandle);
0
228}-
229-
230bool QFSFileEngine::open(QIODevice::OpenMode openMode, FILE *fh, QFile::FileHandleFlags handleFlags)-
231{-
232 Q_D(QFSFileEngine);-
233-
234 // Append implies WriteOnly.-
235 if (openMode & QFile::Append)
openMode & QFile::AppendDescription
TRUEnever evaluated
FALSEevaluated 364 times by 5 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
0-364
236 openMode |= QFile::WriteOnly;
never executed: openMode |= QFile::WriteOnly;
0
237-
238 // WriteOnly implies Truncate if neither ReadOnly nor Append are sent.-
239 if ((openMode & QFile::WriteOnly) && !(openMode & (QFile::ReadOnly | QFile::Append)))
!(openMode & (...File::Append))Description
TRUEevaluated 212 times by 4 tests
Evaluated by:
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QFile
  • tst_qnetworkreply - unknown status
9-212
240 openMode |= QFile::Truncate;
executed 212 times by 4 tests: openMode |= QFile::Truncate;
Executed by:
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
212
241-
242 d->openMode = openMode;-
243 d->lastFlushFailed = false;-
244 d->closeFileHandle = (handleFlags & QFile::AutoCloseHandle);-
245 d->fileEntry.clear();-
246 d->tried_stat = 0;-
247 d->fd = -1;-
248-
249 return d->openFh(openMode, fh);
executed 364 times by 5 tests: return d->openFh(openMode, fh);
Executed by:
  • tst_LargeFile
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
364
250}-
251-
252/*!-
253 Opens the file handle \a fh using the open mode \a flags.-
254*/-
255bool QFSFileEnginePrivate::openFh(QIODevice::OpenMode openMode, FILE *fh)-
256{-
257 Q_Q(QFSFileEngine);-
258 this->fh = fh;-
259 fd = -1;-
260-
261 // Seek to the end when in Append mode.-
262 if (openMode & QIODevice::Append) {
openMode & QIODevice::AppendDescription
TRUEnever evaluated
FALSEevaluated 364 times by 5 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
0-364
263 int ret;-
264 do {-
265 ret = QT_FSEEK(fh, 0, SEEK_END);-
266 } while (ret != 0 && errno == EINTR);
never executed: end of block
ret != 0Description
TRUEnever evaluated
FALSEnever evaluated
(*__errno_location ()) == 4Description
TRUEnever evaluated
FALSEnever evaluated
0
267-
268 if (ret != 0) {
ret != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
269 q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError,-
270 qt_error_string(int(errno)));-
271-
272 this->openMode = QIODevice::NotOpen;-
273 this->fh = 0;-
274-
275 return false;
never executed: return false;
0
276 }-
277 }
never executed: end of block
0
278-
279 return true;
executed 364 times by 5 tests: return true;
Executed by:
  • tst_LargeFile
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
364
280}-
281-
282/*!-
283 Opens the file descriptor \a fd in \a openMode mode. Returns \c true-
284 on success; otherwise returns \c false.-
285*/-
286bool QFSFileEngine::open(QIODevice::OpenMode openMode, int fd)-
287{-
288 return open(openMode, fd, QFile::DontCloseHandle);
never executed: return open(openMode, fd, QFile::DontCloseHandle);
0
289}-
290-
291bool QFSFileEngine::open(QIODevice::OpenMode openMode, int fd, QFile::FileHandleFlags handleFlags)-
292{-
293 Q_D(QFSFileEngine);-
294-
295 // Append implies WriteOnly.-
296 if (openMode & QFile::Append)
openMode & QFile::AppendDescription
TRUEnever evaluated
FALSEevaluated 29 times by 3 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
0-29
297 openMode |= QFile::WriteOnly;
never executed: openMode |= QFile::WriteOnly;
0
298-
299 // WriteOnly implies Truncate if neither ReadOnly nor Append are sent.-
300 if ((openMode & QFile::WriteOnly) && !(openMode & (QFile::ReadOnly | QFile::Append)))
!(openMode & (...File::Append))Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
1-4
301 openMode |= QFile::Truncate;
executed 4 times by 1 test: openMode |= QFile::Truncate;
Executed by:
  • tst_QFile
4
302-
303 d->openMode = openMode;-
304 d->lastFlushFailed = false;-
305 d->closeFileHandle = (handleFlags & QFile::AutoCloseHandle);-
306 d->fileEntry.clear();-
307 d->fh = 0;-
308 d->fd = -1;-
309 d->tried_stat = 0;-
310-
311 return d->openFd(openMode, fd);
executed 29 times by 3 tests: return d->openFd(openMode, fd);
Executed by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
29
312}-
313-
314-
315/*!-
316 Opens the file descriptor \a fd to the file engine, using the open mode \a-
317 flags.-
318*/-
319bool QFSFileEnginePrivate::openFd(QIODevice::OpenMode openMode, int fd)-
320{-
321 Q_Q(QFSFileEngine);-
322 this->fd = fd;-
323 fh = 0;-
324-
325 // Seek to the end when in Append mode.-
326 if (openMode & QFile::Append) {
openMode & QFile::AppendDescription
TRUEnever evaluated
FALSEevaluated 29 times by 3 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
0-29
327 int ret;-
328 do {-
329 ret = QT_LSEEK(fd, 0, SEEK_END);-
330 } while (ret == -1 && errno == EINTR);
never executed: end of block
ret == -1Description
TRUEnever evaluated
FALSEnever evaluated
(*__errno_location ()) == 4Description
TRUEnever evaluated
FALSEnever evaluated
0
331-
332 if (ret == -1) {
ret == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
333 q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError,-
334 qt_error_string(int(errno)));-
335-
336 this->openMode = QIODevice::NotOpen;-
337 this->fd = -1;-
338-
339 return false;
never executed: return false;
0
340 }-
341 }
never executed: end of block
0
342-
343 return true;
executed 29 times by 3 tests: return true;
Executed by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
29
344}-
345-
346/*!-
347 \reimp-
348*/-
349bool QFSFileEngine::close()-
350{-
351 Q_D(QFSFileEngine);-
352 d->openMode = QIODevice::NotOpen;-
353 return d->nativeClose();
executed 30628 times by 176 tests: return d->nativeClose();
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
354}-
355-
356/*!-
357 \internal-
358*/-
359bool QFSFileEnginePrivate::closeFdFh()-
360{-
361 Q_Q(QFSFileEngine);-
362 if (fd == -1 && !fh)
fd == -1Description
TRUEevaluated 2306 times by 29 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qdbuscpp2xml - unknown status
  • ...
FALSEevaluated 28322 times by 174 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
  • ...
!fhDescription
TRUEevaluated 1942 times by 25 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_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qdbusmarshall - unknown status
  • tst_qlockfile - unknown status
FALSEevaluated 364 times by 5 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
364-28322
363 return false;
executed 1942 times by 25 tests: return false;
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_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qdbusmarshall - unknown status
  • tst_qlockfile - unknown status
1942
364-
365 // Flush the file if it's buffered, and if the last flush didn't fail.-
366 bool flushed = !fh || (!lastFlushFailed && q->flush());
!fhDescription
TRUEevaluated 28322 times by 174 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 364 times by 5 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
!lastFlushFailedDescription
TRUEevaluated 364 times by 5 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEnever evaluated
q->flush()Description
TRUEevaluated 364 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-28322
367 bool closed = true;-
368 tried_stat = 0;-
369-
370 // Close the file if we created the handle.-
371 if (closeFileHandle) {
closeFileHandleDescription
TRUEevaluated 28295 times by 174 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 391 times by 6 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
391-28295
372 int ret;-
373-
374 if (fh) {
fhDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 28294 times by 174 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
  • ...
1-28294
375 // Close buffered file.-
376 ret = fclose(fh);-
377 } else {
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFile
1
378 // Close unbuffered file.-
379 ret = QT_CLOSE(fd);-
380 }
executed 28294 times by 174 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
  • ...
28294
381-
382 // We must reset these guys regardless; calling close again after a-
383 // failed close causes crashes on some systems.-
384 fh = 0;-
385 fd = -1;-
386 closed = (ret == 0);-
387 }
executed 28295 times by 174 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
  • ...
28295
388-
389 // Report errors.-
390 if (!flushed || !closed) {
!flushedDescription
TRUEnever evaluated
FALSEevaluated 28686 times by 176 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
  • ...
!closedDescription
TRUEnever evaluated
FALSEevaluated 28686 times by 176 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-28686
391 if (flushed) {
flushedDescription
TRUEnever evaluated
FALSEnever evaluated
0
392 // If not flushed, we want the flush error to fall through.-
393 q->setError(QFile::UnspecifiedError, qt_error_string(errno));-
394 }
never executed: end of block
0
395 return false;
never executed: return false;
0
396 }-
397-
398 return true;
executed 28686 times by 176 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
  • ...
28686
399}-
400-
401/*!-
402 \reimp-
403*/-
404bool QFSFileEngine::flush()-
405{-
406 Q_D(QFSFileEngine);-
407 if ((d->openMode & QIODevice::WriteOnly) == 0) {
(d->openMode &...riteOnly) == 0Description
TRUEevaluated 182041 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 27602 times by 52 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
  • ...
27602-182041
408 // Nothing in the write buffers, so flush succeeds in doing-
409 // nothing.-
410 return true;
executed 182041 times by 168 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
  • ...
182041
411 }-
412 return d->nativeFlush();
executed 27602 times by 52 tests: return d->nativeFlush();
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
  • ...
27602
413}-
414-
415/*!-
416 \reimp-
417*/-
418bool QFSFileEngine::syncToDisk()-
419{-
420 Q_D(QFSFileEngine);-
421 if ((d->openMode & QIODevice::WriteOnly) == 0)
(d->openMode &...riteOnly) == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSaveFile
FALSEevaluated 572 times by 7 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
2-572
422 return true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_QSaveFile
2
423 return d->nativeSyncToDisk();
executed 572 times by 7 tests: return d->nativeSyncToDisk();
Executed by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
572
424}-
425-
426/*!-
427 \internal-
428*/-
429bool QFSFileEnginePrivate::flushFh()-
430{-
431 Q_Q(QFSFileEngine);-
432-
433 // Never try to flush again if the last flush failed. Otherwise you can-
434 // get crashes on some systems (AIX).-
435 if (lastFlushFailed)
lastFlushFailedDescription
TRUEnever evaluated
FALSEevaluated 459 times by 4 tests
Evaluated by:
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
0-459
436 return false;
never executed: return false;
0
437-
438 int ret = fflush(fh);-
439-
440 lastFlushFailed = (ret != 0);-
441 lastIOCommand = QFSFileEnginePrivate::IOFlushCommand;-
442-
443 if (ret != 0) {
ret != 0Description
TRUEnever evaluated
FALSEevaluated 459 times by 4 tests
Evaluated by:
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
0-459
444 q->setError(errno == ENOSPC ? QFile::ResourceError : QFile::WriteError,-
445 qt_error_string(errno));-
446 return false;
never executed: return false;
0
447 }-
448 return true;
executed 459 times by 4 tests: return true;
Executed by:
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
459
449}-
450-
451/*!-
452 \reimp-
453*/-
454qint64 QFSFileEngine::size() const-
455{-
456 Q_D(const QFSFileEngine);-
457 return d->nativeSize();
executed 133007 times by 157 tests: return d->nativeSize();
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
458}-
459-
460/*!-
461 \internal-
462*/-
463void QFSFileEnginePrivate::unmapAll()-
464{-
465 if (!maps.isEmpty()) {
!maps.isEmpty()Description
TRUEevaluated 1463 times by 120 tests
Evaluated by:
  • 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
  • tst_QFiledialog
  • ...
FALSEevaluated 46682 times by 154 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QApplication
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • ...
1463-46682
466 const QList<uchar*> keys = maps.keys(); // Make a copy since unmap() modifies the map.-
467 for (int i = 0; i < keys.count(); ++i)
i < keys.count()Description
TRUEevaluated 1466 times by 120 tests
Evaluated by:
  • 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
  • tst_QFiledialog
  • ...
FALSEevaluated 1463 times by 120 tests
Evaluated by:
  • 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
  • tst_QFiledialog
  • ...
1463-1466
468 unmap(keys.at(i));
executed 1466 times by 120 tests: unmap(keys.at(i));
Executed by:
  • 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
  • tst_QFiledialog
  • ...
1466
469 }
executed 1463 times by 120 tests: end of block
Executed by:
  • 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
  • tst_QFiledialog
  • ...
1463
470}
executed 48145 times by 212 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
  • ...
48145
471-
472#ifndef Q_OS_WIN-
473/*!-
474 \internal-
475*/-
476qint64 QFSFileEnginePrivate::sizeFdFh() const-
477{-
478 Q_Q(const QFSFileEngine);-
479 const_cast<QFSFileEngine *>(q)->flush();-
480-
481 tried_stat = 0;-
482 metaData.clearFlags(QFileSystemMetaData::SizeAttribute);-
483 if (!doStat(QFileSystemMetaData::SizeAttribute))
!doStat(QFileS...SizeAttribute)Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QFile
  • tst_QNetworkDiskCache
FALSEevaluated 133004 times by 157 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_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • ...
3-133004
484 return 0;
executed 3 times by 2 tests: return 0;
Executed by:
  • tst_QFile
  • tst_QNetworkDiskCache
3
485 return metaData.size();
executed 133004 times by 157 tests: return metaData.size();
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
  • ...
133004
486}-
487#endif-
488-
489/*!-
490 \reimp-
491*/-
492qint64 QFSFileEngine::pos() const-
493{-
494 Q_D(const QFSFileEngine);-
495 return d->nativePos();
executed 282 times by 7 tests: return d->nativePos();
Executed by:
  • tst_QAbstractFileEngine
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QNetworkReply
  • tst_QTemporaryFile
282
496}-
497-
498/*!-
499 \internal-
500*/-
501qint64 QFSFileEnginePrivate::posFdFh() const-
502{-
503 if (fh)
fhDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 281 times by 7 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QNetworkReply
  • tst_QTemporaryFile
1-281
504 return qint64(QT_FTELL(fh));
executed 1 time by 1 test: return qint64(::ftello64(fh));
Executed by:
  • tst_QFile
1
505 return QT_LSEEK(fd, 0, SEEK_CUR);
executed 281 times by 7 tests: return ::lseek64(fd, 0, 1);
Executed by:
  • tst_QAbstractFileEngine
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QNetworkReply
  • tst_QTemporaryFile
281
506}-
507-
508/*!-
509 \reimp-
510*/-
511bool QFSFileEngine::seek(qint64 pos)-
512{-
513 Q_D(QFSFileEngine);-
514 return d->nativeSeek(pos);
executed 222097 times by 50 tests: return d->nativeSeek(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
515}-
516-
517/*!-
518 \internal-
519*/-
520bool QFSFileEnginePrivate::seekFdFh(qint64 pos)-
521{-
522 Q_Q(QFSFileEngine);-
523-
524 // On Windows' stdlib implementation, the results of calling fread and-
525 // fwrite are undefined if not called either in sequence, or if preceded-
526 // with a call to fflush().-
527 if (lastIOCommand != QFSFileEnginePrivate::IOFlushCommand && !q->flush())
lastIOCommand ...IOFlushCommandDescription
TRUEevaluated 5641 times by 41 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QDataStream
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • 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_QMimeDatabase
  • tst_QMovie
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • ...
FALSEevaluated 216456 times by 33 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QColorDialog
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcoImageFormat
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMovie
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QRawFont
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSharedPointer
  • ...
!q->flush()Description
TRUEnever evaluated
FALSEevaluated 5641 times by 41 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QDataStream
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • 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_QMimeDatabase
  • tst_QMovie
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • ...
0-216456
528 return false;
never executed: return false;
0
529-
530 if (pos < 0 || pos != qint64(QT_OFF_T(pos)))
pos < 0Description
TRUEnever evaluated
FALSEevaluated 222097 times by 50 tests
Evaluated 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
  • ...
pos != qint64(off64_t(pos))Description
TRUEnever evaluated
FALSEevaluated 222097 times by 50 tests
Evaluated 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
  • ...
0-222097
531 return false;
never executed: return false;
0
532-
533 if (fh) {
fhDescription
TRUEevaluated 19 times by 2 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
FALSEevaluated 222078 times by 50 tests
Evaluated 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
  • ...
19-222078
534 // Buffered stdlib mode.-
535 int ret;-
536 do {-
537 ret = QT_FSEEK(fh, QT_OFF_T(pos), SEEK_SET);-
538 } while (ret != 0 && errno == EINTR);
executed 19 times by 2 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QFile
ret != 0Description
TRUEnever evaluated
FALSEevaluated 19 times by 2 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
(*__errno_location ()) == 4Description
TRUEnever evaluated
FALSEnever evaluated
0-19
539-
540 if (ret != 0) {
ret != 0Description
TRUEnever evaluated
FALSEevaluated 19 times by 2 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
0-19
541 q->setError(QFile::ReadError, qt_error_string(int(errno)));-
542 return false;
never executed: return false;
0
543 }-
544 } else {
executed 19 times by 2 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QFile
19
545 // Unbuffered stdio mode.-
546 if (QT_LSEEK(fd, QT_OFF_T(pos), SEEK_SET) == -1) {
::lseek64(fd, ...pos), 0) == -1Description
TRUEnever evaluated
FALSEevaluated 222078 times by 50 tests
Evaluated 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
  • ...
0-222078
547 qWarning() << "QFile::at: Cannot set file position" << pos;-
548 q->setError(QFile::PositionError, qt_error_string(errno));-
549 return false;
never executed: return false;
0
550 }-
551 }
executed 222078 times by 50 tests: end of block
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
  • ...
222078
552 return true;
executed 222097 times by 50 tests: return true;
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
553}-
554-
555/*!-
556 \reimp-
557*/-
558int QFSFileEngine::handle() const-
559{-
560 Q_D(const QFSFileEngine);-
561 return d->nativeHandle();
executed 57 times by 13 tests: return d->nativeHandle();
Executed by:
  • tst_QColorDialog
  • tst_QDBusMarshall
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLockFile
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_QTranslator
  • tst_languageChange
  • tst_qlockfile - unknown status
57
562}-
563-
564/*!-
565 \reimp-
566*/-
567qint64 QFSFileEngine::read(char *data, qint64 maxlen)-
568{-
569 Q_D(QFSFileEngine);-
570-
571 // On Windows' stdlib implementation, the results of calling fread and-
572 // fwrite are undefined if not called either in sequence, or if preceded-
573 // with a call to fflush().-
574 if (d->lastIOCommand != QFSFileEnginePrivate::IOReadCommand) {
d->lastIOComma...:IOReadCommandDescription
TRUEevaluated 21392 times by 99 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
  • ...
FALSEevaluated 59049 times by 37 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QChar
  • tst_QCryptographicHash
  • tst_QDataStream
  • tst_QFile
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLayout
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QMovie
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinterInfo
  • tst_QRawFont
  • tst_QSaveFile
  • tst_QSettings
  • ...
21392-59049
575 flush();-
576 d->lastIOCommand = QFSFileEnginePrivate::IOReadCommand;-
577 }
executed 21392 times by 99 tests: end of block
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
  • ...
21392
578-
579 return d->nativeRead(data, maxlen);
executed 80441 times by 99 tests: return d->nativeRead(data, maxlen);
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
  • ...
80441
580}-
581-
582/*!-
583 \internal-
584*/-
585qint64 QFSFileEnginePrivate::readFdFh(char *data, qint64 len)-
586{-
587 Q_Q(QFSFileEngine);-
588-
589 if (len < 0 || len != qint64(size_t(len))) {
len < 0Description
TRUEnever evaluated
FALSEevaluated 80052 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
  • ...
len != qint64(size_t(len))Description
TRUEnever evaluated
FALSEevaluated 80052 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
  • ...
0-80052
590 q->setError(QFile::ReadError, qt_error_string(EINVAL));-
591 return -1;
never executed: return -1;
0
592 }-
593-
594 qint64 readBytes = 0;-
595 bool eof = false;-
596-
597 if (fh) {
fhDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QFile
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
  • ...
5-80047
598 // Buffered stdlib mode.-
599-
600 size_t result;-
601 bool retry = true;-
602 do {-
603 result = fread(data + readBytes, 1, size_t(len - readBytes), fh);-
604 eof = feof(fh);-
605 if (retry && eof && result == 0) {
retryDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QFile
FALSEnever evaluated
eofDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
result == 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFile
0-5
606 // On OS X, this is needed, e.g., if a file was written to-
607 // through another stream since our last read. See test-
608 // tst_QFile::appendAndRead-
609 QT_FSEEK(fh, QT_FTELL(fh), SEEK_SET); // re-sync stream.-
610 retry = false;-
611 continue;
never executed: continue;
0
612 }-
613 readBytes += result;-
614 } while (!eof && (result == 0 ? errno == EINTR : readBytes < len));
executed 5 times by 1 test: end of block
Executed by:
  • tst_QFile
result == 0Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
!eofDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFile
(result == 0 ?...adBytes < len)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
0-5
615-
616 } else if (fd != -1) {
executed 5 times by 1 test: end of block
Executed by:
  • tst_QFile
fd != -1Description
TRUEevaluated 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
  • ...
FALSEnever evaluated
0-80047
617 // Unbuffered stdio mode.-
618-
619 SignedIOType result;-
620 do {-
621 // calculate the chunk size-
622 // on Windows or 32-bit no-largefile Unix, we'll need to read in chunks-
623 // we limit to the size of the signed type, otherwise we could get a negative number as a result-
624 quint64 wantedBytes = quint64(len) - quint64(readBytes);-
625 UnsignedIOType chunkSize = std::numeric_limits<SignedIOType>::max();-
626 if (chunkSize > wantedBytes)
chunkSize > wantedBytesDescription
TRUEevaluated 101250 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
  • ...
FALSEnever evaluated
0-101250
627 chunkSize = wantedBytes;
executed 101250 times by 97 tests: chunkSize = wantedBytes;
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
  • ...
101250
628 result = QT_READ(fd, data + readBytes, chunkSize);-
629 } while (result > 0 && (readBytes += result) < len);
executed 101250 times by 97 tests: end of block
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
  • ...
result > 0Description
TRUEevaluated 34910 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
  • ...
FALSEevaluated 66340 times by 72 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractNetworkCache
  • tst_QChar
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDebug
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFontDatabase
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLayout
  • ...
(readBytes += result) < lenDescription
TRUEevaluated 21203 times by 72 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractNetworkCache
  • tst_QChar
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDebug
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFontDatabase
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLayout
  • ...
FALSEevaluated 13707 times by 63 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
13707-101250
630-
631 eof = !(result == -1);-
632 }
executed 80047 times by 97 tests: end of block
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
  • ...
80047
633-
634 if (!eof && readBytes == 0) {
!eofDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 80051 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
  • ...
readBytes == 0Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
0-80051
635 readBytes = -1;-
636 q->setError(QFile::ReadError, qt_error_string(errno));-
637 }
never executed: end of block
0
638-
639 return readBytes;
executed 80052 times by 97 tests: return readBytes;
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
640}-
641-
642/*!-
643 \reimp-
644*/-
645qint64 QFSFileEngine::readLine(char *data, qint64 maxlen)-
646{-
647 Q_D(QFSFileEngine);-
648-
649 // On Windows' stdlib implementation, the results of calling fread and-
650 // fwrite are undefined if not called either in sequence, or if preceded-
651 // with a call to fflush().-
652 if (d->lastIOCommand != QFSFileEnginePrivate::IOReadCommand) {
d->lastIOComma...:IOReadCommandDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFile
4
653 flush();-
654 d->lastIOCommand = QFSFileEnginePrivate::IOReadCommand;-
655 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QFile
4
656-
657 return d->nativeReadLine(data, maxlen);
executed 8 times by 1 test: return d->nativeReadLine(data, maxlen);
Executed by:
  • tst_QFile
8
658}-
659-
660/*!-
661 \internal-
662*/-
663qint64 QFSFileEnginePrivate::readLineFdFh(char *data, qint64 maxlen)-
664{-
665 Q_Q(QFSFileEngine);-
666 if (!fh)
!fhDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QFile
FALSEnever evaluated
0-8
667 return q->QAbstractFileEngine::readLine(data, maxlen);
executed 8 times by 1 test: return q->QAbstractFileEngine::readLine(data, maxlen);
Executed by:
  • tst_QFile
8
668-
669 QT_OFF_T oldPos = 0;-
670#ifdef Q_OS_WIN-
671 bool seq = q->isSequential();-
672 if (!seq)-
673#endif-
674 oldPos = QT_FTELL(fh);-
675-
676 // QIODevice::readLine() passes maxlen - 1 to QFile::readLineData()-
677 // because it has made space for the '\0' at the end of data. But fgets-
678 // does the same, so we'd get two '\0' at the end - passing maxlen + 1-
679 // solves this.-
680 if (!fgets(data, int(maxlen + 1), fh)) {
!fgets(data, i...xlen + 1), fh)Description
TRUEnever evaluated
FALSEnever evaluated
0
681 if (!feof(fh))
!feof(fh)Description
TRUEnever evaluated
FALSEnever evaluated
0
682 q->setError(QFile::ReadError, qt_error_string(int(errno)));
never executed: q->setError(QFile::ReadError, qt_error_string(int((*__errno_location ()))));
0
683 return -1; // error
never executed: return -1;
0
684 }-
685-
686#ifdef Q_OS_WIN-
687 if (seq)-
688 return qstrlen(data);-
689#endif-
690-
691 qint64 lineLength = QT_FTELL(fh) - oldPos;-
692 return lineLength > 0 ? lineLength : qstrlen(data);
never executed: return lineLength > 0 ? lineLength : qstrlen(data);
lineLength > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
693}-
694-
695/*!-
696 \reimp-
697*/-
698qint64 QFSFileEngine::write(const char *data, qint64 len)-
699{-
700 Q_D(QFSFileEngine);-
701-
702 // On Windows' stdlib implementation, the results of calling fread and-
703 // fwrite are undefined if not called either in sequence, or if preceded-
704 // with a call to fflush().-
705 if (d->lastIOCommand != QFSFileEnginePrivate::IOWriteCommand) {
d->lastIOComma...IOWriteCommandDescription
TRUEevaluated 2390 times by 45 tests
Evaluated 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
  • ...
FALSEevaluated 16743 times by 15 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QDataStream
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QFtp
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_QTextStream
2390-16743
706 flush();-
707 d->lastIOCommand = QFSFileEnginePrivate::IOWriteCommand;-
708 }
executed 2390 times by 45 tests: end of block
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
  • ...
2390
709-
710 return d->nativeWrite(data, len);
executed 19133 times by 45 tests: return d->nativeWrite(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
711}-
712-
713/*!-
714 \internal-
715*/-
716qint64 QFSFileEnginePrivate::writeFdFh(const char *data, qint64 len)-
717{-
718 Q_Q(QFSFileEngine);-
719-
720 if (len < 0 || len != qint64(size_t(len))) {
len < 0Description
TRUEnever evaluated
FALSEevaluated 19133 times by 45 tests
Evaluated 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
  • ...
len != qint64(size_t(len))Description
TRUEnever evaluated
FALSEevaluated 19133 times by 45 tests
Evaluated 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
  • ...
0-19133
721 q->setError(QFile::WriteError, qt_error_string(EINVAL));-
722 return -1;
never executed: return -1;
0
723 }-
724-
725 qint64 writtenBytes = 0;-
726-
727 if (len) { // avoid passing nullptr to fwrite() or QT_WRITE() (UB)
lenDescription
TRUEevaluated 19130 times by 45 tests
Evaluated 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
  • ...
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFile
3-19130
728-
729 if (fh) {
fhDescription
TRUEevaluated 210 times by 4 tests
Evaluated by:
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
FALSEevaluated 18920 times by 42 tests
Evaluated 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
  • ...
210-18920
730 // Buffered stdlib mode.-
731-
732 size_t result;-
733 do {-
734 result = fwrite(data + writtenBytes, 1, size_t(len - writtenBytes), fh);-
735 writtenBytes += result;-
736 } while (result == 0 ? errno == EINTR : writtenBytes < len);
executed 210 times by 4 tests: end of block
Executed by:
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
result == 0 ? ...tenBytes < lenDescription
TRUEnever evaluated
FALSEevaluated 210 times by 4 tests
Evaluated by:
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
result == 0Description
TRUEnever evaluated
FALSEevaluated 210 times by 4 tests
Evaluated by:
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
0-210
737-
738 } else if (fd != -1) {
executed 210 times by 4 tests: end of block
Executed by:
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
fd != -1Description
TRUEevaluated 18920 times by 42 tests
Evaluated 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
  • ...
FALSEnever evaluated
0-18920
739 // Unbuffered stdio mode.-
740-
741 SignedIOType result;-
742 do {-
743 // calculate the chunk size-
744 // on Windows or 32-bit no-largefile Unix, we'll need to read in chunks-
745 // we limit to the size of the signed type, otherwise we could get a negative number as a result-
746 quint64 wantedBytes = quint64(len) - quint64(writtenBytes);-
747 UnsignedIOType chunkSize = std::numeric_limits<SignedIOType>::max();-
748 if (chunkSize > wantedBytes)
chunkSize > wantedBytesDescription
TRUEevaluated 18920 times by 42 tests
Evaluated 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
  • ...
FALSEnever evaluated
0-18920
749 chunkSize = wantedBytes;
executed 18920 times by 42 tests: chunkSize = wantedBytes;
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
  • ...
18920
750 result = QT_WRITE(fd, data + writtenBytes, chunkSize);-
751 } while (result > 0 && (writtenBytes += result) < len);
executed 18920 times by 42 tests: end of block
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
  • ...
result > 0Description
TRUEevaluated 18914 times by 42 tests
Evaluated 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
  • ...
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QFile
(writtenBytes += result) < lenDescription
TRUEnever evaluated
FALSEevaluated 18914 times by 42 tests
Evaluated 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
  • ...
0-18920
752 }
executed 18920 times by 42 tests: end of block
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
  • ...
18920
753-
754 }
executed 19130 times by 45 tests: end of block
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
  • ...
19130
755-
756 if (len && writtenBytes == 0) {
lenDescription
TRUEevaluated 19130 times by 45 tests
Evaluated 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
  • ...
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFile
writtenBytes == 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 19124 times by 45 tests
Evaluated 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
  • ...
3-19130
757 writtenBytes = -1;-
758 q->setError(errno == ENOSPC ? QFile::ResourceError : QFile::WriteError, qt_error_string(errno));-
759 } else {
executed 6 times by 1 test: end of block
Executed by:
  • tst_QFile
6
760 // reset the cached size, if any-
761 metaData.clearFlags(QFileSystemMetaData::SizeAttribute);-
762 }
executed 19127 times by 45 tests: end of block
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
  • ...
19127
763-
764 return writtenBytes;
executed 19133 times by 45 tests: return writtenBytes;
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
765}-
766-
767#ifndef QT_NO_FILESYSTEMITERATOR-
768/*!-
769 \internal-
770*/-
771QAbstractFileEngine::Iterator *QFSFileEngine::beginEntryList(QDir::Filters filters, const QStringList &filterNames)-
772{-
773 return new QFSFileEngineIterator(filters, filterNames);
never executed: return new QFSFileEngineIterator(filters, filterNames);
0
774}-
775-
776/*!-
777 \internal-
778*/-
779QAbstractFileEngine::Iterator *QFSFileEngine::endEntryList()-
780{-
781 return 0;
never executed: return 0;
0
782}-
783#endif // QT_NO_FILESYSTEMITERATOR-
784-
785/*!-
786 \internal-
787*/-
788QStringList QFSFileEngine::entryList(QDir::Filters filters, const QStringList &filterNames) const-
789{-
790 return QAbstractFileEngine::entryList(filters, filterNames);
never executed: return QAbstractFileEngine::entryList(filters, filterNames);
0
791}-
792-
793/*!-
794 \reimp-
795*/-
796bool QFSFileEngine::isSequential() const-
797{-
798 Q_D(const QFSFileEngine);-
799 if (d->is_sequential == 0)
d->is_sequential == 0Description
TRUEevaluated 23907 times by 105 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_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • ...
FALSEevaluated 18381 times by 42 tests
Evaluated by:
  • tst_LargeFile
  • tst_QChar
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDebug
  • tst_QFile
  • tst_QFileSystemWatcher
  • tst_QFrame
  • tst_QGraphicsScene
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QMovie
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QPixmap
  • tst_QPixmapFilter
  • tst_QPrinter
  • ...
18381-23907
800 d->is_sequential = d->nativeIsSequential() ? 1 : 2;
executed 23907 times by 105 tests: d->is_sequential = d->nativeIsSequential() ? 1 : 2;
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
  • ...
d->nativeIsSequential()Description
TRUEevaluated 360 times by 8 tests
Evaluated by:
  • tst_QFile
  • tst_QPrinterInfo
  • tst_QRawFont
  • tst_QUuid
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
  • tst_quuid - unknown status
FALSEevaluated 23547 times by 99 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_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • ...
360-23907
801 return d->is_sequential == 1;
executed 42288 times by 105 tests: return d->is_sequential == 1;
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
  • ...
42288
802}-
803-
804/*!-
805 \internal-
806*/-
807#ifdef Q_OS_UNIX-
808bool QFSFileEnginePrivate::isSequentialFdFh() const-
809{-
810 if (doStat(QFileSystemMetaData::SequentialType))
doStat(QFileSy...equentialType)Description
TRUEevaluated 24301 times by 105 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_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • ...
FALSEnever evaluated
0-24301
811 return metaData.isSequential();
executed 24301 times by 105 tests: return metaData.isSequential();
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
812 return true;
never executed: return true;
0
813}-
814#endif-
815-
816/*!-
817 \reimp-
818*/-
819bool QFSFileEngine::extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output)-
820{-
821 Q_D(QFSFileEngine);-
822 if (extension == AtEndExtension && d->fh && isSequential())
extension == AtEndExtensionDescription
TRUEnever evaluated
FALSEevaluated 67084 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
  • ...
d->fhDescription
TRUEnever evaluated
FALSEnever evaluated
isSequential()Description
TRUEnever evaluated
FALSEnever evaluated
0-67084
823 return feof(d->fh);
never executed: return feof(d->fh);
0
824-
825 if (extension == MapExtension) {
extension == MapExtensionDescription
TRUEevaluated 34279 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 32805 times by 2 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
32805-34279
826 const MapExtensionOption *options = (const MapExtensionOption*)(option);-
827 MapExtensionReturn *returnValue = static_cast<MapExtensionReturn*>(output);-
828 returnValue->address = d->map(options->offset, options->size, options->flags);-
829 return (returnValue->address != 0);
executed 34279 times by 119 tests: return (returnValue->address != 0);
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
  • ...
34279
830 }-
831 if (extension == UnMapExtension) {
extension == UnMapExtensionDescription
TRUEevaluated 32805 times by 2 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
FALSEnever evaluated
0-32805
832 const UnMapExtensionOption *options = (const UnMapExtensionOption*)option;-
833 return d->unmap(options->address);
executed 32805 times by 2 tests: return d->unmap(options->address);
Executed by:
  • tst_LargeFile
  • tst_QFile
32805
834 }-
835-
836 return false;
never executed: return false;
0
837}-
838-
839/*!-
840 \reimp-
841*/-
842bool QFSFileEngine::supportsExtension(Extension extension) const-
843{-
844 Q_D(const QFSFileEngine);-
845 if (extension == AtEndExtension && d->fh && isSequential())
extension == AtEndExtensionDescription
TRUEevaluated 4299 times by 27 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QChar
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDebug
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QIODevice
  • tst_QImageReader
  • tst_QLayout
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSplitter
  • tst_QTemporaryDir
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_QTimeZone
  • tst_QXmlSimpleReader
  • tst_QXmlStream
  • tst_Spdy
  • tst_qmakelib
  • ...
FALSEevaluated 67655 times by 126 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_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFile
  • ...
d->fhDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 4295 times by 27 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QChar
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDebug
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QIODevice
  • tst_QImageReader
  • tst_QLayout
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSplitter
  • tst_QTemporaryDir
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_QTimeZone
  • tst_QXmlSimpleReader
  • tst_QXmlStream
  • tst_Spdy
  • tst_qmakelib
  • ...
isSequential()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFile
0-67655
846 return true;
never executed: return true;
0
847 if (extension == FastReadLineExtension && d->fh)
extension == F...dLineExtensionDescription
TRUEevaluated 571 times by 15 tests
Evaluated by:
  • tst_QChar
  • tst_QCssParser
  • tst_QDebug
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_selftests - unknown status
FALSEevaluated 71383 times by 134 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_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • ...
d->fhDescription
TRUEnever evaluated
FALSEevaluated 571 times by 15 tests
Evaluated by:
  • tst_QChar
  • tst_QCssParser
  • tst_QDebug
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_selftests - unknown status
0-71383
848 return true;
never executed: return true;
0
849 if (extension == FastReadLineExtension && d->fd != -1 && isSequential())
extension == F...dLineExtensionDescription
TRUEevaluated 571 times by 15 tests
Evaluated by:
  • tst_QChar
  • tst_QCssParser
  • tst_QDebug
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_selftests - unknown status
FALSEevaluated 71383 times by 134 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_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • ...
d->fd != -1Description
TRUEevaluated 571 times by 15 tests
Evaluated by:
  • tst_QChar
  • tst_QCssParser
  • tst_QDebug
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_selftests - unknown status
FALSEnever evaluated
isSequential()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 563 times by 15 tests
Evaluated by:
  • tst_QChar
  • tst_QCssParser
  • tst_QDebug
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_selftests - unknown status
0-71383
850 return true;
executed 8 times by 1 test: return true;
Executed by:
  • tst_QFile
8
851 if (extension == UnMapExtension || extension == MapExtension)
extension == UnMapExtensionDescription
TRUEevaluated 32805 times by 2 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
FALSEevaluated 39141 times by 136 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_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • ...
extension == MapExtensionDescription
TRUEevaluated 34279 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 4862 times by 31 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QChar
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDebug
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLayout
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QSplitter
  • tst_QTemporaryDir
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_QTimeZone
  • ...
4862-39141
852 return true;
executed 67084 times by 119 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_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • ...
67084
853 return false;
executed 4862 times by 31 tests: return false;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QChar
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDebug
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLayout
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QSplitter
  • tst_QTemporaryDir
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_QTimeZone
  • ...
4862
854}-
855-
856/*! \fn bool QFSFileEngine::caseSensitive() const-
857 Returns \c true for Windows, false for Unix.-
858*/-
859-
860/*! \fn bool QFSFileEngine::copy(const QString &copyName)-
861-
862 For windows, copy the file to file \a copyName.-
863-
864 Not implemented for Unix.-
865*/-
866-
867/*! \fn QString QFSFileEngine::currentPath(const QString &fileName)-
868 For Unix, returns the current working directory for the file-
869 engine.-
870-
871 For Windows, returns the canonicalized form of the current path used-
872 by the file engine for the drive specified by \a fileName. On-
873 Windows, each drive has its own current directory, so a different-
874 path is returned for file names that include different drive names-
875 (e.g. A: or C:).-
876-
877 \sa setCurrentPath()-
878*/-
879-
880/*! \fn QFileInfoList QFSFileEngine::drives()-
881 For Windows, returns the list of drives in the file system as a list-
882 of QFileInfo objects. On Unix and Windows CE, only the-
883 root path is returned. On Windows, this function returns all drives-
884 (A:\, C:\, D:\, etc.).-
885-
886 For Unix, the list contains just the root path "/".-
887*/-
888-
889/*! \fn QString QFSFileEngine::fileName(FileName file) const-
890 \reimp-
891*/-
892-
893/*! \fn QDateTime QFSFileEngine::fileTime(FileTime time) const-
894 \reimp-
895*/-
896-
897/*! \fn QString QFSFileEngine::homePath()-
898 Returns the home path of the current user.-
899-
900 \sa rootPath()-
901*/-
902-
903/*! \fn bool QFSFileEngine::isRelativePath() const-
904 \reimp-
905*/-
906-
907/*! \fn bool QFSFileEngine::link(const QString &newName)-
908-
909 Creates a link from the file currently specified by fileName() to-
910 \a newName. What a link is depends on the underlying filesystem-
911 (be it a shortcut on Windows or a symbolic link on Unix). Returns-
912 true if successful; otherwise returns \c false.-
913*/-
914-
915/*! \fn bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) const-
916 \reimp-
917*/-
918-
919/*! \fn uint QFSFileEngine::ownerId(FileOwner own) const-
920 In Unix, if stat() is successful, the \c uid is returned if-
921 \a own is the owner. Otherwise the \c gid is returned. If stat()-
922 is unsuccessful, -2 is reuturned.-
923-
924 For Windows, -2 is always returned.-
925*/-
926-
927/*! \fn QString QFSFileEngine::owner(FileOwner own) const-
928 \reimp-
929*/-
930-
931/*! \fn bool QFSFileEngine::remove()-
932 \reimp-
933*/-
934-
935/*! \fn bool QFSFileEngine::rename(const QString &newName)-
936 \reimp-
937*/-
938-
939-
940/*! \fn bool QFSFileEngine::renameOverwrite(const QString &newName)-
941 \reimp-
942*/-
943-
944/*! \fn bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) const-
945 \reimp-
946*/-
947-
948/*! \fn QString QFSFileEngine::rootPath()-
949 Returns the root path.-
950-
951 \sa homePath()-
952*/-
953-
954/*! \fn bool QFSFileEngine::setCurrentPath(const QString &path)-
955 Sets the current path (e.g., for QDir), to \a path. Returns \c true if the-
956 new path exists; otherwise this function does nothing, and returns \c false.-
957-
958 \sa currentPath()-
959*/-
960-
961/*! \fn bool QFSFileEngine::setPermissions(uint perms)-
962 \reimp-
963*/-
964-
965/*! \fn bool QFSFileEngine::setSize(qint64 size)-
966 \reimp-
967*/-
968-
969/*! \fn QString QFSFileEngine::tempPath()-
970 Returns the temporary path (i.e., a path in which it is safe-
971 to store temporary files).-
972*/-
973-
974/*! \fn QAbstractFileEngine::FileFlags QFSFileEnginePrivate::getPermissions(QAbstractFileEngine::FileFlags type) const-
975 \internal-
976*/-
977-
978QT_END_NAMESPACE-
979-
980#endif // QT_NO_FSFILEENGINE-
Source codeSwitch to Preprocessed file

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