-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
Showing
6 changed files
with
107 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
module TestSystem { | ||
|
||
// Define a subtype of integer | ||
type integer myNewType (0..50) | ||
|
||
// Declare Request struct type with 2 fields | ||
type record Request { | ||
myNewType param1, | ||
charstring param2 | ||
} | ||
|
||
// Declare Answer struct type with one field | ||
type record Answer { | ||
myNewType param1 | ||
} | ||
|
||
// Declare a message based communication port | ||
type port cEnv_type message { | ||
out Request; | ||
in Answer; | ||
} | ||
|
||
// Declare the component on which the test case will run | ||
type component sSystem { | ||
port cEnv_type cEnv; | ||
} | ||
|
||
// The templates define the outgoing parameter values | ||
// and verify the incoming parameter values | ||
template Request Good_Req := {param1 := 42, param2 := "hello !" }; | ||
template Answer All_is_OK := {param1 := 0}; | ||
|
||
// Define testcase1 that will run on sSystem component | ||
testcase testcase1() runs on sSystem | ||
{ | ||
// Send Request message with (42, "hello !") as parmeters | ||
cEnv.send(Good_Req); | ||
// An alternative for the 2 possible answers | ||
alt | ||
{ | ||
// Do we receive Answer with 0 as parameter | ||
[]cEnv.receive(All_is_OK) | ||
{ | ||
// Pass verdict ! | ||
setverdict(pass) | ||
} | ||
// Or do we receive something else | ||
[]cEnv.receive | ||
{ | ||
// Fail verdict | ||
setverdict(fail) | ||
} | ||
} | ||
} | ||
|
||
// Control part chains test cases execution automatically | ||
control { | ||
var verdicttype verdict1; | ||
verdict1 := execute(testcase1()); | ||
} | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -982,6 +982,7 @@ specificLanguages=( | |
'Teal ' | ||
'Templ ' | ||
'Terraform ' | ||
'TTCN-3 ' | ||
'TypeSpec ' | ||
'Typst ' | ||
'Web Services ' | ||
|