summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2018-11-02 13:54:26 -0700
committerLiang Qi <liang.qi@qt.io>2018-11-19 09:09:31 +0000
commit6a792d6f0b5a15ce09b7883bbbb06b2724596e40 (patch)
tree27d8849f535946a6e7d0b6ff43b7a9c94c5097da /tests/auto/corelib
parent460866ee47c2a2ee98d7874a88bc3cc4b17b6f6a (diff)
QResourceFileEngine: fix map() for compressed files
We were returning a pointer to the compressed data and comparing to the compressed data size. Change-Id: I343f2beed55440a7ac0bfffd1563232d557c9427 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
index cf1d249f54..6461e6274f 100644
--- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
+++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
@@ -404,6 +404,12 @@ void tst_QResourceEngine::checkStructure()
// check contents
QCOMPARE(file.readAll(), contents);
+
+ // check memory map too
+ uchar *ptr = file.map(0, file.size(), QFile::MapPrivateOption);
+ QVERIFY2(ptr, qPrintable(file.errorString()));
+ QByteArray ba = QByteArray::fromRawData(reinterpret_cast<const char *>(ptr), file.size());
+ QCOMPARE(ba, contents);
}
QLocale::setDefault(QLocale::system());
}