diff options
author | Dmitry Shachnev <mitya57@gmail.com> | 2021-02-09 21:29:49 +0300 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-09 21:59:26 +0000 |
commit | db8cba5e0a877b12683a47311569ce119df2005a (patch) | |
tree | 241bfed65392133d5b798545ddd7d4a63aadf0f6 /tests/auto | |
parent | 4b2eabdf21ff71d557bae36f99cf3998dafe324c (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/auto')
-rw-r--r-- | tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp | 5 |
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 d0c8390a74..9998a49ac3 100644 --- a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp +++ b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp @@ -332,9 +332,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)); |