summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/statemachine/emptylog.scxml8
-rw-r--r--tests/auto/statemachine/tst_statemachine.cpp12
-rw-r--r--tests/auto/statemachine/tst_statemachine.qrc1
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/statemachine/emptylog.scxml b/tests/auto/statemachine/emptylog.scxml
new file mode 100644
index 0000000..e31f925
--- /dev/null
+++ b/tests/auto/statemachine/emptylog.scxml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" name="qtbug71746.scxml">
+ <state id="failing">
+ <onentry>
+ <log label="Hi2"/>
+ </onentry>
+ </state>
+</scxml>
diff --git a/tests/auto/statemachine/tst_statemachine.cpp b/tests/auto/statemachine/tst_statemachine.cpp
index 94b1d6f..4bd4ef2 100644
--- a/tests/auto/statemachine/tst_statemachine.cpp
+++ b/tests/auto/statemachine/tst_statemachine.cpp
@@ -56,6 +56,7 @@ private Q_SLOTS:
void invokeStateMachine();
void multipleInvokableServices(); // QTBUG-61484
+ void logWithoutExpr();
};
void tst_StateMachine::stateNames_data()
@@ -443,6 +444,17 @@ void tst_StateMachine::multipleInvokableServices()
QVERIFY(stateMachine->activeStateNames(true).contains(QLatin1String("success")));
}
+void tst_StateMachine::logWithoutExpr()
+{
+ QScopedPointer<QScxmlStateMachine> stateMachine(
+ QScxmlStateMachine::fromFile(QString(":/tst_statemachine/emptylog.scxml")));
+ QVERIFY(!stateMachine.isNull());
+ QTest::ignoreMessage(QtDebugMsg, "\"Hi2\" : \"\"");
+ stateMachine->start();
+ QSignalSpy logSpy(stateMachine.data(), SIGNAL(log(QString,QString)));
+ QTRY_COMPARE(logSpy.count(), 1);
+}
+
QTEST_MAIN(tst_StateMachine)
#include "tst_statemachine.moc"
diff --git a/tests/auto/statemachine/tst_statemachine.qrc b/tests/auto/statemachine/tst_statemachine.qrc
index 0bd68ff..599ba29 100644
--- a/tests/auto/statemachine/tst_statemachine.qrc
+++ b/tests/auto/statemachine/tst_statemachine.qrc
@@ -8,5 +8,6 @@
<file>invoke.scxml</file>
<file>historystate.scxml</file>
<file>multipleinvokableservices.scxml</file>
+ <file>emptylog.scxml</file>
</qresource>
</RCC>