ExitState.sctunit 1012 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. testgroup ExitState for statechart ExitState {
  2. /* An exit through an unnamed exit point must be taken by the transition without exit point spec (it must also be unguarded). */
  3. test defaultExit {
  4. enter
  5. assert active(ExitState.r.A)
  6. raise e
  7. cycle
  8. assert active(ExitState.r.E)
  9. }
  10. /* An exit through an named exit point must be taken by the transition with the matching exit point spec if it exists. */
  11. test namedExitThroughNamedTransition {
  12. enter
  13. assert active(ExitState.r.A)
  14. raise f
  15. cycle
  16. assert active(ExitState.r.F)
  17. }
  18. /* An exit through an named exit point must be taken by the default transition if no transition for this exit point exists. */
  19. test namedExitThroughDefaultTransition {
  20. enter
  21. assert active(ExitState.r.A)
  22. raise g
  23. cycle
  24. assert active(ExitState.r.E)
  25. }
  26. /* If no event is raised then the statechart must remain in state A. */
  27. test remainInA {
  28. enter
  29. assert active(ExitState.r.A)
  30. cycle
  31. assert active(ExitState.r.A)
  32. }
  33. }