-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2c7b80
commit 88070d7
Showing
5 changed files
with
79 additions
and
8 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
generators/ma2jsim-it/test/montiarc/montiarc/timed/automata/And.arc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package montiarc.timed.automata; | ||
|
||
component And { | ||
|
||
port in boolean a; | ||
port in boolean b; | ||
port out boolean q; | ||
|
||
boolean as = false; | ||
boolean bs = false; | ||
|
||
<<timed>> automaton { | ||
initial state S; | ||
S -> S a / { as = a; }; | ||
S -> S b / { bs = b; }; | ||
S -> S / { q = as && bs; }; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
generators/ma2jsim-it/test/montiarc/montiarc/timed/automata/AndTest.arc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package montiarc.timed.automata; | ||
|
||
import java.util.List; | ||
import montiarc.maunit.api.AssertEqualsTimed; | ||
import montiarc.maunit.api.EmitTimed; | ||
|
||
<<test, | ||
ticks=3, | ||
a=[ | ||
[[false, false], [true], [true]], | ||
[[false, false], [false], [false, true]] | ||
], | ||
b=[ | ||
[[false, true], [false], [true]], | ||
[[false, true], [false], [true, true]] | ||
], | ||
expected=[ | ||
[[false], [false], [true]], | ||
[[false], [false], [true]] | ||
]>> | ||
component AndTest(List<List<Boolean>> a, | ||
List<List<Boolean>> b, | ||
List<List<Boolean>> expected) { | ||
|
||
And sut; | ||
|
||
emitterA.out -> sut.a; | ||
emitterB.out -> sut.b; | ||
sut.q -> assertEquals.actual; | ||
|
||
AssertEqualsTimed<Boolean> assertEquals(expected); | ||
EmitTimed<Boolean> emitterA(a); | ||
EmitTimed<Boolean> emitterB(b); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters