summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/scxmlqmlcpp/data/smlHelper.qml6
-rw-r--r--tests/auto/qml/scxmlqmlcpp/tst_scxmlqmlcpp.cpp12
2 files changed, 15 insertions, 3 deletions
diff --git a/tests/auto/qml/scxmlqmlcpp/data/smlHelper.qml b/tests/auto/qml/scxmlqmlcpp/data/smlHelper.qml
new file mode 100644
index 0000000..8deec6e
--- /dev/null
+++ b/tests/auto/qml/scxmlqmlcpp/data/smlHelper.qml
@@ -0,0 +1,6 @@
+import QtQuick
+import QtScxml
+
+StateMachineLoader {
+ objectName: 'helper'
+}
diff --git a/tests/auto/qml/scxmlqmlcpp/tst_scxmlqmlcpp.cpp b/tests/auto/qml/scxmlqmlcpp/tst_scxmlqmlcpp.cpp
index c3c3501..5d10fa5 100644
--- a/tests/auto/qml/scxmlqmlcpp/tst_scxmlqmlcpp.cpp
+++ b/tests/auto/qml/scxmlqmlcpp/tst_scxmlqmlcpp.cpp
@@ -112,8 +112,8 @@ void tst_scxmlqmlcpp::stateMachineLoaderSourceStateMachineBinding()
{
// Test source and stateMachine together as they interact with each other
- QUrl source1(testFileUrl("statemachine.scxml"));
- QUrl source2(testFileUrl("topmachine.scxml"));
+ QUrl source1(testFileUrl("submachineA.scxml"));
+ QUrl source2(testFileUrl("submachineB.scxml"));
// The 'setSource' of the statemachineloader assumes a valid qml context
QQmlEngine engine;
const QUrl smlUrl = testFileUrl("stateMachineLoader.qml");
@@ -124,9 +124,15 @@ void tst_scxmlqmlcpp::stateMachineLoaderSourceStateMachineBinding()
qobject_cast<QScxmlStateMachineLoader*>(root->findChild<QObject*>("sml"));
QVERIFY(sml != nullptr);
+ QQmlComponent otherComponent(&engine, testFileUrl("smlHelper.qml"));
+
// -- StateMachineLoader::source
QTestPrivate::testReadWritePropertyBasics<QScxmlStateMachineLoader, QUrl>(
- *sml, source1, source2, "source");
+ *sml, source1, source2, "source",
+ [&otherComponent]() {
+ return std::unique_ptr<QScxmlStateMachineLoader>(
+ qobject_cast<QScxmlStateMachineLoader*>(otherComponent.create()));
+ });
if (QTest::currentTestFailed()) {
qWarning() << "QScxmlStateMachineLoader::source property testing failed";
return;