summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index b39f0a1..1cc2a8e 100644
--- a/tests/auto/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp
@@ -118,6 +118,7 @@ private slots:
void postEvent();
void stateFinished();
void parallelStates();
+ void parallelRootState();
void allSourceToTargetConfigurations();
void signalTransitions();
void eventTransitions();
@@ -1633,6 +1634,29 @@ void tst_QStateMachine::parallelStates()
QVERIFY(machine.configuration().contains(s2));
}
+void tst_QStateMachine::parallelRootState()
+{
+ QStateMachine machine;
+ QState *root = machine.rootState();
+ QCOMPARE(root->childMode(), QState::ExclusiveStates);
+ root->setChildMode(QState::ParallelStates);
+ QCOMPARE(root->childMode(), QState::ParallelStates);
+
+ QState *s1 = new QState(root);
+ QFinalState *s1_f = new QFinalState(s1);
+ s1->setInitialState(s1_f);
+ QState *s2 = new QState(root);
+ QFinalState *s2_f = new QFinalState(s2);
+ s2->setInitialState(s2_f);
+
+ QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QTest::ignoreMessage(QtWarningMsg, "QStateMachine::start: No initial state set for machine. Refusing to start.");
+ machine.start();
+ QCoreApplication::processEvents();
+ QEXPECT_FAIL("", "parallel root state is not supported (task 256587)", Continue);
+ QCOMPARE(startedSpy.count(), 1);
+}
+
void tst_QStateMachine::allSourceToTargetConfigurations()
{
QStateMachine machine;