Skip to content

Commit 3fb647b

Browse files
RIC-1081: More checks for passive class statemachines
1 parent f2d200e commit 3fb647b

8 files changed

Lines changed: 53 additions & 2 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class C0018 {
2+
statemachine { // ART_0018
3+
state State {
4+
entrypoint ep;
5+
exitpoint ex;
6+
junction j1;
7+
state N1;
8+
ep -> j1;
9+
j1 -> ex;
10+
};
11+
initial -> State.ep;
12+
State.ex -> State.ep;
13+
state Final;
14+
State.ex -> Final when `true`;
15+
};
16+
};

art-comp-test/tests/art_0018/testcase.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ ac_output match2c: Transition|27:9
1212
ac_output match3: ERROR[0018]|art_0018_inherited_sm.art|21:5
1313
ac_output match3a: Transition|11:9
1414
ac_output match3b: Transition|22:9
15+
16+
ac_output match4: ERROR[0018]|art_0018_passive_class_sm.art|2:5
17+
ac_output match4a: Transition|8:13
18+
ac_output match4b: Transition|9:13
19+
ac_output match4c: Transition|12:9
1520
---
1621
Test validation rule `ART_0018_circularTransitions`. Transition cycles can occur when junction or entry/exit points are incorrectly used.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class C {
2+
statemachine {
3+
state BS {
4+
entrypoint ep1;
5+
state Nested;
6+
};
7+
_Initial: initial -> BS; // ART_0030
8+
};
9+
};

art-comp-test/tests/art_0030/testcase.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
group: validation
33
steps: generate
44
ac_output match1: ERROR[0030]|art_0030.art|7:9|BS
5-
ac_output match2: ERROR[0030]|art_0030_inheritance.art|13:9|State
5+
ac_output match2: ERROR[0030]|art_0030_inheritance.art|13:9|State2
66
ac_output match3: ERROR[0030]|27:5|inherited transition|State2
77
ac_output match3a: Inherited triggered transition '_tx'|13:9
8+
ac_output match4: ERROR[0030]|art_0030_passive_class_sm.art|7:9|BS
89
---
910
Test validation rule `ART_0030_transitionToCompositeStateNoEntryNoInitialTrans`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class PC {
2+
trigger op1();
3+
4+
statemachine {
5+
state S1, S2;
6+
initial -> S1;
7+
junction j;
8+
j -> S1 on op1(); // ART_0036 (transition originates from junction)
9+
};
10+
};

art-comp-test/tests/art_0036/testcase.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ ac_output match3: ERROR[0036]|19:9|t3|choice
77
ac_output match4: ERROR[0036]|20:9|t4|exit point with incoming
88
ac_output match5: ERROR[0036]|39:5|inherited transition|entry point with incoming
99
ac_output match5a: t1|32:13
10+
ac_output match6: ERROR[0036]|art_0036_passive_class_sm.art|8:9|junction
1011
---
1112
Test validation rule `ART_0036_unexpectedTriggers`.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class PC {
2+
trigger op1();
3+
4+
statemachine {
5+
state S1, S2;
6+
initial -> S1;
7+
S1 -> S2; // ART_0037 (transition originates from state)
8+
};
9+
};

art-comp-test/tests/art_0037/testcase.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ ac_output match6: ERROR[0037]|40:5|inherited transition|entry point without inco
1010
ac_output match6a: Inherited transition|t1|32:13
1111
ac_output match7: ERROR[0037]|art_0037_inherited_sm.art:23:24|inherited transition|entry point without incoming
1212
ac_output match7a: Inherited transition|txxx|13:17
13-
13+
ac_output match8: ERROR[0037]|art_0037_passive_class.art|7:9|state
1414
---
1515
Test validation rule `ART_0037_missingTriggers`.

0 commit comments

Comments
 (0)