Commit 01889deb authored by kovacsa's avatar kovacsa
Browse files

fixes

parent f4808542
/***************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:9.1, Verify that a two TSI port cannot be connected
** @verdict pass reject, noexecution
***************************************************/
/*NOTE: see Figure 7(f): Two TSI port cannot be connected
* */
module NegSyn_0901_Communication_ports_001 {
type port P message {
inout integer
}
type component GeneralComp
{
port P p1, p2;
}
type component General_System_Comp
{
port P p_system_1, p_system_2;
}
testcase TC_NegSyn_0901_Communication_ports_001() runs on GeneralComp system General_System_Comp {
connect(system:p_system_1, system:p_system_2); // error: p_system_1 and p_system_2 cannot be connected
setverdict(pass);
}
control{
execute(TC_NegSyn_0901_Communication_ports_001());
}
}
/***************************************************
** @author STF 409 (updated by STF 521)
** @version 0.0.2
** @purpose 1:B.1.4.1, Ensure that the IUT correctly handles template matching of value length definitions
** @verdict pass accept, ttcn3verdict:fail
***************************************************/
module NegSem_B010401_length_restrictions_001 {
type record MessageType {
charstring field1,
bitstring field2,
hexstring field3,
charstring field4,
bitstring field5,
hexstring field6
}
type port loopbackPort message {
inout MessageType
}
type component GeneralComp {
port loopbackPort messagePort
}
testcase TC_NegSem_B010401_length_restrictions_001() runs on GeneralComp {
var MessageType v_testMessage;
template MessageType mw_matchingTemplate:=
{
field1 := pattern "test mess*ge" length (6 .. 8), //pattern is longer than length restriction
field2 := '10*'B length (3 .. 5),
field3 := '89*ABC'H length (5),
field4 := pattern "tes?" length (4 .. 13),
field5 := '10?'B length (3 .. 5),
field6 := '89?ABC'H length (6)
}
v_testMessage:= {
field1 := "test string",
field2 := '10101'B,
field3 := '89ABC'H,
field4 := "test",
field5 := '101'B,
field6 := '899ABC'H
}
messagePort.send(v_testMessage);
alt {
[] messagePort.receive(mw_matchingTemplate) {
setverdict(pass);
}
[] messagePort.receive {
setverdict(fail);
}
}
}
control{
execute(TC_NegSem_B010401_length_restrictions_001());
}
}
\ No newline at end of file
/***************************************************
** @author STF 409 (updated by STF 521)
** @version 0.0.2
** @purpose 1:B.1.4.1, Ensure that the IUT correctly handles template matching of value length definitions
** @verdict pass accept, ttcn3verdict:fail
***************************************************/
module NegSem_B010401_length_restrictions_002 {
type record MessageType {
charstring field1,
bitstring field2,
hexstring field3,
charstring field4,
bitstring field5,
hexstring field6
}
type port loopbackPort message {
inout MessageType
}
type component GeneralComp {
port loopbackPort messagePort
}
testcase TC_NegSem_B010401_length_restrictions_002() runs on GeneralComp {
var MessageType v_testMessage;
template MessageType mw_matchingTemplate:=
{
field1 := pattern "test s*g" length (6 .. 15),
field2 := '10*'B length (3 .. 5),
field3 := '89?AB'H length (6), //pattern is shorter than length restriction
field4 := pattern "tes?" length (4 .. 13),
field5 := '10?'B length (3 .. 5),
field6 := '89?ABC'H length (6)
}
v_testMessage:= {
field1 := "test string",
field2 := '10101'B,
field3 := '89ABC'H,
field4 := "test",
field5 := '101'B,
field6 := '899ABC'H
}
messagePort.send(v_testMessage);
alt {
[] messagePort.receive(mw_matchingTemplate) {
setverdict(pass);
}
[] messagePort.receive {
setverdict(fail);
}
}
}
control{
execute(TC_NegSem_B010401_length_restrictions_002());
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment