OpenCoverage

qfile.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qfile.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11QFilePrivate::QFilePrivate()-
12{-
13}-
14-
15QFilePrivate::~QFilePrivate()-
16{-
17}-
18-
19bool-
20QFilePrivate::openExternalFile(int flags, int fd, QFile::FileHandleFlags handleFlags)-
21{-
22-
23-
24-
25-
26-
27 delete fileEngine;-
28 fileEngine = 0;-
29 QFSFileEngine *fe = new QFSFileEngine;-
30 fileEngine = fe;-
31 return
executed 29 times by 3 tests: return fe->open(QIODevice::OpenMode(flags), fd, handleFlags);
Executed by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
fe->open(QIODevice::OpenMode(flags), fd, handleFlags);
executed 29 times by 3 tests: return fe->open(QIODevice::OpenMode(flags), fd, handleFlags);
Executed by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
29
32-
33}-
34-
35bool-
36QFilePrivate::openExternalFile(int flags, FILE *fh, QFile::FileHandleFlags handleFlags)-
37{-
38-
39-
40-
41-
42-
43 delete fileEngine;-
44 fileEngine = 0;-
45 QFSFileEngine *fe = new QFSFileEngine;-
46 fileEngine = fe;-
47 return
executed 364 times by 5 tests: return fe->open(QIODevice::OpenMode(flags), fh, handleFlags);
Executed by:
  • tst_LargeFile
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
fe->open(QIODevice::OpenMode(flags), fh, handleFlags);
executed 364 times by 5 tests: return fe->open(QIODevice::OpenMode(flags), fh, handleFlags);
Executed by:
  • tst_LargeFile
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
364
48-
49}-
50-
51QAbstractFileEngine *QFilePrivate::engine() const-
52{-
53 if (!fileEngine
!fileEngineDescription
TRUEevaluated 61986 times by 211 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
  • ...
FALSEevaluated 260564 times by 167 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • ...
)
61986-260564
54 fileEngine = QAbstractFileEngine::create(fileName);
executed 61986 times by 211 tests: fileEngine = QAbstractFileEngine::create(fileName);
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
  • ...
61986
55 return
executed 322550 times by 211 tests: return fileEngine;
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
  • ...
fileEngine;
executed 322550 times by 211 tests: return fileEngine;
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
  • ...
322550
56}-
57QFile::QFile()-
58 : QFileDevice(*new QFilePrivate, 0)-
59{-
60}
executed 889 times by 47 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImageIOHandler
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QMetaType
  • ...
889
61-
62-
63-
64QFile::QFile(QObject *parent)-
65 : QFileDevice(*new QFilePrivate, parent)-
66{-
67}
executed 8 times by 2 tests: end of block
Executed by:
  • tst_QFile
  • tst_QVariant
8
68-
69-
70-
71QFile::QFile(const QString &name)-
72 : QFileDevice(*new QFilePrivate, 0)-
73{-
74 QFilePrivate * const d = d_func();-
75 d->fileName = name;-
76}
executed 62066 times by 211 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
  • ...
62066
77-
78-
79-
80-
81QFile::QFile(const QString &name, QObject *parent)-
82 : QFileDevice(*new QFilePrivate, parent)-
83{-
84 QFilePrivate * const d = d_func();-
85 d->fileName = name;-
86}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFile
1
87-
88-
89-
90QFile::QFile(QFilePrivate &dd, QObject *parent)-
91 : QFileDevice(dd, parent)-
92{-
93}
executed 1581 times by 25 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMetaType
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
1581
94-
95-
96-
97-
98-
99QFile::~QFile()-
100{-
101}-
102-
103-
104-
105-
106-
107-
108-
109QString QFile::fileName() const-
110{-
111 const QFilePrivate * const d = d_func();-
112 return
executed 26052 times by 90 tests: return d->engine()->fileName(QAbstractFileEngine::DefaultName);
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDir
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • ...
d->engine()->fileName(QAbstractFileEngine::DefaultName);
executed 26052 times by 90 tests: return d->engine()->fileName(QAbstractFileEngine::DefaultName);
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDir
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • ...
26052
113}-
114void-
115QFile::setFileName(const QString &name)-
116{-
117 QFilePrivate * const d = d_func();-
118 if (isOpen()
isOpen()Description
TRUEnever evaluated
FALSEevaluated 3075 times by 43 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QNetworkReply
  • ...
) {
0-3075
119 QMessageLogger(__FILE__, 324, __PRETTY_FUNCTION__).warning("QFile::setFileName: File (%s) is already opened",-
120 QString(fileName()).toLocal8Bit().constData());-
121 close();-
122 }
never executed: end of block
0
123 if(d->fileEngine
d->fileEngineDescription
TRUEevaluated 2445 times by 16 tests
Evaluated by:
  • tst_LargeFile
  • tst_QDateTime
  • tst_QFile
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QLabel
  • tst_QPixmap
  • tst_QRawFont
  • tst_QSharedPointer
  • tst_QSystemTrayIcon
  • tst_QTextBrowser
  • tst_QTextEdit
  • tst_QTimeZone
  • tst_QXmlSimpleReader
FALSEevaluated 630 times by 35 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QPrinter
  • tst_QSidebar
  • ...
) {
630-2445
124 delete d->fileEngine;-
125 d->fileEngine = 0;-
126 }
executed 2445 times by 16 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QDateTime
  • tst_QFile
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QLabel
  • tst_QPixmap
  • tst_QRawFont
  • tst_QSharedPointer
  • tst_QSystemTrayIcon
  • tst_QTextBrowser
  • tst_QTextEdit
  • tst_QTimeZone
  • tst_QXmlSimpleReader
2445
127 d->fileName = name;-
128}
executed 3075 times by 43 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QNetworkReply
  • ...
3075
129bool-
130QFile::exists() const-
131{-
132 const QFilePrivate * const d = d_func();-
133-
134 return
executed 2484 times by 57 tests: return (d->engine()->fileFlags(QAbstractFileEngine::FlagsMask | QAbstractFileEngine::FileFlag(0x1000000)) & QAbstractFileEngine::ExistsFlag);
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
(d->engine()->fileFlags(QAbstractFileEngine::FlagsMask
executed 2484 times by 57 tests: return (d->engine()->fileFlags(QAbstractFileEngine::FlagsMask | QAbstractFileEngine::FileFlag(0x1000000)) & QAbstractFileEngine::ExistsFlag);
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
2484
135 | QAbstractFileEngine::FileFlag(0x1000000)) & QAbstractFileEngine::ExistsFlag);
executed 2484 times by 57 tests: return (d->engine()->fileFlags(QAbstractFileEngine::FlagsMask | QAbstractFileEngine::FileFlag(0x1000000)) & QAbstractFileEngine::ExistsFlag);
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
2484
136}-
137bool-
138QFile::exists(const QString &fileName)-
139{-
140 return
executed 12500 times by 218 tests: return QFileInfo::exists(fileName);
Executed by:
  • tst_Gestures
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCryptographicHash
  • ...
QFileInfo::exists(fileName);
executed 12500 times by 218 tests: return QFileInfo::exists(fileName);
Executed by:
  • tst_Gestures
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCryptographicHash
  • ...
12500
141}-
142QString-
143QFile::readLink() const-
144{-
145 const QFilePrivate * const d = d_func();-
146 return
executed 2 times by 1 test: return d->engine()->fileName(QAbstractFileEngine::LinkName);
Executed by:
  • tst_QFile
d->engine()->fileName(QAbstractFileEngine::LinkName);
executed 2 times by 1 test: return d->engine()->fileName(QAbstractFileEngine::LinkName);
Executed by:
  • tst_QFile
2
147}-
148QString-
149QFile::readLink(const QString &fileName)-
150{-
151 return
executed 1 time by 1 test: return QFileInfo(fileName).readLink();
Executed by:
  • tst_QFile
QFileInfo(fileName).readLink();
executed 1 time by 1 test: return QFileInfo(fileName).readLink();
Executed by:
  • tst_QFile
1
152}-
153bool-
154QFile::remove()-
155{-
156 QFilePrivate * const d = d_func();-
157 if (d->fileName.isEmpty()
d->fileName.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 13262 times by 76 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • ...
) {
0-13262
158 QMessageLogger(__FILE__, 504, __PRETTY_FUNCTION__).warning("QFile::remove: Empty or null file name");-
159 return
never executed: return false;
false;
never executed: return false;
0
160 }-
161 unsetError();-
162 close();-
163 if(error() == QFile::NoError
error() == QFile::NoErrorDescription
TRUEevaluated 13262 times by 76 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • ...
FALSEnever evaluated
) {
0-13262
164 if (d->engine()->remove()
d->engine()->remove()Description
TRUEevaluated 12666 times by 76 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • ...
FALSEevaluated 596 times by 21 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QIODevice
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSharedMemory
  • tst_QTextStream
  • tst_QXmlStream
  • tst_qmake
  • tst_qstandardpaths
  • tst_selftests - unknown status
) {
596-12666
165 unsetError();-
166 return
executed 12666 times by 76 tests: return true;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • ...
true;
executed 12666 times by 76 tests: return true;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • ...
12666
167 }-
168 d->setError(QFile::RemoveError, d->fileEngine->errorString());-
169 }
executed 596 times by 21 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QIODevice
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSharedMemory
  • tst_QTextStream
  • tst_QXmlStream
  • tst_qmake
  • tst_qstandardpaths
  • tst_selftests - unknown status
596
170 return
executed 596 times by 21 tests: return false;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QIODevice
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSharedMemory
  • tst_QTextStream
  • tst_QXmlStream
  • tst_qmake
  • tst_qstandardpaths
  • tst_selftests - unknown status
false;
executed 596 times by 21 tests: return false;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QIODevice
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSharedMemory
  • tst_QTextStream
  • tst_QXmlStream
  • tst_qmake
  • tst_qstandardpaths
  • tst_selftests - unknown status
596
171}-
172bool-
173QFile::remove(const QString &fileName)-
174{-
175 return
executed 11763 times by 68 tests: return QFile(fileName).remove();
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • ...
QFile(fileName).remove();
executed 11763 times by 68 tests: return QFile(fileName).remove();
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • ...
11763
176}-
177bool-
178QFile::rename(const QString &newName)-
179{-
180 QFilePrivate * const d = d_func();-
181 if (d->fileName.isEmpty()
d->fileName.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 259 times by 14 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
) {
0-259
182 QMessageLogger(__FILE__, 557, __PRETTY_FUNCTION__).warning("QFile::rename: Empty or null file name");-
183 return
never executed: return false;
false;
never executed: return false;
0
184 }-
185 if (d->fileName == newName
d->fileName == newNameDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 258 times by 14 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
) {
1-258
186 d->setError(QFile::RenameError, tr("Destination file is the same file."));-
187 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_QFile
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QFile
1
188 }-
189 if (!exists()
!exists()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 256 times by 14 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
) {
2-256
190 d->setError(QFile::RenameError, tr("Source file does not exist."));-
191 return
executed 2 times by 1 test: return false;
Executed by:
  • tst_QFile
false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_QFile
2
192 }-
193-
194-
195 if (QFile::exists(newName)
QFile::exists(newName)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 252 times by 14 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
) {
4-252
196 if (d->fileName.compare(newName, Qt::CaseInsensitive)
d->fileName.co...seInsensitive)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFile
FALSEnever evaluated
0-4
197 || QFileSystemEngine::id(QFileSystemEntry(d->fileName)) != QFileSystemEngine::id(QFileSystemEntry(newName))
QFileSystemEng...ntry(newName))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
198-
199-
200-
201 d->setError(QFile::RenameError, tr("Destination file exists"));-
202 return
executed 4 times by 1 test: return false;
Executed by:
  • tst_QFile
false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_QFile
4
203 }-
204-
205-
206-
207-
208-
209 QTemporaryFile tempFile(d->fileName + QLatin1String(".XXXXXX"));-
210 tempFile.setAutoRemove(false);-
211 if (!tempFile.open(QIODevice::ReadWrite)
!tempFile.open...ce::ReadWrite)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
212 d->setError(QFile::RenameError, tempFile.errorString());-
213 return
never executed: return false;
false;
never executed: return false;
0
214 }-
215 tempFile.close();-
216 if (!d->engine()->rename(tempFile.fileName())
!d->engine()->...le.fileName())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
217 d->setError(QFile::RenameError, tr("Error while renaming."));-
218 return
never executed: return false;
false;
never executed: return false;
0
219 }-
220 if (tempFile.rename(newName)
tempFile.rename(newName)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
221 d->fileEngine->setFileName(newName);-
222 d->fileName = newName;-
223 return
never executed: return true;
true;
never executed: return true;
0
224 }-
225 d->setError(QFile::RenameError, tempFile.errorString());-
226-
227 if (!tempFile.rename(d->fileName)
!tempFile.rename(d->fileName)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
228 d->setError(QFile::RenameError, errorString() + QLatin1Char('\n')-
229 + tr("Unable to restore from %1: %2").-
230 arg(QDir::toNativeSeparators(tempFile.fileName()), tempFile.errorString()));-
231 }
never executed: end of block
0
232 return
never executed: return false;
false;
never executed: return false;
0
233-
234-
235 }-
236 unsetError();-
237 close();-
238 if(error() == QFile::NoError
error() == QFile::NoErrorDescription
TRUEevaluated 252 times by 14 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
FALSEnever evaluated
) {
0-252
239 if (d->engine()->rename(newName)
d->engine()->rename(newName)Description
TRUEevaluated 248 times by 14 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QDir
  • tst_QFile
  • tst_QTemporaryFile
) {
4-248
240 unsetError();-
241-
242 d->fileEngine->setFileName(newName);-
243 d->fileName = newName;-
244 return
executed 248 times by 14 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
true;
executed 248 times by 14 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_QTemporaryFile
248
245 }-
246-
247 if (isSequential()
isSequential()Description
TRUEnever evaluated
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QDir
  • tst_QFile
  • tst_QTemporaryFile
) {
0-4
248 d->setError(QFile::RenameError, tr("Will not rename sequential file using block copy"));-
249 return
never executed: return false;
false;
never executed: return false;
0
250 }-
251-
252 QFile out(newName);-
253 if (open(QIODevice::ReadOnly)
open(QIODevice::ReadOnly)Description
TRUEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QDir
  • tst_QFile
  • tst_QTemporaryFile
FALSEnever evaluated
) {
0-4
254 if (out.open(QIODevice::WriteOnly | QIODevice::Truncate)
out.open(QIODe...ice::Truncate)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 3 times by 3 tests
Evaluated by:
  • tst_QDir
  • tst_QFile
  • tst_QTemporaryFile
) {
1-3
255 bool error = false;-
256 char block[4096];-
257 qint64 bytes;-
258 while ((
(bytes = read(...f(block))) > 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
bytes = read(block, sizeof(block))) > 0
(bytes = read(...f(block))) > 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
) {
1
259 if (bytes != out.write(block, bytes)
bytes != out.w...(block, bytes)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
) {
0-1
260 d->setError(QFile::RenameError, out.errorString());-
261 error = true;-
262 break;
never executed: break;
0
263 }-
264 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFile
1
265 if (bytes == -1
bytes == -1Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
) {
0-1
266 d->setError(QFile::RenameError, errorString());-
267 error = true;-
268 }
never executed: end of block
0
269 if(!error
!errorDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEnever evaluated
) {
0-1
270 if (!remove()
!remove()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEnever evaluated
) {
0-1
271 d->setError(QFile::RenameError, tr("Cannot remove source file"));-
272 error = true;-
273 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFile
1
274 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFile
1
275 if (error
errorDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEnever evaluated
) {
0-1
276 out.remove();-
277 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFile
else {
1
278 d->fileEngine->setFileName(newName);-
279 setPermissions(permissions());-
280 unsetError();-
281 setFileName(newName);-
282 }
never executed: end of block
0
283 close();-
284 return
executed 1 time by 1 test: return !error;
Executed by:
  • tst_QFile
!error;
executed 1 time by 1 test: return !error;
Executed by:
  • tst_QFile
1
285 }-
286 close();-
287 }
executed 3 times by 3 tests: end of block
Executed by:
  • tst_QDir
  • tst_QFile
  • tst_QTemporaryFile
3
288 d->setError(QFile::RenameError, out.isOpen() ? errorString() : out.errorString());-
289 }
executed 3 times by 3 tests: end of block
Executed by:
  • tst_QDir
  • tst_QFile
  • tst_QTemporaryFile
3
290 return
executed 3 times by 3 tests: return false;
Executed by:
  • tst_QDir
  • tst_QFile
  • tst_QTemporaryFile
false;
executed 3 times by 3 tests: return false;
Executed by:
  • tst_QDir
  • tst_QFile
  • tst_QTemporaryFile
3
291}-
292bool-
293QFile::rename(const QString &oldName, const QString &newName)-
294{-
295 return
executed 8 times by 3 tests: return QFile(oldName).rename(newName);
Executed by:
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QSettings
QFile(oldName).rename(newName);
executed 8 times by 3 tests: return QFile(oldName).rename(newName);
Executed by:
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QSettings
8
296}-
297bool-
298QFile::link(const QString &linkName)-
299{-
300 QFilePrivate * const d = d_func();-
301 if (d->fileName.isEmpty()
d->fileName.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 161 times by 8 tests
Evaluated by:
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qstandardpaths
) {
0-161
302 QMessageLogger(__FILE__, 707, __PRETTY_FUNCTION__).warning("QFile::link: Empty or null file name");-
303 return
never executed: return false;
false;
never executed: return false;
0
304 }-
305 QFileInfo fi(linkName);-
306 if (d->engine()->link(fi.absoluteFilePath())
d->engine()->l...uteFilePath())Description
TRUEevaluated 161 times by 8 tests
Evaluated by:
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qstandardpaths
FALSEnever evaluated
) {
0-161
307 unsetError();-
308 return
executed 161 times by 8 tests: return true;
Executed by:
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qstandardpaths
true;
executed 161 times by 8 tests: return true;
Executed by:
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qstandardpaths
161
309 }-
310 d->setError(QFile::RenameError, d->fileEngine->errorString());-
311 return
never executed: return false;
false;
never executed: return false;
0
312}-
313bool-
314QFile::link(const QString &fileName, const QString &linkName)-
315{-
316 return
executed 151 times by 5 tests: return QFile(fileName).link(linkName);
Executed by:
  • tst_QDir
  • tst_QDirIterator
  • tst_QFile
  • tst_QMimeDatabase
  • tst_QSaveFile
QFile(fileName).link(linkName);
executed 151 times by 5 tests: return QFile(fileName).link(linkName);
Executed by:
  • tst_QDir
  • tst_QDirIterator
  • tst_QFile
  • tst_QMimeDatabase
  • tst_QSaveFile
151
317}-
318bool-
319QFile::copy(const QString &newName)-
320{-
321 QFilePrivate * const d = d_func();-
322 if (d->fileName.isEmpty()
d->fileName.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 137 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
) {
0-137
323 QMessageLogger(__FILE__, 753, __PRETTY_FUNCTION__).warning("QFile::copy: Empty or null file name");-
324 return
never executed: return false;
false;
never executed: return false;
0
325 }-
326 if (QFile::exists(newName)
QFile::exists(newName)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 134 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
) {
3-134
327-
328-
329-
330 d->setError(QFile::CopyError, tr("Destination file exists"));-
331 return
executed 3 times by 1 test: return false;
Executed by:
  • tst_QFile
false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_QFile
3
332 }-
333 unsetError();-
334 close();-
335 if(error() == QFile::NoError
error() == QFile::NoErrorDescription
TRUEevaluated 134 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
FALSEnever evaluated
) {
0-134
336 if (d->engine()->copy(newName)
d->engine()->copy(newName)Description
TRUEnever evaluated
FALSEevaluated 134 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
) {
0-134
337 unsetError();-
338 return
never executed: return true;
true;
never executed: return true;
0
339 } else {-
340 bool error = false;-
341 if(!open(QFile::ReadOnly)
!open(QFile::ReadOnly)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 133 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
) {
1-133
342 error = true;-
343 d->setError(QFile::CopyError, tr("Cannot open %1 for input").arg(d->fileName));-
344 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFile
else {
1
345 QString fileTemplate = QLatin1String("%1/qt_temp.XXXXXX");-
346-
347-
348-
349-
350-
351 QTemporaryFile out(fileTemplate.arg(QFileInfo(newName).path()));-
352 if (!out.open()
!out.open()Description
TRUEnever evaluated
FALSEevaluated 133 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
) {
0-133
353 out.setFileTemplate(fileTemplate.arg(QDir::tempPath()));-
354 if (!out.open()
!out.open()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
355 error = true;
never executed: error = true;
0
356 }
never executed: end of block
0
357-
358 if (error
errorDescription
TRUEnever evaluated
FALSEevaluated 133 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
) {
0-133
359 out.close();-
360 close();-
361 d->setError(QFile::CopyError, tr("Cannot open for output"));-
362 }
never executed: end of block
else {
0
363 char block[4096];-
364 qint64 totalRead = 0;-
365 while(!atEnd()
!atEnd()Description
TRUEevaluated 1271 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
FALSEevaluated 133 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
) {
133-1271
366 qint64 in = read(block, sizeof(block));-
367 if (in <= 0
in <= 0Description
TRUEnever evaluated
FALSEevaluated 1271 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
)
0-1271
368 break;
never executed: break;
0
369 totalRead += in;-
370 if(in != out.write(block, in)
in != out.write(block, in)Description
TRUEnever evaluated
FALSEevaluated 1271 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
) {
0-1271
371 close();-
372 d->setError(QFile::CopyError, tr("Failure to write block"));-
373 error = true;-
374 break;
never executed: break;
0
375 }-
376 }
executed 1271 times by 5 tests: end of block
Executed by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
1271
377-
378 if (totalRead != size()
totalRead != size()Description
TRUEnever evaluated
FALSEevaluated 133 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
) {
0-133
379-
380-
381 error = true;-
382 }
never executed: end of block
0
383 if (!error
!errorDescription
TRUEevaluated 133 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
FALSEnever evaluated
&& !out.rename(newName)
!out.rename(newName)Description
TRUEnever evaluated
FALSEevaluated 133 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
) {
0-133
384 error = true;-
385 close();-
386 d->setError(QFile::CopyError, tr("Cannot create %1 for output").arg(newName));-
387 }
never executed: end of block
0
388-
389-
390-
391-
392 if (!error
!errorDescription
TRUEevaluated 133 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
FALSEnever evaluated
)
0-133
393 out.setAutoRemove(false);
executed 133 times by 5 tests: out.setAutoRemove(false);
Executed by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
133
394-
395 }
executed 133 times by 5 tests: end of block
Executed by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
133
396 }-
397 if(!error
!errorDescription
TRUEevaluated 133 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
) {
1-133
398 QFile::setPermissions(newName, permissions());-
399 close();-
400 unsetError();-
401 return
executed 133 times by 5 tests: return true;
Executed by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
true;
executed 133 times by 5 tests: return true;
Executed by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
133
402 }-
403 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFile
1
404 }-
405 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_QFile
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QFile
1
406}-
407bool-
408QFile::copy(const QString &fileName, const QString &newName)-
409{-
410 return
executed 101 times by 3 tests: return QFile(fileName).copy(newName);
Executed by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QImageReader
QFile(fileName).copy(newName);
executed 101 times by 3 tests: return QFile(fileName).copy(newName);
Executed by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QImageReader
101
411}-
412bool QFile::open(OpenMode mode)-
413{-
414 QFilePrivate * const d = d_func();-
415 if (isOpen()
isOpen()Description
TRUEnever evaluated
FALSEevaluated 48863 times by 193 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
  • ...
) {
0-48863
416 QMessageLogger(__FILE__, 874, __PRETTY_FUNCTION__).warning("QFile::open: File (%s) already open", QString(fileName()).toLocal8Bit().constData());-
417 return
never executed: return false;
false;
never executed: return false;
0
418 }-
419 if (mode & Append
mode & AppendDescription
TRUEevaluated 259 times by 6 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_qfileopenevent
  • tst_qmakelib
FALSEevaluated 48604 times by 193 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
  • ...
)
259-48604
420 mode |= WriteOnly;
executed 259 times by 6 tests: mode |= WriteOnly;
Executed by:
  • tst_QAbstractFileEngine
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_qfileopenevent
  • tst_qmakelib
259
421-
422 unsetError();-
423 if ((
(mode & (ReadO...iteOnly)) == 0Description
TRUEnever evaluated
FALSEevaluated 48863 times by 193 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
  • ...
mode & (ReadOnly | WriteOnly)) == 0
(mode & (ReadO...iteOnly)) == 0Description
TRUEnever evaluated
FALSEevaluated 48863 times by 193 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
  • ...
) {
0-48863
424 QMessageLogger(__FILE__, 882, __PRETTY_FUNCTION__).warning("QIODevice::open: File access not specified");-
425 return
never executed: return false;
false;
never executed: return false;
0
426 }-
427-
428-
429 if (d->engine()->open(mode | QIODevice::Unbuffered)
d->engine()->o...e::Unbuffered)Description
TRUEevaluated 45153 times by 177 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_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • ...
FALSEevaluated 3710 times by 53 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTime
  • tst_QDir
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QGlobal
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • ...
) {
3710-45153
430 QIODevice::open(mode);-
431 if (mode & Append
mode & AppendDescription
TRUEevaluated 258 times by 6 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_qfileopenevent
  • tst_qmakelib
FALSEevaluated 44895 times by 177 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_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • ...
)
258-44895
432 seek(size());
executed 258 times by 6 tests: seek(size());
Executed by:
  • tst_QAbstractFileEngine
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_qfileopenevent
  • tst_qmakelib
258
433 return
executed 45153 times by 177 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_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • ...
true;
executed 45153 times by 177 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_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • ...
45153
434 }-
435 QFile::FileError err = d->fileEngine->error();-
436 if(err == QFile::UnspecifiedError
err == QFile::UnspecifiedErrorDescription
TRUEevaluated 215 times by 8 tests
Evaluated by:
  • tst_QFile
  • tst_QImageReader
  • tst_QPlainTextEdit
  • tst_QSettings
  • tst_QTextBrowser
  • tst_QTextDocument
  • tst_QTextEdit
  • tst_Selftests
FALSEevaluated 3495 times by 50 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTime
  • tst_QDir
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QGlobal
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • ...
)
215-3495
437 err = QFile::OpenError;
executed 215 times by 8 tests: err = QFile::OpenError;
Executed by:
  • tst_QFile
  • tst_QImageReader
  • tst_QPlainTextEdit
  • tst_QSettings
  • tst_QTextBrowser
  • tst_QTextDocument
  • tst_QTextEdit
  • tst_Selftests
215
438 d->setError(err, d->fileEngine->errorString());-
439 return
executed 3710 times by 53 tests: return false;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTime
  • tst_QDir
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QGlobal
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • ...
false;
executed 3710 times by 53 tests: return false;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTime
  • tst_QDir
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QGlobal
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • ...
3710
440}-
441bool QFile::open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)-
442{-
443 QFilePrivate * const d = d_func();-
444 if (isOpen()
isOpen()Description
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
445 QMessageLogger(__FILE__, 946, __PRETTY_FUNCTION__).warning("QFile::open: File (%s) already open", QString(fileName()).toLocal8Bit().constData());-
446 return
never executed: return false;
false;
never executed: return false;
0
447 }-
448 if (mode & Append
mode & 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
449 mode |= WriteOnly;
never executed: mode |= WriteOnly;
0
450 unsetError();-
451 if ((
(mode & (ReadO...iteOnly)) == 0Description
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
mode & (ReadOnly | WriteOnly)) == 0
(mode & (ReadO...iteOnly)) == 0Description
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
452 QMessageLogger(__FILE__, 953, __PRETTY_FUNCTION__).warning("QFile::open: File access not specified");-
453 return
never executed: return false;
false;
never executed: return false;
0
454 }-
455 if (d->openExternalFile(mode, fh, handleFlags)
d->openExterna..., handleFlags)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-364
456 QIODevice::open(mode);-
457 if (!(mode & Append)
!(mode & Append)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
&& !isSequential()
!isSequential()Description
TRUEevaluated 27 times by 2 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
FALSEevaluated 337 times by 4 tests
Evaluated by:
  • tst_QFile
  • tst_qdbuscpp2xml - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
) {
0-364
458 qint64 pos = (qint64)::ftello64(fh);-
459 if (pos != -1
pos != -1Description
TRUEevaluated 27 times by 2 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
FALSEnever evaluated
) {
0-27
460-
461 QIODevice::seek(pos);-
462 }
executed 27 times by 2 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QFile
27
463 }
executed 27 times by 2 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QFile
27
464 return
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
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
465 }-
466 return
never executed: return false;
false;
never executed: return false;
0
467}-
468bool QFile::open(int fd, OpenMode mode, FileHandleFlags handleFlags)-
469{-
470 QFilePrivate * const d = d_func();-
471 if (isOpen()
isOpen()Description
TRUEnever evaluated
FALSEevaluated 29 times by 3 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
) {
0-29
472 QMessageLogger(__FILE__, 1002, __PRETTY_FUNCTION__).warning("QFile::open: File (%s) already open", QString(fileName()).toLocal8Bit().constData());-
473 return
never executed: return false;
false;
never executed: return false;
0
474 }-
475 if (mode & Append
mode & AppendDescription
TRUEnever evaluated
FALSEevaluated 29 times by 3 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
)
0-29
476 mode |= WriteOnly;
never executed: mode |= WriteOnly;
0
477 unsetError();-
478 if ((
(mode & (ReadO...iteOnly)) == 0Description
TRUEnever evaluated
FALSEevaluated 29 times by 3 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
mode & (ReadOnly | WriteOnly)) == 0
(mode & (ReadO...iteOnly)) == 0Description
TRUEnever evaluated
FALSEevaluated 29 times by 3 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
) {
0-29
479 QMessageLogger(__FILE__, 1009, __PRETTY_FUNCTION__).warning("QFile::open: File access not specified");-
480 return
never executed: return false;
false;
never executed: return false;
0
481 }-
482 if (d->openExternalFile(mode, fd, handleFlags)
d->openExterna..., handleFlags)Description
TRUEevaluated 29 times by 3 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
FALSEnever evaluated
) {
0-29
483 QIODevice::open(mode);-
484 if (!(mode & Append)
!(mode & Append)Description
TRUEevaluated 29 times by 3 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
FALSEnever evaluated
&& !isSequential()
!isSequential()Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
FALSEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QFile
  • tst_QPrinterInfo
) {
0-29
485 qint64 pos = (qint64)::lseek64(fd, off64_t(0), 1);-
486 if (pos != -1
pos != -1Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_LargeFile
  • tst_QFile
FALSEnever evaluated
) {
0-24
487-
488 QIODevice::seek(pos);-
489 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QFile
24
490 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QFile
24
491 return
executed 29 times by 3 tests: return true;
Executed by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
true;
executed 29 times by 3 tests: return true;
Executed by:
  • tst_LargeFile
  • tst_QFile
  • tst_QPrinterInfo
29
492 }-
493 return
never executed: return false;
false;
never executed: return false;
0
494}-
495-
496-
497-
498-
499bool QFile::resize(qint64 sz)-
500{-
501 return
executed 295 times by 7 tests: return QFileDevice::resize(sz);
Executed by:
  • tst_QAbstractFileEngine
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QNetworkReply
  • tst_QTemporaryFile
QFileDevice::resize(sz);
executed 295 times by 7 tests: return QFileDevice::resize(sz);
Executed by:
  • tst_QAbstractFileEngine
  • tst_QDirModel
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QNetworkReply
  • tst_QTemporaryFile
295
502}-
503bool-
504QFile::resize(const QString &fileName, qint64 sz)-
505{-
506 return
executed 3 times by 1 test: return QFile(fileName).resize(sz);
Executed by:
  • tst_QFile
QFile(fileName).resize(sz);
executed 3 times by 1 test: return QFile(fileName).resize(sz);
Executed by:
  • tst_QFile
3
507}-
508-
509-
510-
511-
512QFile::Permissions QFile::permissions() const-
513{-
514 return
executed 200 times by 12 tests: return QFileDevice::permissions();
Executed by:
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qmakelib
  • tst_qstandardpaths
QFileDevice::permissions();
executed 200 times by 12 tests: return QFileDevice::permissions();
Executed by:
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QSaveFile
  • tst_qmakelib
  • tst_qstandardpaths
200
515}-
516QFile::Permissions-
517QFile::permissions(const QString &fileName)-
518{-
519 return
executed 11 times by 3 tests: return QFile(fileName).permissions();
Executed by:
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QSaveFile
QFile(fileName).permissions();
executed 11 times by 3 tests: return QFile(fileName).permissions();
Executed by:
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QSaveFile
11
520}-
521bool QFile::setPermissions(Permissions permissions)-
522{-
523 return
executed 622 times by 17 tests: return QFileDevice::setPermissions(permissions);
Executed by:
  • tst_QDir
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_qmakelib
  • tst_qstandardpaths
QFileDevice::setPermissions(permissions);
executed 622 times by 17 tests: return QFileDevice::setPermissions(permissions);
Executed by:
  • tst_QDir
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_qmakelib
  • tst_qstandardpaths
622
524}-
525-
526-
527-
528-
529-
530-
531-
532bool-
533QFile::setPermissions(const QString &fileName, Permissions permissions)-
534{-
535 return
executed 159 times by 6 tests: return QFile(fileName).setPermissions(permissions);
Executed by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
QFile(fileName).setPermissions(permissions);
executed 159 times by 6 tests: return QFile(fileName).setPermissions(permissions);
Executed by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
159
536}-
537-
538-
539-
540-
541qint64 QFile::size() const-
542{-
543 return
executed 165638 times by 164 tests: return QFileDevice::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
  • ...
QFileDevice::size();
executed 165638 times by 164 tests: return QFileDevice::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
  • ...
165638
544}-
545-
546-
Switch to Source codePreprocessed file

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