Page MenuHomePhabricator

Bug in mitkStateMachineFactory (checking consistency of statemachine patterns) and adding LogMessages
Closed, ResolvedPublic

Description

After closing T2413 (Controlled initialization of EventMapper and StateMachines), I found a bug in StatemachineFactory. During buildup of statemachine patterns, method RParse never returns true. The bool value is used to check if the statemachine patterns are defined propperly.

After solving the bug, I found two statemachine patterns in statemachine.xml that are not consistent. (drag and dragWithCtrl). There are several states, that cannot be cheached, because the startstate never leaves itself via the transitions.
Thus statemachine.xml also was adapted.

Event Timeline

wegner added a subscriber: wegner.

also Log messages are produced now. They show the name of the statemachine in which the error occurs.

Could testing also be done as part of StateMachineTest? E.g. providing a faulty XML-file?

Could be, yes.

Including statemachine.xml just has changed (T2413: xml-file now is compiled into application and not loaded during runtime) and Marco still has to solve an issue concerning file statemachine.xml.

Thereafter I could add a xml-file with a consistent and a corrupt statemachine pattern. But it might be a bit tricky, because only a warning message is produced once an inconsistent pattern is found. Don't know how to nicely check this! Do you have a suggestion?
...throwing (only) a warning is needed, cause all other statemachines should work even if there is one corrupt statemachine.

[SVN revision 19634]
FIX (#2719): removing unreachable states in patterns "drag" and "dragWithCtrl" in statemachine.xml; adding LOG messages in case unreachable states are found; Removing bug that lead to always returning false in RParse(...)