summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp')
-rw-r--r--tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp b/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp
index 50671e17f2..4b9a23ffcf 100644
--- a/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp
+++ b/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtCore/QTemporaryDir>
#include <QTest>
@@ -54,7 +54,7 @@ void tst_qfileopenevent::cleanupTestCase()
void tst_qfileopenevent::createFile(const QString &filename, const QByteArray &content)
{
QFile file(filename);
- file.open(QFile::WriteOnly);
+ QVERIFY(file.open(QFile::WriteOnly));
file.write(content);
file.close();
}
@@ -79,7 +79,8 @@ void tst_qfileopenevent::constructor()
QByteArray tst_qfileopenevent::readFileContent(QFileOpenEvent& event)
{
QFile file(event.file());
- file.open(QFile::ReadOnly);
+ if (!file.open(QFile::ReadOnly))
+ qFatal("Cannot open file %s", qPrintable(event.file()));
file.seek(0);
QByteArray data = file.readAll();
return data;
@@ -138,7 +139,7 @@ void tst_qfileopenevent::handleLifetime()
// check the content
QFile checkContent("testHandleLifetime");
- checkContent.open(QFile::ReadOnly);
+ QVERIFY(checkContent.open(QFile::ReadOnly));
QString content(checkContent.readAll());
QCOMPARE(content, QLatin1String("test content+closed original handles"));
checkContent.close();