From 92b2a4f58db9d9ba2ba7428ff017521114c6371e Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 18 Sep 2018 13:16:04 +0200 Subject: 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 --- tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/auto/quick/qquickrepeater') 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::max()); + QCOMPARE(repeater->parentItem()->childItems().count(), 1); + + ctxt->setContextProperty("testData", -1234); + QCOMPARE(repeater->parentItem()->childItems().count(), 1); + delete testObject; delete window; } -- cgit v1.2.3