Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | class QTemporaryDirPrivate | - |
12 | { | - |
13 | public: | - |
14 | QTemporaryDirPrivate(); | - |
15 | ~QTemporaryDirPrivate(); | - |
16 | | - |
17 | void create(const QString &templateName); | - |
18 | | - |
19 | QString pathOrError; | - |
20 | bool autoRemove; | - |
21 | bool success; | - |
22 | }; | - |
23 | | - |
24 | QTemporaryDirPrivate::QTemporaryDirPrivate() | - |
25 | : autoRemove(true), | - |
26 | success(false) | - |
27 | { | - |
28 | }executed 1210 times by 29 tests: end of block Executed by:- tst_LargeFile
- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDataStream
- tst_QDir
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIODevice
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- ...
| 1210 |
29 | | - |
30 | QTemporaryDirPrivate::~QTemporaryDirPrivate() | - |
31 | { | - |
32 | } | - |
33 | | - |
34 | static QString defaultTemplateName() | - |
35 | { | - |
36 | QString baseName; | - |
37 | | - |
38 | baseName = QCoreApplication::applicationName(); | - |
39 | if (baseName.isEmpty()TRUE | evaluated 2 times by 2 testsEvaluated by:- tst_LargeFile
- tst_QAbstractFileEngine
| FALSE | evaluated 81 times by 18 testsEvaluated by:- tst_QDataStream
- tst_QFileInfo
- tst_QFiledialog
- tst_QIODevice
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QMimeDatabase
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlThread
- tst_QTemporaryDir
|
) | 2-81 |
40 | | - |
41 | baseName = QLatin1String("qt_temp");executed 2 times by 2 tests: baseName = QLatin1String("qt_temp"); Executed by:- tst_LargeFile
- tst_QAbstractFileEngine
| 2 |
42 | | - |
43 | returnexecuted 83 times by 20 tests: return QDir::tempPath() + QLatin1Char('/') + baseName + QLatin1String("-XXXXXX"); Executed by:- tst_LargeFile
- tst_QAbstractFileEngine
- tst_QDataStream
- tst_QFileInfo
- tst_QFiledialog
- tst_QIODevice
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QMimeDatabase
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlThread
- tst_QTemporaryDir
QDir::tempPath() + QLatin1Char('/') + baseName + QLatin1String("-XXXXXX");executed 83 times by 20 tests: return QDir::tempPath() + QLatin1Char('/') + baseName + QLatin1String("-XXXXXX"); Executed by:- tst_LargeFile
- tst_QAbstractFileEngine
- tst_QDataStream
- tst_QFileInfo
- tst_QFiledialog
- tst_QIODevice
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QMimeDatabase
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlThread
- tst_QTemporaryDir
| 83 |
44 | } | - |
45 | QPair<QString, bool> q_mkdtemp(char *templateName) | - |
46 | { | - |
47 | bool ok = (mkdtemp(templateName) != 0); | - |
48 | returnexecuted 1210 times by 29 tests: return qMakePair(ok ? QFile::decodeName(templateName) : qt_error_string(), ok); Executed by:- tst_LargeFile
- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDataStream
- tst_QDir
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIODevice
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- ...
qMakePair(ok ? QFile::decodeName(templateName) : qt_error_string(), ok);executed 1210 times by 29 tests: return qMakePair(ok ? QFile::decodeName(templateName) : qt_error_string(), ok); Executed by:- tst_LargeFile
- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDataStream
- tst_QDir
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIODevice
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- ...
| 1210 |
49 | } | - |
50 | | - |
51 | | - |
52 | | - |
53 | void QTemporaryDirPrivate::create(const QString &templateName) | - |
54 | { | - |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | QByteArray buffer = QFile::encodeName(templateName); | - |
62 | if (!buffer.endsWith("XXXXXX")TRUE | evaluated 35 times by 3 testsEvaluated by:- tst_QLocalSocket
- tst_QNetworkReply
- tst_QTemporaryDir
| FALSE | evaluated 1175 times by 27 testsEvaluated by:- tst_LargeFile
- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDataStream
- tst_QDir
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIODevice
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QMimeDatabase
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlThread
- tst_QTemporaryDir
- ...
|
) | 35-1175 |
63 | buffer += "XXXXXX";executed 35 times by 3 tests: buffer += "XXXXXX"; Executed by:- tst_QLocalSocket
- tst_QNetworkReply
- tst_QTemporaryDir
| 35 |
64 | QPair<QString, bool> result = q_mkdtemp(buffer.data()); | - |
65 | | - |
66 | pathOrError = result.first; | - |
67 | success = result.second; | - |
68 | }executed 1210 times by 29 tests: end of block Executed by:- tst_LargeFile
- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDataStream
- tst_QDir
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIODevice
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- ...
| 1210 |
69 | QTemporaryDir::QTemporaryDir() | - |
70 | : d_ptr(new QTemporaryDirPrivate) | - |
71 | { | - |
72 | d_ptr->create(defaultTemplateName()); | - |
73 | }executed 82 times by 20 tests: end of block Executed by:- tst_LargeFile
- tst_QAbstractFileEngine
- tst_QDataStream
- tst_QFileInfo
- tst_QFiledialog
- tst_QIODevice
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QMimeDatabase
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlThread
- tst_QTemporaryDir
| 82 |
74 | QTemporaryDir::QTemporaryDir(const QString &templatePath) | - |
75 | : d_ptr(new QTemporaryDirPrivate) | - |
76 | { | - |
77 | if (templatePath.isEmpty()TRUE | evaluated 1 time by 1 test | FALSE | evaluated 1127 times by 11 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDir
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QLocalSocket
- tst_QNetworkReply
- tst_QTemporaryDir
- tst_QXmlStream
- tst_languageChange
|
) | 1-1127 |
78 | d_ptr->create(defaultTemplateName());executed 1 time by 1 test: d_ptr->create(defaultTemplateName()); | 1 |
79 | else | - |
80 | d_ptr->create(templatePath);executed 1127 times by 11 tests: d_ptr->create(templatePath); Executed by:- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDir
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QLocalSocket
- tst_QNetworkReply
- tst_QTemporaryDir
- tst_QXmlStream
- tst_languageChange
| 1127 |
81 | } | - |
82 | QTemporaryDir::~QTemporaryDir() | - |
83 | { | - |
84 | if (d_ptr->autoRemoveTRUE | evaluated 230 times by 47 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDir
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QTemporaryDir
- tst_QXmlStream
- tst_languageChange
- tst_largefile - unknown status
- tst_qabstractfileengine - unknown status
- tst_qdatastream - unknown status
- tst_qfile - unknown status
- tst_qfiledialog2 - unknown status
- tst_qfileinfo - unknown status
- ...
| FALSE | evaluated 1001 times by 1 test |
) | 230-1001 |
85 | remove();executed 230 times by 47 tests: remove(); Executed by:- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDir
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QTemporaryDir
- tst_QXmlStream
- tst_languageChange
- tst_largefile - unknown status
- tst_qabstractfileengine - unknown status
- tst_qdatastream - unknown status
- tst_qfile - unknown status
- tst_qfiledialog2 - unknown status
- tst_qfileinfo - unknown status
- ...
| 230 |
86 | }executed 1231 times by 47 tests: end of block Executed by:- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDir
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QTemporaryDir
- tst_QXmlStream
- tst_languageChange
- tst_largefile - unknown status
- tst_qabstractfileengine - unknown status
- tst_qdatastream - unknown status
- tst_qfile - unknown status
- tst_qfiledialog2 - unknown status
- tst_qfileinfo - unknown status
- ...
| 1231 |
87 | | - |
88 | | - |
89 | | - |
90 | | - |
91 | bool QTemporaryDir::isValid() const | - |
92 | { | - |
93 | returnexecuted 1237 times by 37 tests: return d_ptr->success; Executed by:- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDir
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIcon
- tst_QImageReader
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QLockFile
- tst_QMimeDatabase
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QPixmap
- tst_QProcess
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QSqlDatabase
- ...
d_ptr->success;executed 1237 times by 37 tests: return d_ptr->success; Executed by:- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDir
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIcon
- tst_QImageReader
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QLockFile
- tst_QMimeDatabase
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QPixmap
- tst_QProcess
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QSqlDatabase
- ...
| 1237 |
94 | } | - |
95 | QString QTemporaryDir::errorString() const | - |
96 | { | - |
97 | returnexecuted 1100 times by 23 tests: return d_ptr->success ? QString() : d_ptr->pathOrError; Executed by:- tst_QAbstractNetworkCache
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIcon
- tst_QImageReader
- tst_QImageWriter
- tst_QLockFile
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QPixmap
- tst_QProcess
- tst_QSaveFile
- tst_QTemporaryDir
- tst_QTemporaryFile
- tst_QTextStream
- tst_Selftests
- tst_languageChange
- tst_qstandardpaths
- tst_uic
d_ptr->success ? QString() : d_ptr->pathOrError;executed 1100 times by 23 tests: return d_ptr->success ? QString() : d_ptr->pathOrError; Executed by:- tst_QAbstractNetworkCache
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIcon
- tst_QImageReader
- tst_QImageWriter
- tst_QLockFile
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QPixmap
- tst_QProcess
- tst_QSaveFile
- tst_QTemporaryDir
- tst_QTemporaryFile
- tst_QTextStream
- tst_Selftests
- tst_languageChange
- tst_qstandardpaths
- tst_uic
| 1100 |
98 | } | - |
99 | | - |
100 | | - |
101 | | - |
102 | | - |
103 | | - |
104 | QString QTemporaryDir::path() const | - |
105 | { | - |
106 | returnexecuted 5034 times by 69 tests: return d_ptr->success ? d_ptr->pathOrError : QString(); Executed by:- tst_LargeFile
- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDataStream
- tst_QDir
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIODevice
- tst_QIcon
- tst_QImageReader
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QLockFile
- tst_QMimeDatabase
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QPixmap
- tst_QProcess
- tst_QSaveFile
- ...
d_ptr->success ? d_ptr->pathOrError : QString();executed 5034 times by 69 tests: return d_ptr->success ? d_ptr->pathOrError : QString(); Executed by:- tst_LargeFile
- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDataStream
- tst_QDir
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIODevice
- tst_QIcon
- tst_QImageReader
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QLockFile
- tst_QMimeDatabase
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QPixmap
- tst_QProcess
- tst_QSaveFile
- ...
| 5034 |
107 | } | - |
108 | bool QTemporaryDir::autoRemove() const | - |
109 | { | - |
110 | returnexecuted 2 times by 1 test: return d_ptr->autoRemove; d_ptr->autoRemove;executed 2 times by 1 test: return d_ptr->autoRemove; | 2 |
111 | } | - |
112 | void QTemporaryDir::setAutoRemove(bool b) | - |
113 | { | - |
114 | d_ptr->autoRemove = b; | - |
115 | }executed 1009 times by 4 tests: end of block Executed by:- tst_QFileInfo
- tst_QNetworkReply
- tst_QTemporaryDir
- tst_languageChange
| 1009 |
116 | | - |
117 | | - |
118 | | - |
119 | | - |
120 | | - |
121 | | - |
122 | bool QTemporaryDir::remove() | - |
123 | { | - |
124 | if (!d_ptr->successTRUE | evaluated 7 times by 1 test | FALSE | evaluated 226 times by 47 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDir
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QTemporaryDir
- tst_QXmlStream
- tst_languageChange
- tst_largefile - unknown status
- tst_qabstractfileengine - unknown status
- tst_qdatastream - unknown status
- tst_qfile - unknown status
- tst_qfiledialog2 - unknown status
- tst_qfileinfo - unknown status
- ...
|
) | 7-226 |
125 | returnexecuted 7 times by 1 test: return false; false;executed 7 times by 1 test: return false; | 7 |
126 | ((!(!path().isEmpty())) ? qt_assert("!path().isEmpty()",__FILE__,345) : qt_noop()); | - |
127 | ((!(path() != QLatin1String("."))) ? qt_assert("path() != QLatin1String(\".\")",__FILE__,346) : qt_noop()); | - |
128 | | - |
129 | const bool result = QDir(path()).removeRecursively(); | - |
130 | if (!resultTRUE | never evaluated | FALSE | evaluated 226 times by 47 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDir
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QTemporaryDir
- tst_QXmlStream
- tst_languageChange
- tst_largefile - unknown status
- tst_qabstractfileengine - unknown status
- tst_qdatastream - unknown status
- tst_qfile - unknown status
- tst_qfiledialog2 - unknown status
- tst_qfileinfo - unknown status
- ...
|
) { | 0-226 |
131 | QMessageLogger(__FILE__, 350, __PRETTY_FUNCTION__).warning() << "QTemporaryDir: Unable to remove" | - |
132 | << QDir::toNativeSeparators(path()) | - |
133 | << "most likely due to the presence of read-only files."; | - |
134 | } never executed: end of block | 0 |
135 | returnexecuted 226 times by 47 tests: return result; Executed by:- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDir
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QTemporaryDir
- tst_QXmlStream
- tst_languageChange
- tst_largefile - unknown status
- tst_qabstractfileengine - unknown status
- tst_qdatastream - unknown status
- tst_qfile - unknown status
- tst_qfiledialog2 - unknown status
- tst_qfileinfo - unknown status
- ...
result;executed 226 times by 47 tests: return result; Executed by:- tst_QAbstractFileEngine
- tst_QAbstractNetworkCache
- tst_QCompleter
- tst_QDir
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QIcon
- tst_QImageWriter
- tst_QItemModel
- tst_QLocalSocket
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QSaveFile
- tst_QSharedPointer
- tst_QSql
- tst_QTemporaryDir
- tst_QXmlStream
- tst_languageChange
- tst_largefile - unknown status
- tst_qabstractfileengine - unknown status
- tst_qdatastream - unknown status
- tst_qfile - unknown status
- tst_qfiledialog2 - unknown status
- tst_qfileinfo - unknown status
- ...
| 226 |
136 | } | - |
137 | | - |
138 | | - |
| | |