DeepHistory.sctunit 840 B

123456789101112131415161718192021222324252627282930
  1. testcase for DeepHistory {
  2. test deepHistoryTest {
  3. // Change active states to State9;
  4. raise event1
  5. cycle
  6. raise event3
  7. cycle
  8. raise event5
  9. cycle
  10. raise event7
  11. cycle
  12. assert !active (DeepHistory.mainRegion.State1)
  13. assert active (DeepHistory.mainRegion.State2._region0.State4._region0.State7._region0.State9)
  14. // Leave State2. State4 and State9 should be saved as history.
  15. raise event2
  16. cycle
  17. assert active ( DeepHistory.mainRegion.State1)
  18. assert active ( DeepHistory.mainRegion.State2._region0.State4._region0.State7._region0.State9)
  19. // Reenter State2. State9 should be activated (History of State2).
  20. raise event1
  21. cycle
  22. assert !active (DeepHistory.mainRegion.State1)
  23. assert active (DeepHistory.mainRegion.State2._region0.State4._region0.State7._region0.State9)
  24. }
  25. }