summaryrefslogtreecommitdiffstats
path: root/tests/auto/qstatemachine
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-21 15:23:17 +0200
committerKent Hansen <khansen@trolltech.com>2009-07-21 15:48:15 +0200
commitdcb735f92d87aacade6aa65079fe3da06efca553 (patch)
treef9500f28700a4db95498035f3236def93f0a1d9c /tests/auto/qstatemachine
parent77d9528d802b4e36423814ae2c52abc3e36de40c (diff)
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.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index efcb983d61..bafd8485c2 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;