diff options
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 7e116e9d6f..243b6b1296 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -72,6 +72,7 @@ private slots: void callContextPropertyLookupResult(); void callObjectLookupOnNull(); void callWithSpread(); + void collectGarbageDuringAotCode(); void colorAsVariant(); void colorString(); void compareOriginals(); @@ -1100,6 +1101,25 @@ void tst_QmlCppCodegen::callWithSpread() QVERIFY(!o.isNull()); } +void tst_QmlCppCodegen::collectGarbageDuringAotCode() +{ + QQmlEngine engine; + QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/collector.qml"_s)); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + QScopedPointer<QObject> o(c.create()); + QVERIFY(!o.isNull()); + + QObject *inner = o->property("o").value<QObject *>(); + QVERIFY(inner); + QCOMPARE(inner->objectName(), u"dynamic"_s); + + inner = o->property("o2").value<QObject *>(); + QVERIFY(inner); + QCOMPARE(inner->objectName(), u"dynamic"_s); + + QCOMPARE(o->property("gcRun").toInt(), 1); +} + void tst_QmlCppCodegen::colorAsVariant() { QQmlEngine engine; |
