OpenCoverage

qtemporaryfile.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qtemporaryfile.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12typedef char Char;-
13typedef char Latin1Char;-
14typedef int NativeFileHandle;-
15static bool createFileFromTemplate(NativeFileHandle &file,-
16 QFileSystemEntry::NativePath &path, size_t pos, size_t length, quint32 mode,-
17 QSystemError &error)-
18{-
19 ((!(length != 0)) ? qt_assert("length != 0",__FILE__,122) : qt_noop());-
20 ((!(pos < size_t(path.length()))) ? qt_assert("pos < size_t(path.length())",__FILE__,123) : qt_noop());-
21 ((!(length <= size_t(path.length()) - pos)) ? qt_assert("length <= size_t(path.length()) - pos",__FILE__,124) : qt_noop());-
22-
23 Char *const placeholderStart = (Char *)path.data() + pos;-
24 Char *const placeholderEnd = placeholderStart + length;-
25-
26-
27 {-
28 Char *rIter = placeholderEnd;-
29-
30-
31 quint64 pid = quint64(QCoreApplication::applicationPid());-
32 do {-
33 *--rIter = Latin1Char((pid % 10) + '0');-
34 pid /= 10;-
35 }
executed 10800 times by 26 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
while (rIter != placeholderStart
rIter != placeholderStartDescription
TRUEevaluated 10800 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
FALSEnever evaluated
&& pid != 0
pid != 0Description
TRUEevaluated 8640 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
FALSEevaluated 2160 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
);
0-10800
36-
37-
38 while (rIter != placeholderStart
rIter != placeholderStartDescription
TRUEevaluated 2202 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
FALSEevaluated 2160 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
) {
2160-2202
39 char ch = char((qrand() & 0xffff) % (26 + 26));-
40 if (ch < 26
ch < 26Description
TRUEevaluated 1136 times by 25 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
FALSEevaluated 1066 times by 15 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_qlockfile - unknown status
)
1066-1136
41 *--
executed 1136 times by 25 tests: *--rIter = Latin1Char(ch + 'A');
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
rIter = Latin1Char(ch + 'A');
executed 1136 times by 25 tests: *--rIter = Latin1Char(ch + 'A');
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
1136
42 else-
43 *--
executed 1066 times by 15 tests: *--rIter = Latin1Char(ch - 26 + 'a');
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_qlockfile - unknown status
rIter = Latin1Char(ch - 26 + 'a');
executed 1066 times by 15 tests: *--rIter = Latin1Char(ch - 26 + 'a');
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_qlockfile - unknown status
1066
44 }-
45 }-
46-
47 for (;;) {-
48 file = qt_safe_open(path.constData(),-
49 0100 | 0200 | 02 | 0,-
50 static_cast<mode_t>(mode));-
51-
52 if (file != -1
file != -1Description
TRUEevaluated 2147 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
FALSEevaluated 474536 times by 3 tests
Evaluated by:
  • tst_QFiledialog
  • tst_QSaveFile
  • tst_QTemporaryFile
)
2147-474536
53 return
executed 2147 times by 26 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
true;
executed 2147 times by 26 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
2147
54-
55 int err = (*__errno_location ());-
56 if (err != 17
err != 17Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QSaveFile
  • tst_QTemporaryFile
FALSEevaluated 474523 times by 2 tests
Evaluated by:
  • tst_QFiledialog
  • tst_QTemporaryFile
) {
13-474523
57 error = QSystemError(err, QSystemError::NativeError);-
58 return
executed 13 times by 2 tests: return false;
Executed by:
  • tst_QSaveFile
  • tst_QTemporaryFile
false;
executed 13 times by 2 tests: return false;
Executed by:
  • tst_QSaveFile
  • tst_QTemporaryFile
13
59 }-
60-
61-
62-
63 for (Char *iter = placeholderStart;;) {-
64-
65-
66 switch (char(*iter)) {-
67 case
executed 9120 times by 1 test: case 'Z':
Executed by:
  • tst_QTemporaryFile
'Z':
executed 9120 times by 1 test: case 'Z':
Executed by:
  • tst_QTemporaryFile
9120
68-
69 *iter = Latin1Char('a');-
70 if (++
++iter == placeholderEndDescription
TRUEnever evaluated
FALSEevaluated 9120 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
iter == placeholderEnd
++iter == placeholderEndDescription
TRUEnever evaluated
FALSEevaluated 9120 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
) {
0-9120
71-
72 error = QSystemError(err, QSystemError::NativeError);-
73 return
never executed: return false;
false;
never executed: return false;
0
74 }-
75-
76 continue;
executed 9120 times by 1 test: continue;
Executed by:
  • tst_QTemporaryFile
9120
77-
78 case
never executed: case '0':
'0':
never executed: case '0':
case
never executed: case '1':
'1':
never executed: case '1':
case
never executed: case '2':
'2':
never executed: case '2':
case
never executed: case '3':
'3':
never executed: case '3':
case
executed 948 times by 1 test: case '4':
Executed by:
  • tst_QTemporaryFile
'4':
executed 948 times by 1 test: case '4':
Executed by:
  • tst_QTemporaryFile
0-948
79 case
never executed: case '5':
'5':
never executed: case '5':
case
never executed: case '6':
'6':
never executed: case '6':
case
never executed: case '7':
'7':
never executed: case '7':
case
never executed: case '8':
'8':
never executed: case '8':
case
never executed: case '9':
'9':
never executed: case '9':
0
80 *iter = Latin1Char('a');-
81 break;
executed 948 times by 1 test: break;
Executed by:
  • tst_QTemporaryFile
948
82-
83 case
executed 9127 times by 1 test: case 'z':
Executed by:
  • tst_QTemporaryFile
'z':
executed 9127 times by 1 test: case 'z':
Executed by:
  • tst_QTemporaryFile
9127
84-
85 *iter = Latin1Char('A');-
86 break;
executed 9127 times by 1 test: break;
Executed by:
  • tst_QTemporaryFile
9127
87-
88 default
executed 464448 times by 2 tests: default:
Executed by:
  • tst_QFiledialog
  • tst_QTemporaryFile
:
executed 464448 times by 2 tests: default:
Executed by:
  • tst_QFiledialog
  • tst_QTemporaryFile
464448
89 ++*iter;-
90 break;
executed 464448 times by 2 tests: break;
Executed by:
  • tst_QFiledialog
  • tst_QTemporaryFile
464448
91 }-
92 break;
executed 474523 times by 2 tests: break;
Executed by:
  • tst_QFiledialog
  • tst_QTemporaryFile
474523
93 }-
94 }
executed 474523 times by 2 tests: end of block
Executed by:
  • tst_QFiledialog
  • tst_QTemporaryFile
474523
95-
96 ((!(false)) ? qt_assert("false",__FILE__,233) : qt_noop());-
97 return
never executed: return false;
false;
never executed: return false;
0
98}-
99-
100-
101QTemporaryFileEngine::~QTemporaryFileEngine()-
102{-
103 QFSFileEnginePrivate * const d = d_func();-
104 d->unmapAll();-
105 QFSFileEngine::close();-
106}
executed 2159 times by 26 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qdbusmarshall - unknown status
  • ...
2159
107-
108bool QTemporaryFileEngine::isReallyOpen() const-
109{-
110 const QFSFileEnginePrivate * const d = d_func();-
111-
112 if (!((
(0 == d->fh)Description
TRUEevaluated 4351 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
FALSEnever evaluated
0 == d->fh)
(0 == d->fh)Description
TRUEevaluated 4351 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
FALSEnever evaluated
&& (-
(-1 == d->fd)Description
TRUEevaluated 4329 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
FALSEevaluated 22 times by 3 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QImageReader
  • tst_QTemporaryFile
1 == d->fd)
(-1 == d->fd)Description
TRUEevaluated 4329 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
FALSEevaluated 22 times by 3 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QImageReader
  • tst_QTemporaryFile
0-4351
113-
114-
115-
116 ))-
117 return
executed 22 times by 3 tests: return true;
Executed by:
  • tst_QFileDialog2
  • tst_QImageReader
  • tst_QTemporaryFile
true;
executed 22 times by 3 tests: return true;
Executed by:
  • tst_QFileDialog2
  • tst_QImageReader
  • tst_QTemporaryFile
22
118-
119 return
executed 4329 times by 26 tests: return false;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
false;
executed 4329 times by 26 tests: return false;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
4329
120-
121}-
122-
123void QTemporaryFileEngine::setFileName(const QString &file)-
124{-
125-
126 QFSFileEngine::close();-
127 QFSFileEngine::setFileName(file);-
128}
executed 220 times by 9 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QFile
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTemporaryFile
220
129-
130void QTemporaryFileEngine::setFileTemplate(const QString &fileTemplate)-
131{-
132 QFSFileEnginePrivate * const d = d_func();-
133 if (filePathIsTemplate
filePathIsTemplateDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QTemporaryFile
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QTemporaryFile
)
1
134 d->fileEntry = QFileSystemEntry(fileTemplate);
executed 1 time by 1 test: d->fileEntry = QFileSystemEntry(fileTemplate);
Executed by:
  • tst_QTemporaryFile
1
135}
executed 2 times by 1 test: end of block
Executed by:
  • tst_QTemporaryFile
2
136-
137bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode)-
138{-
139 QFSFileEnginePrivate * const d = d_func();-
140 ((!(!isReallyOpen())) ? qt_assert("!isReallyOpen()",__FILE__,277) : qt_noop());-
141-
142 openMode |= QIODevice::ReadWrite;-
143-
144 if (!filePathIsTemplate
!filePathIsTemplateDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
FALSEevaluated 2160 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
)
3-2160
145 return
executed 3 times by 1 test: return QFSFileEngine::open(openMode);
Executed by:
  • tst_QTemporaryFile
QFSFileEngine::open(openMode);
executed 3 times by 1 test: return QFSFileEngine::open(openMode);
Executed by:
  • tst_QTemporaryFile
3
146-
147 QString qfilename = d->fileEntry.filePath();-
148-
149-
150 uint phPos = qfilename.length();-
151 uint phLength = 0;-
152-
153 while (phPos != 0
phPos != 0Description
TRUEevaluated 21407 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
) {
26-21407
154 --phPos;-
155-
156 if (qfilename[phPos] == QLatin1Char('X')
qfilename[phPo...atin1Char('X')Description
TRUEevaluated 8548 times by 19 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QStorageInfo
  • tst_QTemporaryFile
FALSEevaluated 12859 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
) {
8548-12859
157 ++phLength;-
158 continue;
executed 8548 times by 19 tests: continue;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QStorageInfo
  • tst_QTemporaryFile
8548
159 }-
160-
161 if (phLength >= 6
phLength >= 6Description
TRUEevaluated 1395 times by 19 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QStorageInfo
  • tst_QTemporaryFile
FALSEevaluated 11464 times by 17 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
1395-11464
162 || qfilename[phPos] == QLatin1Char('/')
qfilename[phPo...atin1Char('/')Description
TRUEevaluated 739 times by 10 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLockFile
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
FALSEevaluated 10725 times by 15 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_languageChange
) {
739-10725
163 ++phPos;-
164 break;
executed 2134 times by 26 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
2134
165 }-
166-
167-
168 phLength = 0;-
169 }
executed 10725 times by 15 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_languageChange
10725
170-
171 if (phLength < 6
phLength < 6Description
TRUEevaluated 759 times by 10 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLockFile
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
FALSEevaluated 1401 times by 19 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QStorageInfo
  • tst_QTemporaryFile
)
759-1401
172 qfilename.append(QLatin1String(".XXXXXX"));
executed 759 times by 10 tests: qfilename.append(QLatin1String(".XXXXXX"));
Executed by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLockFile
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
759
173-
174-
175 QFileSystemEntry::NativePath filename = QFileSystemEngine::absoluteName(-
176 QFileSystemEntry(qfilename, QFileSystemEntry::FromInternalPath()))-
177 .nativeFilePath();-
178-
179-
180 phPos = filename.length();-
181 phLength = 0;-
182 while (phPos != 0
phPos != 0Description
TRUEevaluated 15480 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
FALSEnever evaluated
) {
0-15480
183 --phPos;-
184-
185 if (filename[phPos] == Latin1Char('X')
filename[phPos...atin1Char('X')Description
TRUEevaluated 13021 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
FALSEevaluated 2459 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
) {
2459-13021
186 ++phLength;-
187 continue;
executed 13021 times by 26 tests: continue;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
13021
188 }-
189-
190 if (phLength >= 6
phLength >= 6Description
TRUEevaluated 2160 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
FALSEevaluated 299 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFileSystemModel
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTemporaryFile
) {
299-2160
191 ++phPos;-
192 break;
executed 2160 times by 26 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
2160
193 }-
194-
195-
196 phLength = 0;-
197 }
executed 299 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFileSystemModel
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTemporaryFile
299
198-
199 ((!(phLength >= 6)) ? qt_assert("phLength >= 6",__FILE__,336) : qt_noop());-
200-
201 QSystemError error;-
202-
203-
204-
205 NativeFileHandle &file = d->fd;-
206-
207-
208 if (!createFileFromTemplate(file, filename, phPos, phLength, fileMode, error)
!createFileFro...leMode, error)Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QSaveFile
  • tst_QTemporaryFile
FALSEevaluated 2147 times by 26 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
) {
13-2147
209 setError(QFile::OpenError, error.toString());-
210 return
executed 13 times by 2 tests: return false;
Executed by:
  • tst_QSaveFile
  • tst_QTemporaryFile
false;
executed 13 times by 2 tests: return false;
Executed by:
  • tst_QSaveFile
  • tst_QTemporaryFile
13
211 }-
212-
213 d->fileEntry = QFileSystemEntry(filename, QFileSystemEntry::FromNativePath());-
214-
215-
216 d->closeFileHandle = true;-
217-
218-
219 filePathIsTemplate = false;-
220-
221 d->openMode = openMode;-
222 d->lastFlushFailed = false;-
223 d->tried_stat = 0;-
224-
225 return
executed 2147 times by 26 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
true;
executed 2147 times by 26 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • ...
2147
226}-
227-
228bool QTemporaryFileEngine::remove()-
229{-
230 QFSFileEnginePrivate * const d = d_func();-
231-
232-
233 d->unmapAll();-
234 QFSFileEngine::close();-
235 if (QFSFileEngine::remove()
QFSFileEngine::remove()Description
TRUEevaluated 353 times by 23 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QDir
  • 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 1 time by 1 test
Evaluated by:
  • tst_QSaveFile
) {
1-353
236 d->fileEntry.clear();-
237-
238-
239-
240-
241-
242 filePathIsTemplate = filePathWasTemplate;-
243 return
executed 353 times by 23 tests: return true;
Executed by:
  • tst_QColorDialog
  • tst_QDir
  • 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
true;
executed 353 times by 23 tests: return true;
Executed by:
  • tst_QColorDialog
  • tst_QDir
  • 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
353
244 }-
245 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_QSaveFile
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QSaveFile
1
246}-
247-
248bool QTemporaryFileEngine::rename(const QString &newName)-
249{-
250 QFSFileEngine::close();-
251 return
executed 794 times by 16 tests: return QFSFileEngine::rename(newName);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_languageChange
QFSFileEngine::rename(newName);
executed 794 times by 16 tests: return QFSFileEngine::rename(newName);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_languageChange
794
252}-
253-
254bool QTemporaryFileEngine::renameOverwrite(const QString &newName)-
255{-
256 QFSFileEngine::close();-
257 return
executed 573 times by 7 tests: return QFSFileEngine::renameOverwrite(newName);
Executed by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
QFSFileEngine::renameOverwrite(newName);
executed 573 times by 7 tests: return QFSFileEngine::renameOverwrite(newName);
Executed by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
573
258}-
259-
260bool QTemporaryFileEngine::close()-
261{-
262-
263 seek(0);-
264 setError(QFile::UnspecifiedError, QString());-
265 return
executed 2170 times by 26 tests: return true;
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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qdbusmarshall - unknown status
  • ...
true;
executed 2170 times by 26 tests: return true;
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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSaveFile
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qdbusmarshall - unknown status
  • ...
2170
266}-
267-
268-
269-
270QTemporaryFilePrivate::QTemporaryFilePrivate() : autoRemove(true)-
271{-
272}
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
273-
274QTemporaryFilePrivate::~QTemporaryFilePrivate()-
275{-
276}-
277-
278QAbstractFileEngine *QTemporaryFilePrivate::engine() const-
279{-
280 if (!fileEngine
!fileEngineDescription
TRUEevaluated 1577 times by 25 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
FALSEevaluated 3408 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_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qdbusmarshall - unknown status
  • tst_qlockfile - unknown status
) {
1577-3408
281 fileEngine = new QTemporaryFileEngine;-
282 resetFileEngine();-
283 }
executed 1577 times by 25 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
1577
284 return
executed 4985 times by 26 tests: return fileEngine;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qdbusmarshall - unknown status
  • ...
fileEngine;
executed 4985 times by 26 tests: return fileEngine;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qdbusmarshall - unknown status
  • ...
4985
285}-
286-
287void QTemporaryFilePrivate::resetFileEngine() const-
288{-
289 if (!fileEngine
!fileEngineDescription
TRUEevaluated 1577 times by 25 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
FALSEevaluated 1581 times by 25 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
)
1577-1581
290 return;
executed 1577 times by 25 tests: return;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
1577
291-
292 QTemporaryFileEngine *tef = static_cast<QTemporaryFileEngine *>(fileEngine);-
293 if (fileName.isEmpty()
fileName.isEmpty()Description
TRUEevaluated 1578 times by 25 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
)
3-1578
294 tef->initialize(templateName, 0600);
executed 1578 times by 25 tests: tef->initialize(templateName, 0600);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
1578
295 else-
296 tef->initialize(fileName, 0600, false);
executed 3 times by 1 test: tef->initialize(fileName, 0600, false);
Executed by:
  • tst_QTemporaryFile
3
297}-
298-
299QString QTemporaryFilePrivate::defaultTemplateName()-
300{-
301 QString baseName;-
302-
303 baseName = QCoreApplication::applicationName();-
304 if (baseName.isEmpty()
baseName.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 1039 times by 9 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QImageWriter
  • tst_QMetaType
  • tst_QMimeDatabase
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QStorageInfo
  • tst_QTemporaryFile
)
0-1039
305-
306 baseName = QLatin1String("qt_temp");
never executed: baseName = QLatin1String("qt_temp");
0
307-
308 return
executed 1039 times by 9 tests: return QDir::tempPath() + QLatin1Char('/') + baseName + QLatin1String(".XXXXXX");
Executed by:
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QImageWriter
  • tst_QMetaType
  • tst_QMimeDatabase
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QStorageInfo
  • tst_QTemporaryFile
QDir::tempPath() + QLatin1Char('/') + baseName + QLatin1String(".XXXXXX");
executed 1039 times by 9 tests: return QDir::tempPath() + QLatin1Char('/') + baseName + QLatin1String(".XXXXXX");
Executed by:
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QImageWriter
  • tst_QMetaType
  • tst_QMimeDatabase
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QStorageInfo
  • tst_QTemporaryFile
1039
309}-
310QTemporaryFile::QTemporaryFile()-
311 : QFile(*new QTemporaryFilePrivate, 0)-
312{-
313 QTemporaryFilePrivate * const d = d_func();-
314 d->templateName = QTemporaryFilePrivate::defaultTemplateName();-
315}
executed 1038 times by 9 tests: end of block
Executed by:
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QImageWriter
  • tst_QMetaType
  • tst_QMimeDatabase
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QStorageInfo
  • tst_QTemporaryFile
1038
316QTemporaryFile::QTemporaryFile(const QString &templateName)-
317 : QFile(*new QTemporaryFilePrivate, 0)-
318{-
319 QTemporaryFilePrivate * const d = d_func();-
320 d->templateName = templateName;-
321}
executed 455 times by 20 tests: end of block
Executed by:
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
455
322QTemporaryFile::QTemporaryFile(QObject *parent)-
323 : QFile(*new QTemporaryFilePrivate, parent)-
324{-
325 QTemporaryFilePrivate * const d = d_func();-
326 d->templateName = QTemporaryFilePrivate::defaultTemplateName();-
327}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QTemporaryFile
1
328QTemporaryFile::QTemporaryFile(const QString &templateName, QObject *parent)-
329 : QFile(*new QTemporaryFilePrivate, parent)-
330{-
331 QTemporaryFilePrivate * const d = d_func();-
332 d->templateName = templateName;-
333}
executed 87 times by 3 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
87
334QTemporaryFile::~QTemporaryFile()-
335{-
336 QTemporaryFilePrivate * const d = d_func();-
337 close();-
338 if (!d->fileName.isEmpty()
!d->fileName.isEmpty()Description
TRUEevaluated 1570 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_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qdbusmarshall - unknown status
  • tst_qlockfile - unknown status
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_QMetaType
  • tst_QTemporaryFile
&& d->autoRemove
d->autoRemoveDescription
TRUEevaluated 348 times by 22 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QDir
  • 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_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qdbusmarshall - unknown status
  • tst_qlockfile - unknown status
FALSEevaluated 1222 times by 10 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTemporaryFile
)
12-1570
339 remove();
executed 348 times by 22 tests: remove();
Executed by:
  • tst_QColorDialog
  • tst_QDir
  • 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_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qdbusmarshall - unknown status
  • tst_qlockfile - unknown status
348
340}
executed 1582 times by 26 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_qdbusmarshall - unknown status
  • ...
1582
341bool QTemporaryFile::autoRemove() const-
342{-
343 const QTemporaryFilePrivate * const d = d_func();-
344 return
executed 2 times by 1 test: return d->autoRemove;
Executed by:
  • tst_QTemporaryFile
d->autoRemove;
executed 2 times by 1 test: return d->autoRemove;
Executed by:
  • tst_QTemporaryFile
2
345}-
346void QTemporaryFile::setAutoRemove(bool b)-
347{-
348 QTemporaryFilePrivate * const d = d_func();-
349 d->autoRemove = b;-
350}
executed 1245 times by 10 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTemporaryFile
1245
351QString QTemporaryFile::fileName() const-
352{-
353 const QTemporaryFilePrivate * const d = d_func();-
354 if(d->fileName.isEmpty()
d->fileName.isEmpty()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
FALSEevaluated 2314 times by 15 tests
Evaluated by:
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QStorageInfo
  • tst_QTemporaryFile
)
6-2314
355 return
executed 6 times by 1 test: return QString();
Executed by:
  • tst_QTemporaryFile
QString();
executed 6 times by 1 test: return QString();
Executed by:
  • tst_QTemporaryFile
6
356 return
executed 2314 times by 15 tests: return d->engine()->fileName(QAbstractFileEngine::DefaultName);
Executed by:
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QStorageInfo
  • tst_QTemporaryFile
d->engine()->fileName(QAbstractFileEngine::DefaultName);
executed 2314 times by 15 tests: return d->engine()->fileName(QAbstractFileEngine::DefaultName);
Executed by:
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QStorageInfo
  • tst_QTemporaryFile
2314
357}-
358-
359-
360-
361-
362-
363-
364-
365QString QTemporaryFile::fileTemplate() const-
366{-
367 const QTemporaryFilePrivate * const d = d_func();-
368 return
executed 10 times by 1 test: return d->templateName;
Executed by:
  • tst_QTemporaryFile
d->templateName;
executed 10 times by 1 test: return d->templateName;
Executed by:
  • tst_QTemporaryFile
10
369}-
370void QTemporaryFile::setFileTemplate(const QString &name)-
371{-
372 QTemporaryFilePrivate * const d = d_func();-
373 d->templateName = name;-
374 if (d->fileEngine
d->fileEngineDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
FALSEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QDBusMarshall
  • tst_QTemporaryFile
)
2-7
375 static_cast<
executed 2 times by 1 test: static_cast<QTemporaryFileEngine*>(d->fileEngine)->setFileTemplate(name);
Executed by:
  • tst_QTemporaryFile
QTemporaryFileEngine*>(d->fileEngine)->setFileTemplate(name);
executed 2 times by 1 test: static_cast<QTemporaryFileEngine*>(d->fileEngine)->setFileTemplate(name);
Executed by:
  • tst_QTemporaryFile
2
376}
executed 9 times by 2 tests: end of block
Executed by:
  • tst_QDBusMarshall
  • tst_QTemporaryFile
9
377QTemporaryFile *QTemporaryFile::createNativeFile(QFile &file)-
378{-
379 if (QAbstractFileEngine *engine = file.d_func()->engine()
QAbstractFileE...nc()->engine()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
FALSEnever evaluated
) {
0-4
380 if(engine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::LocalDiskFlag
engine->fileFl...:LocalDiskFlagDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
)
2
381 return
executed 2 times by 1 test: return 0;
Executed by:
  • tst_QTemporaryFile
0;
executed 2 times by 1 test: return 0;
Executed by:
  • tst_QTemporaryFile
2
382-
383 bool wasOpen = file.isOpen();-
384 qint64 old_off = 0;-
385 if(wasOpen
wasOpenDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QTemporaryFile
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QTemporaryFile
)
1
386 old_off = file.pos();
executed 1 time by 1 test: old_off = file.pos();
Executed by:
  • tst_QTemporaryFile
1
387 else-
388 file.open(QIODevice::ReadOnly);
executed 1 time by 1 test: file.open(QIODevice::ReadOnly);
Executed by:
  • tst_QTemporaryFile
1
389-
390 QTemporaryFile *ret = new QTemporaryFile;-
391 ret->open();-
392 file.seek(0);-
393 char buffer[1024];-
394 while(true) {-
395 qint64 len = file.read(buffer, 1024);-
396 if(len < 1
len < 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
)
2
397 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QTemporaryFile
2
398 ret->write(buffer, len);-
399 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QTemporaryFile
2
400 ret->seek(0);-
401-
402 if(wasOpen
wasOpenDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QTemporaryFile
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QTemporaryFile
)
1
403 file.seek(old_off);
executed 1 time by 1 test: file.seek(old_off);
Executed by:
  • tst_QTemporaryFile
1
404 else-
405 file.close();
executed 1 time by 1 test: file.close();
Executed by:
  • tst_QTemporaryFile
1
406-
407 return
executed 2 times by 1 test: return ret;
Executed by:
  • tst_QTemporaryFile
ret;
executed 2 times by 1 test: return ret;
Executed by:
  • tst_QTemporaryFile
2
408 }-
409 return
never executed: return 0;
0;
never executed: return 0;
0
410}-
411bool QTemporaryFile::open(OpenMode flags)-
412{-
413 QTemporaryFilePrivate * const d = d_func();-
414 if (!d->fileName.isEmpty()
!d->fileName.isEmpty()Description
TRUEevaluated 25 times by 3 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QImageReader
  • tst_QTemporaryFile
FALSEevaluated 1578 times by 25 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
) {
25-1578
415 if (static_cast<
static_cast<QT...isReallyOpen()Description
TRUEevaluated 22 times by 3 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QImageReader
  • tst_QTemporaryFile
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
QTemporaryFileEngine*>(d->engine())->isReallyOpen()
static_cast<QT...isReallyOpen()Description
TRUEevaluated 22 times by 3 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QImageReader
  • tst_QTemporaryFile
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
) {
3-22
416 setOpenMode(flags);-
417 return
executed 22 times by 3 tests: return true;
Executed by:
  • tst_QFileDialog2
  • tst_QImageReader
  • tst_QTemporaryFile
true;
executed 22 times by 3 tests: return true;
Executed by:
  • tst_QFileDialog2
  • tst_QImageReader
  • tst_QTemporaryFile
22
418 }-
419 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QTemporaryFile
3
420-
421-
422-
423-
424-
425-
426 d->resetFileEngine();-
427-
428 if (QFile::open(flags)
QFile::open(flags)Description
TRUEevaluated 1573 times by 25 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QTemporaryFile
) {
8-1573
429 d->fileName = d->fileEngine->fileName(QAbstractFileEngine::DefaultName);-
430 return
executed 1573 times by 25 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
true;
executed 1573 times by 25 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDBusMarshall
  • 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_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPdfWriter
  • tst_QPixmap
  • tst_QSettings
  • tst_QStorageInfo
  • tst_QTemporaryFile
  • tst_languageChange
  • tst_qlockfile - unknown status
1573
431 }-
432 return
executed 8 times by 1 test: return false;
Executed by:
  • tst_QTemporaryFile
false;
executed 8 times by 1 test: return false;
Executed by:
  • tst_QTemporaryFile
8
433}-
434-
435-
Switch to Source codePreprocessed file

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