TriggerExpressionPrecedence.sctunit 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * These test cases check the precedence issues that occured with the construction of the trigger condition
  3. * that consists of the trigger and guard part.
  4. * The condition for a local reaction and transition depends on the trigger and guard part.
  5. */
  6. testclass TriggerExpressionPrecedence for statechart expressions.TriggerExpressionPrecedence {
  7. /** If a trigger is specified and not active then the trigger condition should not become true. */
  8. @Test
  9. operation unsatisfiedTriggerAndFGuardFalseOrFalse(){
  10. enter
  11. c1 = false
  12. c2 = false
  13. proceed 1 cycle
  14. assert ! e1_transition
  15. }
  16. /** If a trigger is specified and not active then the trigger condition should not become true. */
  17. @Test
  18. operation unsatisfiedTriggerAndFGuardTrueOrFalse(){
  19. enter
  20. c1 = true
  21. c2 = false
  22. proceed 1 cycle
  23. assert ! e1_transition
  24. }
  25. /** If a trigger is specified and not active then the trigger condition should not become true. */
  26. @Test
  27. operation unsatisfiedTriggerAndFGuardFalseOrTrue(){
  28. enter
  29. c1 = false
  30. c2 = true
  31. proceed 1 cycle
  32. assert ! e1_transition
  33. }
  34. /** If a trigger is specified and not active then the trigger condition should not become true. */
  35. @Test
  36. operation unsatisfiedTriggerAndFGuardTrueOrTrue(){
  37. enter
  38. c1 = true
  39. c2 = true
  40. proceed 1 cycle
  41. assert ! e1_transition
  42. }
  43. }