diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2018-09-18 13:16:04 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2018-09-24 11:38:51 +0000 |
commit | 92b2a4f58db9d9ba2ba7428ff017521114c6371e (patch) | |
tree | 01b68bedd0c22850b184124f80f7cfc0f614e15f /tests/auto/quick/qquickrepeater | |
parent | eaf70aee7f64a44a705f800367dce58f15632275 (diff) |
Limit the repeater model size for integer models
Otherwise you might be able to put INT_MAX in, which would cause
problems with things like memory allocations.
Task-number: QTBUG-54752
Change-Id: I758d04af65049181c0c741ff42e92a6450963201
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'tests/auto/quick/qquickrepeater')
-rw-r--r-- | tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp index 0860956224..e4b427f6ec 100644 --- a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp +++ b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp @@ -133,6 +133,12 @@ void tst_QQuickRepeater::numberModel() QMetaObject::invokeMethod(window->rootObject(), "checkProperties"); QVERIFY(!testObject->error()); + ctxt->setContextProperty("testData", std::numeric_limits<int>::max()); + QCOMPARE(repeater->parentItem()->childItems().count(), 1); + + ctxt->setContextProperty("testData", -1234); + QCOMPARE(repeater->parentItem()->childItems().count(), 1); + delete testObject; delete window; } |