From 14e764dc331f0d5e2361cc69e3912b716b144ab8 Mon Sep 17 00:00:00 2001 From: Andrei Golubev Date: Thu, 23 Dec 2021 13:24:00 +0100 Subject: Enhance tst_qmltc::componentTypes() by verifying that ids are correct We can in fact check that the ids match to correct objects Change-Id: I46ed1a3d0a9ef429670fdc0438a5d717971c459c Reviewed-by: Fawzi Mohamed (cherry picked from commit feaed5f7aa6c82d9132e71037007b7c91ea57713) Reviewed-by: Fabian Kosmale --- tests/auto/qml/qmltc/tst_qmltc.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/auto/qml/qmltc/tst_qmltc.cpp b/tests/auto/qml/qmltc/tst_qmltc.cpp index f235b96acc..29cd95de31 100644 --- a/tests/auto/qml/qmltc/tst_qmltc.cpp +++ b/tests/auto/qml/qmltc/tst_qmltc.cpp @@ -582,6 +582,15 @@ void tst_qmltc::componentTypes() QScopedPointer enclosed(normalComponent->create()); QVERIFY(enclosed); QCOMPARE(enclosed->objectName(), u"enclosed"_qs); + + QQmlListReference children(&created, "data"); + QCOMPARE(children.size(), 4); + QCOMPARE(ctx->objectForName(u"normal"_qs), children.at(0)); + QCOMPARE(ctx->objectForName(u"accessibleNormal"_qs), children.at(1)); + QCOMPARE(ctx->objectForName(u"accessible"_qs), created.p2()); + QQuickTableView *table = qobject_cast(children.at(3)); + QVERIFY(table); + QCOMPARE(ctx->objectForName(u"accessibleDelegate"_qs), table->delegate()); } } -- cgit v1.2.3