aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmldiskcache
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-09-07 15:36:40 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-09-08 08:01:30 +0000
commit456cc50e01c083fafa4bf1e40389b343861d7c04 (patch)
tree1eb7f96b68e7fb141eee49305e66b68b0ece13ab /tests/auto/qml/qmldiskcache
parent0a3b69ff19476883ee704fa68b7ec8b4fe449cbe (diff)
Fix function offset check in compiled data cached on disk
The code for a function are now stored inline to the function, so the previous offsets were bogus. Change-Id: Ia8f28e56116bd9bcce1c5619e45af866f1bbf5e4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qmldiskcache')
-rw-r--r--tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp
index 17f782ab60..a285d13001 100644
--- a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp
+++ b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp
@@ -233,8 +233,9 @@ void tst_qmldiskcache::regenerateAfterChange()
QCOMPARE(quint32(testUnit->functionTableSize), quint32(1));
const QV4::CompiledData::Function *bindingFunction = testUnit->functionAt(0);
- quint64 firstCodeOffset = (testUnit->unitSize + 15u) & ~15u;
- QCOMPARE(bindingFunction->codeOffset, firstCodeOffset);
+ QCOMPARE(testUnit->stringAt(bindingFunction->nameIndex), QString("expression for blah")); // check if we have the correct function
+ QVERIFY(bindingFunction->codeSize > 0);
+ QVERIFY(bindingFunction->codeOffset < testUnit->unitSize);
}
{
@@ -258,8 +259,9 @@ void tst_qmldiskcache::regenerateAfterChange()
QCOMPARE(quint32(testUnit->functionTableSize), quint32(1));
const QV4::CompiledData::Function *bindingFunction = testUnit->functionAt(0);
- quint64 firstCodeOffset = (testUnit->unitSize + 15u) & ~15u;
- QCOMPARE(bindingFunction->codeOffset, firstCodeOffset);
+ QCOMPARE(testUnit->stringAt(bindingFunction->nameIndex), QString("expression for blah")); // check if we have the correct function
+ QVERIFY(bindingFunction->codeSize > 0);
+ QVERIFY(bindingFunction->codeOffset < testUnit->unitSize);
}
}