From 9facf1be9b73da656557bab547aeb4148e6ff448 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 24 Sep 2015 15:56:57 +0200 Subject: Tests: Always verify whether QTemporaryDir/File creation succeeded. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use QVERIFY2() with QTemporaryDir/File::errorString() consistently. Attempt to catch issues like the below warning and follow-up issues. QSYSTEM: tst_QFiledialog::clearLineEdit() QFileSystemWatcher: FindNextChangeNotification failed for "C:\Users\qt\_____aaaaaaaaaaaaaaaaaaaaaa" (Access is denied.) Task-number: QTBUG-47370 Change-Id: I58a6e87c502627e976efa62ad73c912f3b2d49fa Reviewed-by: Jędrzej Nowacki --- tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/auto/dbus') diff --git a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp index b681f9829a..57fd5084be 100644 --- a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp +++ b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp @@ -150,7 +150,11 @@ int tst_QDBusMarshall::fileDescriptorForTest() { if (!tempFile.isOpen()) { tempFile.setFileTemplate(QDir::tempPath() + "/qdbusmarshalltestXXXXXX.tmp"); - tempFile.open(); + if (!tempFile.open()) { + qWarning("%s: Cannot create temporary file: %s", Q_FUNC_INFO, + qPrintable(tempFile.errorString())); + return 0; + } } return tempFile.handle(); } -- cgit v1.2.3