ShallowHistoryWithDeepEntry.sctunit 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * A shallow history must also for child states that are only indirectly entered through one of the childs.
  3. */
  4. testgroup ShallowHistoryWithDeepEntry for statechart ShallowHistoryWithDeepEntry{
  5. test noDeepEntryWithinHistory {
  6. enter
  7. assert active(ShallowHistoryWithDeepEntry.main_region.Y)
  8. raise toZ
  9. cycle
  10. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.A)
  11. raise toY
  12. cycle
  13. assert active(ShallowHistoryWithDeepEntry.main_region.Y)
  14. raise toZ
  15. cycle
  16. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.A)
  17. }
  18. test deepEntryWithinHistory {
  19. enter
  20. assert active(ShallowHistoryWithDeepEntry.main_region.Y)
  21. raise toZ
  22. cycle
  23. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.A)
  24. raise toC
  25. cycle
  26. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B._region0.C)
  27. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B)
  28. raise toY
  29. cycle
  30. assert active(ShallowHistoryWithDeepEntry.main_region.Y)
  31. raise toZ
  32. cycle
  33. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B._region0.C)
  34. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B)
  35. }
  36. test directDeepEntryIntoHistory {
  37. enter
  38. assert active(ShallowHistoryWithDeepEntry.main_region.Y)
  39. raise toC
  40. cycle
  41. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B._region0.C)
  42. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B)
  43. raise toY
  44. cycle
  45. assert active(ShallowHistoryWithDeepEntry.main_region.Y)
  46. raise toZ
  47. cycle
  48. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B._region0.C)
  49. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B)
  50. }
  51. }