diff options
Diffstat (limited to 'tests/auto/qstatemachine')
-rw-r--r-- | tests/auto/qstatemachine/tst_qstatemachine.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index efcb983..bafd848 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -127,6 +127,7 @@ private slots: void targetStateWithNoParent(); void targetStateDeleted(); void transitionToRootState(); + void transitionFromRootState(); void transitionEntersParent(); void defaultErrorState(); @@ -279,6 +280,15 @@ void tst_QStateMachine::transitionToRootState() QVERIFY(machine.configuration().contains(initialState)); } +void tst_QStateMachine::transitionFromRootState() +{ + QStateMachine machine; + QState *root = machine.rootState(); + QState *s1 = new QState(root); + QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: cannot add transition from root state"); + root->addTransition(new EventTransition(QEvent::User, s1)); +} + void tst_QStateMachine::transitionEntersParent() { QStateMachine machine; |