diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-21 13:23:17 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-21 13:48:15 (GMT) |
commit | dcb735f92d87aacade6aa65079fe3da06efca553 (patch) | |
tree | f9500f28700a4db95498035f3236def93f0a1d9c /tests/auto/qstatemachine | |
parent | 77d9528d802b4e36423814ae2c52abc3e36de40c (diff) | |
download | Qt-dcb735f92d87aacade6aa65079fe3da06efca553.zip Qt-dcb735f92d87aacade6aa65079fe3da06efca553.tar.gz Qt-dcb735f92d87aacade6aa65079fe3da06efca553.tar.bz2 |
add autotest for adding transition from state machine's root
It's not supported because the root state has no ancestor,
which is a requirement for the state machine's transition
selection algorithm.
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; |