aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2021-02-09 21:29:49 +0300
committerDmitry Shachnev <mitya57@gmail.com>2021-02-09 23:46:12 +0300
commitdab0d62b655ce9a476993de2558a573a5066288c (patch)
tree311e39f773329c6a946ea5fba67049a63ee8ecb5 /tests/auto/qml
parent707f7603fbb6bce60ed532cd42ff2dc9ae39e611 (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 Pick-to: 6.0 6.1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml')
-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));