diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2023-11-21 17:26:53 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-11-27 14:34:56 +0100 |
| commit | adc3455c115ab072fdb85e7d1206c835067fd532 (patch) | |
| tree | 3269027ed4f548aca1d94053ae1ea5ee675537f5 /tests/auto/qml/qmlsplitlib/tst_qmlsplitlib.cpp | |
| parent | 4dbd70b5a45f4a33e8ab6d4076be612d978a4ef8 (diff) | |
qmltyperegistrar: Guard against forbidden characters in target names
We don't want to generate invalid C++ from those.
Pick-to: 6.6 6.5
Fixes: QTBUG-118902
Change-Id: Ife580fe5d92f8f5c50be557dec07e1b0e12442d6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlsplitlib/tst_qmlsplitlib.cpp')
| -rw-r--r-- | tests/auto/qml/qmlsplitlib/tst_qmlsplitlib.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlsplitlib/tst_qmlsplitlib.cpp b/tests/auto/qml/qmlsplitlib/tst_qmlsplitlib.cpp index 893ed77ff7..92a9e07c4a 100644 --- a/tests/auto/qml/qmlsplitlib/tst_qmlsplitlib.cpp +++ b/tests/auto/qml/qmlsplitlib/tst_qmlsplitlib.cpp @@ -6,12 +6,14 @@ #include <QObject> #include <qtest.h> #include "lib.h" +#include "lib2.h" class tst_splitlib : public QObject { Q_OBJECT private slots: void verifyComponent(); + void verifyComponent2(); }; void tst_splitlib::verifyComponent() @@ -25,5 +27,16 @@ void tst_splitlib::verifyComponent() QVERIFY(lib); } +void tst_splitlib::verifyComponent2() +{ + QQmlEngine engine; + QQmlComponent c(&engine, QStringLiteral("qrc:/qt/qml/SplitLib/main2.qml")); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + QScopedPointer o(c.create()); + QVERIFY(!o.isNull()); + auto lib = qobject_cast<SplitLib2 *>(o.get()); + QVERIFY(lib); +} + QTEST_MAIN(tst_splitlib) #include "tst_qmlsplitlib.moc" |
