diff options
author | Sami Shalayel <sami.shalayel@qt.io> | 2022-12-22 17:24:16 +0100 |
---|---|---|
committer | Sami Shalayel <sami.shalayel@qt.io> | 2023-02-09 18:19:16 +0100 |
commit | c3bd0911f5b5d6a878c7fbcf2c0095ced703a237 (patch) | |
tree | 3a68ae3f288d78f1ed81424036099878f9ebbb18 | |
parent | 84e6757bb004682e8fc5fd5a69997b41b69e5f4f (diff) |
make tst_qmltc::namespacedName() test something
Fix the tst_qmltc::namespacedName() test and check if the type
really can be used, instead of just checking if the type is there.
Now that the type is really used, fix the arising assertion by
adding the missing CMake dependency.
Change-Id: I283af9cba37fbe90d2d2c76e1be7e1801b613a77
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | tests/auto/qml/qmltc/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/auto/qml/qmltc/NamespaceTest/Subfolder/Type.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/qmltc/tst_qmltc.cpp | 5 |
3 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/qml/qmltc/CMakeLists.txt b/tests/auto/qml/qmltc/CMakeLists.txt index 1b7fbf6ee1..3aee154aeb 100644 --- a/tests/auto/qml/qmltc/CMakeLists.txt +++ b/tests/auto/qml/qmltc/CMakeLists.txt @@ -19,6 +19,7 @@ set(qmltc_module_libs # automatic type registration that comes from the plugin) qmltc_test_moduleplugin qmltc_namespace_test_module + qmltc_namespace_test_moduleplugin qmltc_exported_tests_module qmltc_exported_tests_moduleplugin ) diff --git a/tests/auto/qml/qmltc/NamespaceTest/Subfolder/Type.qml b/tests/auto/qml/qmltc/NamespaceTest/Subfolder/Type.qml index 101e9f69a1..3576353b02 100644 --- a/tests/auto/qml/qmltc/NamespaceTest/Subfolder/Type.qml +++ b/tests/auto/qml/qmltc/NamespaceTest/Subfolder/Type.qml @@ -1,5 +1,5 @@ import QtQuick Item { - property string data + property string data: "Hello from namespace" } diff --git a/tests/auto/qml/qmltc/tst_qmltc.cpp b/tests/auto/qml/qmltc/tst_qmltc.cpp index 381701991e..a704da4fe7 100644 --- a/tests/auto/qml/qmltc/tst_qmltc.cpp +++ b/tests/auto/qml/qmltc/tst_qmltc.cpp @@ -3205,8 +3205,9 @@ void tst_qmltc::namespacedName() { // cmake script should be able to auto-fill the namespace of the generated modules, and to // replace . with :: - NamespaceTest::Subfolder::Type *t; - Q_UNUSED(t); + QQmlEngine e; + NamespaceTest::Subfolder::Type t(&e); + QCOMPARE(t.data(), u"Hello from namespace"_s); } void tst_qmltc::checkExportsAreCompiling() |