Commit e5b07374 authored by Miklos Magyari's avatar Miklos Magyari Committed by Adam Knapp
Browse files

OOP: added some more tests for member id reuse


Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent 7bfee4f5
......@@ -66,6 +66,16 @@ type class OuterClass {
}
}
type class ReuseClass {
var charstring vl_orig := "abc";
function f_reuse_id(in integer pl_param) {
var integer vl_orig := 1;
vl_orig := 2;
vl_orig := "abc"; // type mismatch: local definition takes precedence
}
}
const integer cg_uninitConst1;
type class SubFunctionClass extends BaseFunctionClass {
......
......@@ -147,6 +147,15 @@ type class ReuseClass {
function f_reuse_in_body(integer pl_param) {
const float cl_orig := 0.1;
}
// test method id reuse in a nested StatmentBlock
function f_reuse_in_body2(integer pl_param) {
{
{
const float cl_orig := 0.1;
}
}
}
}
type class SubClass4 extends SuperBaseClass {
......
......@@ -41,7 +41,7 @@ public class OOP_Semantic_tests {
private ArrayList<MarkerToCheck> oopNegative_ttcn_initializer() {
//oopNegativeSemanticTest.ttcn
ArrayList<MarkerToCheck> markersToCheck = new ArrayList<MarkerToCheck>(7);
ArrayList<MarkerToCheck> markersToCheck = new ArrayList<MarkerToCheck>(8);
int lineNum = 28;
markersToCheck.add(new MarkerToCheck("class type expected", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 15;
......@@ -50,7 +50,9 @@ public class OOP_Semantic_tests {
markersToCheck.add(new MarkerToCheck("Local Definiton `vl_b' collides with definition inherited from class type `@classesNegativeSemantic.SubClass'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 17;
markersToCheck.add(new MarkerToCheck("integer value was expected", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 5;
lineNum += 11;
markersToCheck.add(new MarkerToCheck("integer value was expected", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 4;
markersToCheck.add(new MarkerToCheck("Constant must be initialized", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 17;
markersToCheck.add(new MarkerToCheck("There is no visible definition with name `vl_gsc' in module `classesNegativeSemantic'", lineNum, IMarker.SEVERITY_ERROR));
......
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