summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-11-18 18:06:44 +0100
committerUlf Hermann <ulf.hermann@qt.io>2016-11-22 09:17:28 +0000
commit198c94527b48eb402a4043ed5f6c24b04de43f76 (patch)
tree821501404c6f1e01a7e348d03ab6ceae028b22d3 /tests
parent9e85ae4674ed44e9c04dedb4ea4959833b6322cd (diff)
Distinguish invalid state/transition types from IDs and drop root state
Types and IDs are conceptually different and shouldn't be mixed up this way. Also, as far as I can see, there is no real need to invent a synthetic root state. Leaving that out saves us a lot of inconsistency (e.g. the root state didn't show up in allStates(), and you couldn't ask it for stateChildren()). Without the root state some transitions originate from the invalid state, but that is an equally good characterization for initial transitions as the synthetic root state. Change-Id: I3738df08d0e3702433dabd3fb837f0ddaea57465 Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/statemachineinfo/tst_statemachineinfo.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/statemachineinfo/tst_statemachineinfo.cpp b/tests/auto/statemachineinfo/tst_statemachineinfo.cpp
index 9814dbf..90491d5 100644
--- a/tests/auto/statemachineinfo/tst_statemachineinfo.cpp
+++ b/tests/auto/statemachineinfo/tst_statemachineinfo.cpp
@@ -98,7 +98,7 @@ void tst_StateMachineInfo::checkInfo()
auto info = new QScxmlStateMachineInfo(stateMachine.data());
const QString machineName = QLatin1String("InfoTest");
- QCOMPARE(info->stateName(QScxmlStateMachineInfo::StateMachineRootState), machineName);
+ QCOMPARE(stateMachine->name(), machineName);
auto states = info->allStates();
QCOMPARE(states.size(), 5);
@@ -120,7 +120,7 @@ void tst_StateMachineInfo::checkInfo()
// targetless transition on top level
QCOMPARE(info->transitionType(transitions.at(0)), QScxmlStateMachineInfo::ExternalTransition);
QCOMPARE(info->stateType(info->transitionSource(transitions.at(0))),
- QScxmlStateMachineInfo::StateMachineRootState);
+ QScxmlStateMachineInfo::InvalidState);
QCOMPARE(info->transitionTargets(transitions.at(0)).size(), 0);
QCOMPARE(info->transitionEvents(transitions.at(0)).size(), 0);
@@ -151,7 +151,7 @@ void tst_StateMachineInfo::checkInfo()
// initial transition that activates the first (anonymous) state
QCOMPARE(info->transitionType(transitions.at(4)), QScxmlStateMachineInfo::SyntheticTransition);
QCOMPARE(info->stateType(info->transitionSource(transitions.at(4))),
- QScxmlStateMachineInfo::StateMachineRootState);
+ QScxmlStateMachineInfo::InvalidState);
QCOMPARE(info->transitionTargets(transitions.at(4)).size(), 1);
QCOMPARE(info->transitionTargets(transitions.at(4)).at(0), states.at(0));
QCOMPARE(info->transitionEvents(transitions.at(4)).size(), 0);