summaryrefslogtreecommitdiffstats
path: root/tests/auto/statemachine/tst_statemachine.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-11-13 13:01:11 +0100
committerUlf Hermann <ulf.hermann@qt.io>2018-11-14 08:45:42 +0000
commitbde8d341cc095a3877e4ecc80b02c267bb651d4b (patch)
tree4f07bcac22742f8ce19374c73ee40f6f84990a90 /tests/auto/statemachine/tst_statemachine.cpp
parentd5396ed00589374aed8e44f8f2e3217a3fb768df (diff)
Don't suppress <log> tags with missing or bad expr
Rather, output an empty string as message in this case. Ignoring log instructions is highly confusing. Change-Id: Iebb30ffd3ade33f1277f3073f015127a99170e40 Task-number: QTBUG-71746 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'tests/auto/statemachine/tst_statemachine.cpp')
-rw-r--r--tests/auto/statemachine/tst_statemachine.cpp12
1 files changed, 12 insertions, 0 deletions
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"