Commit f4808542 authored by kovacsa's avatar kovacsa
Browse files

fixes

parent 35f5b85b
......@@ -13,15 +13,21 @@
module Sem_050202_Uniqueness_005 {
type component GeneralComp {
}
type enumerated MyFirstEnumType {MyInt,MySecondEnumValue};
type integer MyInt;
type record MyRec {
integer Myint
}
testcase TC_Sem_050202_Uniqueness_005() runs on GeneralComp {
var MyFirstEnumType v_enum := MySecondEnumValue;
var MyInt v_int := 1; // local scope
var MyFirstEnumType v_enum := MySecondEnumValue;
var MyRec v_rec;
v_rec.Myint := 1;
if (match(v_enum,MySecondEnumValue) and match(v_int,1)) {
if (match(v_enum,MySecondEnumValue) and match(v_rec.Myint,1)) {
setverdict(pass);
} else {
setverdict(fail);
......
......@@ -11,20 +11,32 @@
module NegSyn_05040103_parameters_of_kind_timer_002 {
type component C {
}
function f_test(out timer p_tmr) {
p_tmr.start(1.0);
}
testcase TC_NegSyn_05040103_parameters_of_kind_timer_002() runs on C{
timer t_tmr;
f_test(t_tmr);
t_tmr.timeout
t_tmr.timeout;
setverdict(pass);
}
control {
execute(TC_NegSyn_05040103_parameters_of_kind_timer_002());
}
}
\ No newline at end of file
......@@ -17,7 +17,7 @@ module NegSem_06010101_AccessStringElements_001 {
testcase TC_NegSem_06010101_AccessStringElements_001() runs on GeneralComp {
var octetstring v_b := '100010'O;
v_b[1] := '01'O; //error: only individual elements can be accessed
v_b[1] := '11'O; //error: only individual elements can be accessed
if (v_b == '100001'O){
setverdict(pass);
}
......
......@@ -27,8 +27,7 @@ module Sem_060203_records_and_sets_of_single_types_002 {
[2] := -
};
if (match(v_rec[0], 0) and match(v_rec[1], 1) and not isbound(v_rec[2])
and lengthof (v_rec & {2}) == 4) {
if (match(v_rec[0], 0) and match(v_rec[1], 1) and not isbound(v_rec[2])) {
setverdict(pass);
}
else {
......
......@@ -27,8 +27,7 @@ module Sem_060203_records_and_sets_of_single_types_003 {
[2] := -
};
if (match(v_set[0], 0) and match(v_set[1], 1) and not isbound(v_set[2])
and lengthof (v_set & {2}) == 4) {
if (match(v_set[0], 0) and match(v_set[1], 1) and not isbound(v_set[2])) {
setverdict(pass);
}
else {
......
......@@ -20,8 +20,7 @@ module Sem_060203_records_and_sets_of_single_types_008 {
testcase TC_Sem_060203_records_and_sets_of_single_types_008() runs on GeneralComp {
var RoI v_rec := { 0, 1, - };
if (match(v_rec[0], 0) and match(v_rec[1], 1) and not isbound(v_rec[2])
and lengthof (v_rec & {2}) == 4) {
if (match(v_rec[0], 0) and match(v_rec[1], 1) and not isbound(v_rec[2])) {
setverdict(pass);
}
else {
......
......@@ -20,8 +20,7 @@ module Sem_060203_records_and_sets_of_single_types_009 {
testcase TC_Sem_060203_records_and_sets_of_single_types_009() runs on GeneralComp {
var SoI v_set := { 0, 1, - };
if (match(v_set[0], 0) and match(v_set[1], 1) and not isbound(v_set[2])
and lengthof (v_set & {2}) == 4) {
if (match(v_set[0], 0) and match(v_set[1], 1) and not isbound(v_set[2])) {
setverdict(pass);
}
else {
......
/***************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:9.1, Verify that a two TSI port cannot be connected
** @verdict pass reject
***************************************************/
/*NOTE: see Figure 7(f): Two TSI port cannot be connected
* */
module NegSem_0901_Communication_ports_010 {
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_NegSem_0901_Communication_ports_010() 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_NegSem_0901_Communication_ports_010());
}
}
/***************************************************
** @author STF 451 (updated by STF 521)
** @version 0.0.2
** @author STF 451
** @version 0.0.1
** @purpose 1:9, Ensure that the the IUT receives the message sent by mycompA
** @verdict pass accept, ttcn3verdict:pass
** @configuration port:broadcast
......@@ -9,58 +9,71 @@
// Two component mycompA and B message exchange
module Sem_0901_Communication_ports_002{
type port P message {
inout integer
type port myport message {
inout integer
}
type component Mysystem {
timer t_rec,t_rec2;
port P messagePort;
}
function fsend() runs on Mysystem {
messagePort.send(2);
type component Mysystem
{
timer t_rec,t_rec2;
port myport messagePort;
}
function fsend() runs on Mysystem {
messagePort.send(2);
t_rec2.start(20.0);
alt {
[] messagePort.receive(3) {
setverdict(pass);
}
[] messagePort.receive {
setverdict(fail);
}
[] t_rec2.timeout {
setverdict( inconc );
}
}
t_rec2.stop;
}
function frec() runs on Mysystem {
t_rec.start( 20.0 );
alt {
[] messagePort.receive(2) {
messagePort.send(3);
setverdict( pass );
}
[] messagePort.receive {
setverdict( fail );
}
[] t_rec.timeout {
setverdict( inconc );
}
}
t_rec.stop;
}
testcase TC_Sem_0901_Communication_ports_002() runs on Mysystem system Mysystem {
var Mysystem MyCompA;
var Mysystem MyCompB;
MyCompA:=Mysystem.create;
MyCompB:=Mysystem.create;
connect(MyCompA:messagePort,MyCompB:messagePort);
connect(MyCompB:messagePort,MyCompA:messagePort);
alt {
[] messagePort.receive(3) {
setverdict(pass);
}
[] messagePort.receive {
setverdict(fail);
}
}
}
function frec() runs on Mysystem {
alt {
[] messagePort.receive(2) {
messagePort.send(3);
setverdict( pass );
}
[] messagePort.receive {
setverdict( fail );
}
}
}
testcase TC_Sem_0901_Communication_ports_002() runs on Mysystem system Mysystem {
var Mysystem MyCompA;
var Mysystem MyCompB;
MyCompA:=Mysystem.create;
MyCompB:=Mysystem.create;
connect(MyCompA:messagePort,MyCompB:messagePort);
MyCompB.start(frec());
MyCompA.start(fsend());
interleave {
[] MyCompA.done {}
[] MyCompB.done {}
}
}
MyCompB.start(frec());
MyCompA.start(fsend());
control {
execute(TC_Sem_0901_Communication_ports_002(), 5.0);
}
//MyCompB.stop;
//MyCompA.stop;
MyCompB.done;
MyCompA.done;
}
control{
execute(TC_Sem_0901_Communication_ports_002());
}
}
/***************************************************
** @author STF 451 (updated by STF 521)
** @version 0.0.2
** @purpose 1:9.1, Ensure that the the IUT receives the message sent by mycompB and mycompC
** @author STF 451
** @version 0.0.1
** @purpose 1:9, Ensure that the the IUT receives the message sent by mycompB and mycompC
** @verdict pass accept, ttcn3verdict:pass
** @configuration port:broadcast
***************************************************/
......@@ -9,69 +9,89 @@
// 3 component message exchange
module Sem_0901_Communication_ports_003{
type port P message {
inout integer
type port myport message {
inout integer
}
type component Mysystem {
port P messagePort;
}
function fsend() runs on Mysystem {
var integer v_counter := 0;
messagePort.send(2) to all component;
alt {
[] messagePort.receive(3) {
if (v_counter == 0) {
v_counter := v_counter + 1;
repeat;
}
else {
setverdict(pass);
}
}
[] messagePort.receive {
setverdict(fail);
}
}
}
function frec() runs on Mysystem {
alt {
[] messagePort.receive(2) {
messagePort.send(3);
setverdict( pass );
}
[] messagePort.receive {
setverdict( fail );
}
}
}
testcase TC_Sem_0901_Communication_ports_003() runs on Mysystem system Mysystem {
var Mysystem MyCompA;
var Mysystem MyCompB;
var Mysystem MyCompC;
MyCompA:=Mysystem.create;
MyCompB:=Mysystem.create;
MyCompC:=Mysystem.create;
connect(MyCompA:messagePort,MyCompB:messagePort);
connect(MyCompA:messagePort,MyCompC:messagePort);
MyCompB.start(frec());
MyCompC.start(frec());
MyCompA.start(fsend());
interleave {
[] MyCompB.done {}
[] MyCompC.done {}
[] MyCompA.done {}
}
}
type component Mysystem
{
timer t_rec,t_rec2;
port myport messagePort;
}
function fsend() runs on Mysystem {
messagePort.send(2) to all component;
t_rec2.start(30.0);
alt {
[] messagePort.receive(3) {
setverdict(pass);
t_rec2.stop;
}
[] messagePort.receive {
setverdict(fail);
}
[] t_rec2.timeout {
setverdict( inconc );
}
}
t_rec2.stop;
}
function frec() runs on Mysystem {
t_rec.start( 10.0 );
alt {
[] messagePort.receive(2) {
messagePort.send(3);
setverdict( pass );
}
[] messagePort.receive {
setverdict( fail );
}
[] t_rec.timeout {
setverdict( inconc );
}
}
t_rec.stop;
}
testcase TC_Sem_0901_Communication_ports_003() runs on Mysystem system Mysystem {
var Mysystem MyCompA;
var Mysystem MyCompB;
var Mysystem MyCompC;
MyCompA:=Mysystem.create;
MyCompB:=Mysystem.create;
MyCompC:=Mysystem.create;
connect(MyCompA:messagePort,MyCompB:messagePort);
connect(MyCompB:messagePort,MyCompA:messagePort);
connect(MyCompA:messagePort,MyCompC:messagePort);
connect(MyCompC:messagePort,MyCompA:messagePort);
MyCompB.start(frec());
MyCompC.start(frec());
MyCompA.start(fsend());
/* alt {
[] messagePort.receive(3) {
setverdict(pass);
}
[] messagePort.receive {
setverdict(fail);
}
}*/
// wait until all components finish
MyCompB.done;
MyCompC.done;
MyCompA.done;
control{
execute(TC_Sem_0901_Communication_ports_003(), 5.0);
}
MyCompB.stop;
MyCompC.stop;
MyCompA.stop;
}
control{
execute(TC_Sem_0901_Communication_ports_003());
}
}
/***************************************************
** @author STF 451 (updated by STF 521)
** @version 0.0.2
** @author STF 451
** @version 0.0.1
** @purpose 1:9, Ensure that the the IUT receives the message sent by mycompA
** @verdict pass accept, ttcn3verdict:pass
** @configuration port:broadcast
***************************************************/
//Mycomp A has two ports and MycompB has two ports.
module Sem_0901_Communication_ports_005 {
module Sem_0901_Communication_ports_005{
type port P message {
inout integer
type port myport message {
inout integer
}
type component Mysystem {
port P messagePort1, messagePort2;
}
function fsend() runs on Mysystem {
messagePort1.send(1);
messagePort2.send(2);
alt {
[] messagePort1.receive(3) {
setverdict(pass);
}
[] messagePort1.receive {
setverdict(fail);
}
}
alt {
[] messagePort2.receive(4) {
setverdict(pass);
}
[] messagePort2.receive {
setverdict(fail);
}
}
}
type component Mysystem
{
timer t_rec,t_rec2;
port myport messagePort1,messagePort2;
}
function fsend() runs on Mysystem {
messagePort1.send(1);
messagePort2.send(2);
t_rec2.start(20.0);
alt {
[] messagePort1.receive(3) {
setverdict(pass);
}
[] messagePort1.receive {
setverdict(fail);
}
[] t_rec2.timeout {
setverdict( inconc );
}
}
alt {
[] messagePort2.receive(4) {
setverdict(pass);
}
[] messagePort2.receive {
setverdict(fail);
}
[] t_rec2.timeout {
setverdict( inconc );
}
}
t_rec2.stop;
}
function frec() runs on Mysystem {
t_rec.start( 20.0 );
alt {
[] messagePort1.receive(1) {
messagePort1.send(3);
setverdict( pass );
}
[] messagePort1.receive {
setverdict( fail );
}
[] t_rec.timeout {
setverdict( inconc );
}
}
alt {
[] messagePort2.receive(2) {
messagePort2.send(4);
setverdict( pass );
}
[] messagePort2.receive {
setverdict( fail );
}
[] t_rec.timeout {
setverdict( inconc );
}
}
t_rec.stop;
}
testcase TC_Sem_0901_Communication_ports_005() runs on Mysystem system Mysystem {
var Mysystem MyCompA;
var Mysystem MyCompB;