summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2018-11-01 16:35:29 -0700
committerLiang Qi <liang.qi@qt.io>2018-11-19 09:09:36 +0000
commit6b088b7a1da37511a8abb1503e4f2f95632dbdac (patch)
tree78ae5cc43dce8164a50cba8ed00ad7ee495ccde2 /tests
parent6a792d6f0b5a15ce09b7883bbbb06b2724596e40 (diff)
QResourceFileEngine: fix use of mapped files after close()
QFile::map() is documented to continue working after the QFile is closed, so this should work for the resource file engine too. Change-Id: I343f2beed55440a7ac0bfffd1563243a3966441f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
index 6461e6274f..0b50c391b8 100644
--- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
+++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
@@ -410,6 +410,10 @@ void tst_QResourceEngine::checkStructure()
QVERIFY2(ptr, qPrintable(file.errorString()));
QByteArray ba = QByteArray::fromRawData(reinterpret_cast<const char *>(ptr), file.size());
QCOMPARE(ba, contents);
+
+ // check that it is still valid after closing the file
+ file.close();
+ QCOMPARE(ba, contents);
}
QLocale::setDefault(QLocale::system());
}