aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2021-02-09 21:29:49 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-09 21:59:26 +0000
commit8bd00df5283fa84de802e7affbc2818a2ff0666d (patch)
tree7806fc64ade072c98de61fc3b92e2015d46fde76 /tests
parent6544b8bd8fa1b5e843ebe41723fe578aba3092ae (diff)
Make tst_qmldiskcache::regenerateAfterChange() pass on big endian systems
We cannot use reinterpret_cast here, because testUnit->constants() returns a pointer to quint64_le data, which needs to be converted to native endianness first. Here I used the QV4::Value converter that accepts quint64, so this conversion now happens implicitly. Change-Id: Iff6e3e4554af8890e61cb06e6fd79339c7a14653 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit dab0d62b655ce9a476993de2558a573a5066288c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp
index d96231e81e..593eea3e3a 100644
--- a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp
+++ b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp
@@ -376,9 +376,8 @@ void tst_qmldiskcache::regenerateAfterChange()
QCOMPARE(quint32(obj->nBindings), quint32(2));
QCOMPARE(quint32(obj->bindingTable()->type), quint32(QV4::CompiledData::Binding::Type_Number));
- QCOMPARE(reinterpret_cast<const QV4::Value *>(testUnit->constants())
- [obj->bindingTable()->value.constantValueIndex].doubleValue(),
- double(42));
+ const QV4::Value value(testUnit->constants()[obj->bindingTable()->value.constantValueIndex]);
+ QCOMPARE(value.doubleValue(), double(42));
QCOMPARE(quint32(testUnit->functionTableSize), quint32(1));