Commit 6c0d58f3 authored by Miklos Magyari's avatar Miklos Magyari
Browse files

OOP: added regression tests for properties


Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent 8aa59d7a
......@@ -359,6 +359,24 @@ type class BadClauses {
}
}
// 'value' can only be used in properties (and in some cases of advanced matching)
function f_invalid_value() {
var integer vl_x := value;
}
// class with property
type class PorpertyClass {
private var integer size_;
private var charstring sizename_;
var integer @property size {
@get => size_;
@set {
size_ := value;
sizename_ := value;
}
}
}
testcase tc_basicSyntax() runs on CT {
var GrandSubClass vl_gsc := GrandSubClass.create;
......
......@@ -164,7 +164,7 @@ public class OOP_Semantic_tests {
private ArrayList<MarkerToCheck> oopNegative_ttcn_initializer() {
//oopNegativeSemanticTest.ttcn
ArrayList<MarkerToCheck> markersToCheck = new ArrayList<MarkerToCheck>(82);
ArrayList<MarkerToCheck> markersToCheck = new ArrayList<MarkerToCheck>(84);
int lineNum = 32;
markersToCheck.add(new MarkerToCheck("class type expected", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 10;
......@@ -292,6 +292,10 @@ public class OOP_Semantic_tests {
markersToCheck.add(new MarkerToCheck("Class functions cannot have a `runs on` clause", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Class functions cannot have a `system` clause", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Class functions cannot have an `mtc` clause", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 7;
markersToCheck.add(new MarkerToCheck("Invalid `value` reference", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 11;
markersToCheck.add(new MarkerToCheck("Type mismatch: a value of type `charstring' was expected instead of `integer'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 12;
markersToCheck.add(new MarkerToCheck("Unknown field reference", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Type mismatch: a value of type `charstring' was expected instead of `integer'", ++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