Commit c76911a6 authored by Miklos Magyari's avatar Miklos Magyari
Browse files

OOP: added tests for modifiers


Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent 18be600f
......@@ -86,6 +86,11 @@ type class SubFunctionClass extends BaseFunctionClass {
}
}
// bad combination of class modifiers
type class @final @abstract BadClass1 { }
type class @final @trait BadClass3 { }
type class @abstract @trait BadClass2 { }
testcase tc_basicSyntax() runs on CT {
var GrandSubClass vl_gsc := GrandSubClass.create;
......
......@@ -18,6 +18,10 @@ import org.eclipse.titan.regressiontests.library.MarkerToCheck;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* @author Miklos Magyari
* @author Adam Knapp
*/
public class OOP_Semantic_tests {
private static final String DIR_PATH = "src/Basic_tests/";
private static final String OOP_NEGATIVE_BASIC_SEMANTIC = "/OopNegativeSemanticTest.ttcn";
......@@ -41,7 +45,7 @@ public class OOP_Semantic_tests {
private ArrayList<MarkerToCheck> oopNegative_ttcn_initializer() {
//oopNegativeSemanticTest.ttcn
ArrayList<MarkerToCheck> markersToCheck = new ArrayList<MarkerToCheck>(9);
ArrayList<MarkerToCheck> markersToCheck = new ArrayList<MarkerToCheck>(12);
int lineNum = 28;
markersToCheck.add(new MarkerToCheck("class type expected", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 15;
......@@ -54,7 +58,11 @@ public class OOP_Semantic_tests {
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;
lineNum += 11;
markersToCheck.add(new MarkerToCheck("An absract class cannot be final", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("A trait class cannot be final", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("A class cannot be both abstract and trait", ++lineNum, IMarker.SEVERITY_ERROR));
lineNum += 9;
markersToCheck.add(new MarkerToCheck("There is no visible definition with name `vl_gsc' in module `classesNegativeSemantic'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Type mismatch: a value of type `charstring' was expected instead of `integer'", ++lineNum, IMarker.SEVERITY_ERROR));
lineNum += 8;
......
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