Commit 9bc85d15 authored by balaskoa's avatar balaskoa
Browse files

New tests have been added + naming convention update - Bug 499886


Signed-off-by: default avatarbalaskoa <jeno.balasko@ericsson.com>
parent 482ecdf2
......@@ -18,7 +18,7 @@ type port PCOType message {
}
type component CT {
port PCOType pt[3];
port PCOType PCOArray_PT[3];
}
testcase tc_portarray_index() runs on CT {
......
......@@ -12,8 +12,8 @@ modulepar Rec tsp_rec := {1,"a"}; //
modulepar template Rec tsp_trec := {1,"b"}; //A_MODULEPAR_TEMPLATE
modulepar template integer tsp_i := 1; //A_MODULEPAR_TEMPLATE
modulepar template Rec tsp_rec1 := 1; //expected error
modulepar template Rec tsp_rec2 := {1, c_cs};
const charstring c_cs := "Abba";
modulepar template Rec tsp_rec2 := {1, cg_cs};
const charstring cg_cs := "Abba";
type record Rec {
integer i,
......@@ -27,124 +27,124 @@ template Rec t_rec(integer pl_i, charstring pl_cs) :={
template charstring t_cs := ?;
template Rec t_rec1( integer pt_i, template charstring pt_cs) := {
i := pt_i,
cs := pt_cs
template Rec t_rec1( integer pl_i, template charstring pl_cs) := {
i := pl_i,
cs := pl_cs
}
template Rec t_rec1_1 := t_rec1(tsp_i,"a");//ok, expecting error
template (value) Rec t_rec2( integer pt_i, template (value) charstring pt_cs) := {
i := pt_i,
cs := pt_cs
template (value) Rec t_rec2( integer pl_i, template (value) charstring pl_cs) := {
i := pl_i,
cs := pl_cs
}
template (value) Rec t_rec3( integer pt_i, template charstring pt_cs) := { //ok, expecting error: Formal parameter without template restriction not allowed here
i := pt_i,
cs := pt_cs
template (value) Rec t_rec3( integer pl_i, template charstring pl_cs) := { //ok, expecting error: Formal parameter without template restriction not allowed here
i := pl_i,
cs := pl_cs
}
//function returning a rec
function fr() return Rec {
function f_r() return Rec {
return tsp_rec;
}
//function returning a rec but gets a template
function fr_wrong1() return Rec {
function f_r_wrong1() return Rec {
return tsp_trec; //OK: expecting error: Reference to a value was expected instead of
}
//function returning a rec but gets a template
function fr_wrong2() return Rec {
function f_r_wrong2() return Rec {
return t_rec1(1,"a");//OK: expecting error: Reference to a value was expected instead of
}
function fr_wrong3() return Rec {
function f_r_wrong3() return Rec {
return t_rec2(1,"a");//OK: expecting error: Reference to a value was expected instead of
}
//function returning on a template rec
function frt() return template Rec {
function f_rt() return template Rec {
return tsp_trec;
}
function frt_wrong() return template Rec {
function f_rt_wrong() return template Rec {
return tsp_i; //ok, expeced error
}
function frt1() return template Rec {
var template Rec tl_rec := {1,tsp_i} //ok, expected error
function f_rt1() return template Rec {
var template Rec vt_rec := {1,tsp_i} //ok, expected error
template Rec tl_rec1 := {1,tsp_i} //ok, expected error
return tl_rec;
return vt_rec;
}
function frt_par(template Rec tpl_rec) return Rec {
return tpl_rec;//ok, expected error
function f_rt_par(template Rec pl_rec) return Rec {
return pl_rec;//ok, expected error
}
function frt_parin(in template Rec tpl_rec) return Rec {
return tpl_rec;//ok, expected error
function f_rt_parin(in template Rec pl_rec) return Rec {
return pl_rec;//ok, expected error
}
function frt_parout(out template Rec tpl_rec) return Rec {
return tpl_rec;//ok, expected error
function f_rt_parout(out template Rec pl_rec) return Rec {
return pl_rec;//ok, expected error
}
function frt_parinout(inout template Rec tpl_rec) return Rec {
return tpl_rec;//ok, expected error
function f_rt_parinout(inout template Rec pl_rec) return Rec {
return pl_rec;//ok, expected error
}
function frt_templatevar() return Rec {
function f_rt_templatevar() return Rec {
var template Rec vt_rec_ := {1,"a"};
return vt_rec_; //ok, expected error
}
function frt_template() return Rec {
template Rec vt_rec := {1,"a"}
return vt_rec; //ok, expected error
function f_rt_template() return Rec {
template Rec t_rec_ := {1,"a"}
return t_rec_; //ok, expected error
}
function frt_templatevar_cs() return charstring {
function f_rt_templatevar_cs() return charstring {
var template charstring vt_cs := "a" & tsp_i; //ok, expected error
return vt_cs; //ok, expected error
}
function f(
function f_1(
integer pl_i,
template Rec tpl_rec,
in template Rec tpl_recin,
inout template Rec tpl_recinout,
out template Rec tpl_recout) {
var Rec vl_rec := tpl_rec; //ok, error expected: :8.21-27: error: Reference to a value was expected instead of template parameter `tpl_rec'
template Rec pl_rec,
in template Rec pl_recin,
inout template Rec pl_recinout,
out template Rec pl_recout) {
var Rec vl_rec := pl_rec; //ok, error expected: :8.21-27: error: Reference to a value was expected instead of template parameter `tpl_rec'
var Rec vl_rec2 := tsp_trec; //ok, error expected: Reference to a value was expected instead of ...
var Rec vl_rec3 := tpl_recin; //ok, error expected: Reference to a value was expected instead of
var Rec vl_rec4 := tpl_recinout; //ok, error expected: Reference to a value was expected instead of
var Rec vl_rec5 := tpl_recout; //ok, error expected: Reference to a value was expected instead of
var Rec vl_rec6 := frt(); //ok, error expected: Reference to a value was expected instead of
var Rec vl_rec7 := fr();
var Rec vl_rec3 := pl_recin; //ok, error expected: Reference to a value was expected instead of
var Rec vl_rec4 := pl_recinout; //ok, error expected: Reference to a value was expected instead of
var Rec vl_rec5 := pl_recout; //ok, error expected: Reference to a value was expected instead of
var Rec vl_rec6 := f_rt(); //ok, error expected: Reference to a value was expected instead of
var Rec vl_rec7 := f_r();
var Rec vl_rec8 := vl_rec;
var template Rec vl_rec9 := vl_rec;
var Rec vl_rec10 := vl_rec9; //ok, error expected: Reference to a value was expected instead of
var template Rec vt_rec9 := vl_rec;
var Rec vl_rec10 := vt_rec9; //ok, error expected: Reference to a value was expected instead of
}
function f2(
function f_2(
integer pl_i,
template Rec tpl_rec,
in template Rec tpl_recin,
inout template Rec tpl_recinout,
out template Rec tpl_recout
template Rec pl_rec,
in template Rec pl_recin,
inout template Rec pl_recinout,
out template Rec pl_recout
){
var template Rec vlt_rec := tpl_rec; //ok, no error
var template Rec vlt_rec2 := tsp_trec; //ok, no error
var template Rec vlt_rec3 := tpl_recin; //ok, no error
var template Rec vlt_rec4 := tpl_recinout; //ok, no error
var template Rec vlt_rec5 := tpl_recout; //ok, no error
var template Rec vlt_rec6 := frt(); //ok, no error
var template Rec vlt_rec7 := fr(); //ok, no error
var template Rec vlt_rec8 := t_rec1(tsp_i,c_cs);
var template Rec vlt_rec9 := t_rec1(1,t_cs);//ok, no error
var template integer vlt_i := 3+2;
var template Rec vt_recl := pl_rec; //ok, no error
var template Rec vt_rec2l := tsp_trec; //ok, no error
var template Rec vt_rec3l := pl_recin; //ok, no error
var template Rec vt_rec4l := pl_recinout; //ok, no error
var template Rec vt_rec5l := pl_recout; //ok, no error
var template Rec vt_rec6l := f_rt(); //ok, no error
var template Rec vt_rec7l := f_r(); //ok, no error
var template Rec vt_rec8l := t_rec1(tsp_i,cg_cs);
var template Rec vt_rec9l := t_rec1(1,t_cs);//ok, no error
var template integer vt_il := 3+2;
}
......@@ -152,16 +152,16 @@ function f2(
type component CT {}
testcase t() runs on CT {
var template Rec vlt_trec1:= {1,"a"};
var template Rec vlt_trec2:= {1,"a"};
template Rec vlt_trec3 := {1,"a"}
f(
testcase tc_1() runs on CT {
var template Rec vt_trec1_:= {1,"a"};
var template Rec vt_trec2_:= {1,"a"};
template Rec t_trec3 := {1,"a"}
f_1(
pl_i:=1,
tpl_rec := t_rec(1,"a"),
tpl_recin := vlt_trec1,
tpl_recinout := vlt_trec2,
tpl_recout := vlt_trec3 //ok, expected error
pl_rec := t_rec(1,"a"),
pl_recin := vt_trec1_,
pl_recinout := vt_trec2_,
pl_recout := t_trec3 //ok, expected error
);
}
......
......@@ -13,7 +13,7 @@ template CreateSAPCSubscription t_sapc_data := {
pcBlacklistService_list := { "a", "b", "c" }
}
template GetResponseSAPCSubscription g_resp := {
template GetResponseSAPCSubscription t_resp := {
permutation(
"hello",
all from t_sapc_data.pcBlacklistService_list
......@@ -28,26 +28,26 @@ var template CreateSAPCSubscription vt_sapc_data := t_sapc_data
//if (t_sapc_data==vt_sapc_data) { setverdict(pass); } else { setverdict(fail); }
if (log2str(t_sapc_data)==log2str(vt_sapc_data)) { setverdict(pass); } else { setverdict(fail); }
var template GetResponseSAPCSubscription resp; // initialized from a template
var template GetResponseSAPCSubscription resp_vt; // from a var template
var template GetResponseSAPCSubscription resp_manual; // hacked by hand
var template GetResponseSAPCSubscription vt_resp; // initialized from a template
var template GetResponseSAPCSubscription vt_resp_vt; // from a var template
var template GetResponseSAPCSubscription vt_resp_manual; // hacked by hand
if (sizeof (vt_sapc_data.pcBlacklistService_list) > 0) {
select (sizeof (vt_sapc_data.pcBlacklistService_list)){
case (1) {
resp_manual.pcBlacklistService_list := {
vt_resp_manual.pcBlacklistService_list := {
permutation("hello", vt_sapc_data.pcBlacklistService_list[0], "goodbye")
}
}
case (2) {
resp_manual.pcBlacklistService_list := {
vt_resp_manual.pcBlacklistService_list := {
permutation ("hello",
vt_sapc_data.pcBlacklistService_list[0],
vt_sapc_data.pcBlacklistService_list[1], "goodbye")
}
}
case (3) {
resp_manual.pcBlacklistService_list := {
vt_resp_manual.pcBlacklistService_list := {
permutation ("hello",
vt_sapc_data.pcBlacklistService_list[0],
vt_sapc_data.pcBlacklistService_list[1],
......@@ -55,7 +55,7 @@ if (sizeof (vt_sapc_data.pcBlacklistService_list) > 0) {
}
}
case else {
resp_manual.pcBlacklistService_list := {
vt_resp_manual.pcBlacklistService_list := {
permutation ("hello",
vt_sapc_data.pcBlacklistService_list[0],
vt_sapc_data.pcBlacklistService_list[1],
......@@ -68,7 +68,7 @@ if (sizeof (vt_sapc_data.pcBlacklistService_list) > 0) {
}
// var template referring to a global template
resp.pcBlacklistService_list := {
vt_resp.pcBlacklistService_list := {
permutation(
"hello",
all from t_sapc_data .pcBlacklistService_list,
......@@ -76,22 +76,22 @@ all from t_sapc_data .pcBlacklistService_list,
) };
// var template referring to another var template
resp_vt.pcBlacklistService_list := {
vt_resp_vt.pcBlacklistService_list := {
permutation(
"hello",
all from vt_sapc_data .pcBlacklistService_list,
"goodbye"
) };
action("manual ", resp_manual.pcBlacklistService_list);
action("all ", resp .pcBlacklistService_list);
action("all vt ", resp_vt .pcBlacklistService_list);
action("manual ", vt_resp_manual.pcBlacklistService_list);
action("all ", vt_resp .pcBlacklistService_list);
action("all vt ", vt_resp_vt .pcBlacklistService_list);
if (log2str(resp.pcBlacklistService_list)==log2str(resp_manual.pcBlacklistService_list))
{ setverdict(pass); } else { setverdict(fail, "at line ", __LINE__, "\n", resp.pcBlacklistService_list, " !=\n", resp_manual.pcBlacklistService_list); }
if (log2str(vt_resp.pcBlacklistService_list)==log2str(vt_resp_manual.pcBlacklistService_list))
{ setverdict(pass); } else { setverdict(fail, "at line ", __LINE__, "\n", vt_resp.pcBlacklistService_list, " !=\n", vt_resp_manual.pcBlacklistService_list); }
if (log2str(resp_vt.pcBlacklistService_list)==log2str(resp_manual.pcBlacklistService_list))
{ setverdict(pass); } else { setverdict(fail, "at line ", __LINE__, "\n", resp_vt.pcBlacklistService_list, " !=\n", resp_manual.pcBlacklistService_list); }
if (log2str(vt_resp_vt.pcBlacklistService_list)==log2str(vt_resp_manual.pcBlacklistService_list))
{ setverdict(pass); } else { setverdict(fail, "at line ", __LINE__, "\n", vt_resp_vt.pcBlacklistService_list, " !=\n", vt_resp_manual.pcBlacklistService_list); }
} // testcase
......
......@@ -6111,36 +6111,36 @@ type function f_function_type7(in integer pl_parameterName);
type function f_function_type8(inout integer pl_parameterName);
type function f_function_type9(in integer pl_parameterName1, in integer pl_parameterName2);
function f_functionName1(out integer i){}
function f_functionName2(in integer i, out integer j){}
function f_functionName3(in integer i, out integer j){}
function f_functionName4(in integer i, in integer j){}
function f_functionName5(in integer i, inout integer j){}
function f_functionName6(integer i, integer j){};
function f_functionName7(out template integer i){}
function f_functionName8(in template integer i, out template integer j){}
function f_functionName9(in template integer i, out template integer j){}
function f_functionName10(in template integer i, in template integer j){}
function f_functionName11(in template integer i, inout template integer j){}
function f_functionName12(template integer i, template integer j){};
function f_functionName1(out integer pl_i){}
function f_functionName2(in integer pl_i, out integer pl_j){}
function f_functionName3(in integer pl_i, out integer pl_j){}
function f_functionName4(in integer pl_i, in integer pl_j){}
function f_functionName5(in integer pl_i, inout integer pl_j){}
function f_functionName6(integer pl_i, integer pl_j){};
function f_functionName7(out template integer pl_i){}
function f_functionName8(in template integer pl_i, out template integer pl_j){}
function f_functionName9(in template integer pl_i, out template integer pl_j){}
function f_functionName10(in template integer pl_i, in template integer pl_j){}
function f_functionName11(in template integer pl_i, inout template integer pl_j){}
function f_functionName12(template integer pl_i, template integer pl_j){};
control {
var f_function_type7 variable1 := refers(f_functionName1);
var f_function_type8 variable2 := refers(f_functionName2);
var f_function_type9 variable3 := refers(f_functionName3);
var f_function_type9 variable4 := refers(f_functionName4);
var f_function_type9 variable5 := refers(f_functionName5);
var f_function_type9 variable6 := refers(f_functionName6);
var f_function_type9 variable7 := refers(f_functionName7);
var f_function_type7 vl_variable1 := refers(f_functionName1);
var f_function_type8 vl_variable2 := refers(f_functionName2);
var f_function_type9 vl_variable3 := refers(f_functionName3);
var f_function_type9 vl_variable4 := refers(f_functionName4);
var f_function_type9 vl_variable5 := refers(f_functionName5);
var f_function_type9 vl_variable6 := refers(f_functionName6);
var f_function_type9 vl_variable7 := refers(f_functionName7);
var f_function_type7 variable8 := refers(f_functionName7);
var f_function_type8 variable9 := refers(f_functionName8);
var f_function_type9 variable10 := refers(f_functionName9);
var f_function_type9 variable11 := refers(f_functionName10);
var f_function_type9 variable12 := refers(f_functionName11);
var f_function_type9 variable13 := refers(f_functionName12);
var f_function_type9 variable14 := refers(f_functionName7);
var f_function_type7 vl_variable8 := refers(f_functionName7);
var f_function_type8 vl_variable9 := refers(f_functionName8);
var f_function_type9 vl_variable10 := refers(f_functionName9);
var f_function_type9 vl_variable11 := refers(f_functionName10);
var f_function_type9 vl_variable12 := refers(f_functionName11);
var f_function_type9 vl_variable13 := refers(f_functionName12);
var f_function_type9 vl_variable14 := refers(f_functionName7);
}
......
......@@ -16,7 +16,7 @@ const ASNSequenceOf cg_i0 := { null,
const ASNSequenceOf cg_i1 := { 5.5 }
template float t_f := 6.5;
template integer t_i0 := 2;
template integer t_i0 := 2;
const integer cg_i2 := 2;
const integer cg_i3 := 3;
//ASN1:
......
......@@ -352,7 +352,7 @@ group G3 {
} with { extension "internal"}
type component CT {
port PT myport;
port PT myport_PT;
}
template MyRec t_rec9 := {*,?};
......@@ -367,9 +367,9 @@ group G3 {
}
altstep as_1() runs on CT {
[] myport.receive(MyRec:*) { }
[] myport.receive(MyRec:modifies t_rec9 := {i:= (2..8)}) { }
[] myport.receive(t_rec9m) {
[] myport_PT.receive(MyRec:*) { }
[] myport_PT.receive(MyRec:modifies t_rec9 := {i:= (2..8)}) { }
[] myport_PT.receive(t_rec9m) {
return 1;
}
......
......@@ -16,7 +16,7 @@ module Syntax_warnings
{
[] anyport.receive
{
var bitstring vl_bstr := '1'b;
var bitstring vl_bstr := '1'B;
log(vl_bstr);
goto alt;
}
......
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