Commit c1c6d619 authored by Adrien Kirjak's avatar Adrien Kirjak
Browse files

Added tests (any from)


Signed-off-by: default avatarAdrien Kirjak <adrien.kirjak@ericsson.com>
parent d51f0eef
/******************************************************************************
* Copyright (C) 2016 ETSI All Rights Reserved.
*
* Adrien Kirjak
*
** @version 0.0.1
** @purpose 1:21.3.5, Verify that error occurs when any from alive is applied to 1D array and index target is array
** @verdict pass reject
*****************************************************************/
// The following requirements are tested:
// Restriction d
// If the index redirection is used for single-dimensional component arrays, the type
// of the integer variable shall allow storing the highest index of the respective array.
module NegSem_210305_alive_operation_002 {
type component GeneralComp {}
function f() runs on GeneralComp {
timer t := 100.0;
t.start;
t.timeout;
}
testcase TC_NegSem_210305_alive_operation_002() runs on GeneralComp system GeneralComp {
var boolean v_isAlive;
const integer c_size := 4;
var GeneralComp v_ptc[c_size];
var integer v_index[1];
for (var integer i := 0; i < c_size; i := i + 1) {
v_ptc[i] := GeneralComp.create; // created components are inactive
if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices
else { v_ptc[i].start(f());} // activate v_ptc
}
v_isAlive := any from v_ptc.alive -> @index v_index;
if(v_index[0] == 1){
setverdict(pass);
} else {
setverdict(fail, "The any from alive operation didn't find alive components");
}
}
control {
execute(TC_NegSem_210305_alive_operation_002(), 5.0);
}
}
......@@ -28,7 +28,7 @@ module NegSem_220202_ReceiveOperation_017 {
connect(self:p, self:p);
p.send(10);
p.receive(integer:?) -> @index v_int;
p.receive(integer:?) -> @index value v_int;
setverdict(pass);
}
......
......@@ -28,7 +28,7 @@ module NegSem_220202_ReceiveOperation_018 {
connect(self:p, self:p);
p.send(10);
any port.receive(integer:?) -> @index v_int;
any port.receive(integer:?) -> @index value v_int;
setverdict(pass);
}
......
......@@ -25,9 +25,9 @@ module NegSem_220202_ReceiveOperation_019 {
testcase TC_NegSem_220202_ReceiveOperation_019() runs on GeneralComp {
var RestrInt v_int;
connect(self:p, self:p);
connect(self:p[5], self:p[5]);
p[5].send(100);
any from p.receive(integer:?) -> @index v_int;
any from p.receive(integer:?) -> @index value v_int;
setverdict(pass);
}
......
......@@ -25,8 +25,9 @@ module NegSem_220202_ReceiveOperation_020 {
testcase TC_NegSem_220202_ReceiveOperation_020() runs on GeneralComp {
var integer v_indices[2];
connect(self:p[0][1][2],self:p[0][1][2]);
p[0][1][2].send(100);
any from p.receive(integer:?) -> @index v_indices;
any from p.receive(integer:?) -> @index value v_indices;
setverdict(pass);
}
......
......@@ -27,8 +27,10 @@ module NegSem_220202_ReceiveOperation_021 {
testcase TC_NegSem_220202_ReceiveOperation_021() runs on GeneralComp {
var RestrInt v_indices[3];
connect(self:p[3][1][2],self:p[3][1][2]);
p[3][1][2].send(100);
any from p.receive(integer:?) -> @index v_indices;
any from p.receive(integer:?) -> @index value v_indices;
setverdict(pass);
}
......
......@@ -38,7 +38,7 @@ module Sem_220202_ReceiveOperation_020 {
p[2].send(10);
alt {
[] any from p.receive(integer:?) -> @index v_index {
[] any from p.receive(integer:?) -> @index value v_index {
if (v_index == 2) { setverdict(pass); }
else { setverdict(fail); }
}
......
......@@ -40,7 +40,7 @@ module Sem_220202_ReceiveOperation_021 {
p[0][2].send(10);
alt {
[] any from p.receive(integer:?) -> @index v_index {
[] any from p.receive(integer:?) -> @index value v_index {
if (v_index == { 0, 2 }) { setverdict(pass); }
else { setverdict(fail, "v_index: ", v_index); }
}
......
......@@ -27,7 +27,7 @@ module NegSem_220203_TriggerOperation_017 {
connect(self:p, self:p);
p.send(10);
p.trigger(integer:?) -> @index v_int;
p.trigger(integer:?) -> @index value v_int;
setverdict(pass);
}
......
......@@ -27,7 +27,7 @@ module NegSem_220203_TriggerOperation_018 {
connect(self:p, self:p);
p.send(10);
any port.trigger(integer:?) -> @index v_int;
any port.trigger(integer:?) -> @index value v_int;
setverdict(pass);
}
......
......@@ -27,7 +27,7 @@ module NegSem_220203_TriggerOperation_019 {
connect(self:p[5], self:p[5]);
p[5].send(100);
any from p.trigger(integer:?) -> @index v_int;
any from p.trigger(integer:?) -> @index value v_int;
setverdict(pass);
}
......
......@@ -28,7 +28,7 @@ module NegSem_220203_TriggerOperation_020 {
connect(self:p[0][1][2], self:p[0][1][2]);
p[0][1][2].send(100);
any from p.trigger(integer:?) -> @index v_indices;
any from p.trigger(integer:?) -> @index value v_indices;
setverdict(pass);
}
......
......@@ -29,7 +29,7 @@ module NegSem_220203_TriggerOperation_021 {
connect(self:p[3][1][2], self:p[3][1][2]);
p[3][1][2].send(100);
any from p.trigger(integer:?) -> @index v_indices;
any from p.trigger(integer:?) -> @index value v_indices;
setverdict(pass);
}
......
......@@ -41,7 +41,7 @@ module Sem_220203_TriggerOperation_020 {
altP.send(1);
alt {
[] any from p.trigger(integer:?) -> @index v_index {
[] any from p.trigger(integer:?) -> @index value v_index {
if (v_index == 2) { setverdict(pass); }
else { setverdict(fail); }
}
......
......@@ -43,7 +43,7 @@ module Sem_220203_TriggerOperation_021 {
altP.send(1);
alt {
[] any from p.trigger(integer:?) -> @index v_index {
[] any from p.trigger(integer:?) -> @index value v_index {
if (v_index == { 0, 2 }) { setverdict(pass); }
else { setverdict(fail, "v_index: ", v_index); }
}
......
......@@ -30,7 +30,7 @@ module NegSem_220302_GetcallOperation_005 {
var integer v_index[1];
alt
{
[] any from p.getcall(S:?) -> @index v_index {
[] any from p.getcall(S:{}) -> @index value v_index {
if(v_index[0] == 1){
setverdict(pass);
} else {
......
......@@ -30,7 +30,7 @@ module NegSem_220302_GetcallOperation_006 {
var float v_index;
alt
{
[] any from p.getcall(S:?) -> @index v_index {
[] any from p.getcall(S:{}) -> @index value v_index {
if(v_index == 1.0){
setverdict(pass);
} else {
......
......@@ -32,7 +32,7 @@ module NegSem_220302_GetcallOperation_007 {
var GeneralComp v_src;
alt
{
[] any from p.getcall(S:{p_par := (0..c_portCount)}) -> sender v_src @index v_index {
[] any from p.getcall(S:{p_par := (0..c_portCount)}) -> sender v_src @index value v_index {
if(v_index[0] == 1 and v_index[1] == 2 and v_parValue == v_index[0] + 1){
setverdict(pass);
} else {
......
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