Browse Source

Rename function used in cpp domain tests (#1870)

* Rename function used in cpp domain tests

* Fix method name's further occurences
Rene Beckmann 7 years ago
parent
commit
f3cd3485e5

+ 10 - 10
test-plugins/org.yakindu.sct.model.stext.test/src/org/yakindu/sct/model/stext/test/TypeInferrerTest.java

@@ -984,7 +984,7 @@ public class TypeInferrerTest extends AbstractTypeInferrerTest {
 	 * Uses a model of the following function:
 	 * 
 	 * template <typename T>
-	 * T genericOp(T a, T b) {
+	 * T templateOp(T a, T b) {
 	 * 		return a > b ? a : b;
 	 * }
 	 */
@@ -998,19 +998,19 @@ public class TypeInferrerTest extends AbstractTypeInferrerTest {
 				+ "var myCPT: ComplexParameterizedType<boolean, integer> "
 				+ "var myCPT2: ComplexParameterizedType<integer, boolean> ";
 		
-		expectNoErrors("myI = genericOp(myI, myI)", scopes);
-		assertTrue(isIntegerType(inferTypeResultForExpression("myI = genericOp(myI, myI)", scopes).getType()));
+		expectNoErrors("myI = templateOp(myI, myI)", scopes);
+		assertTrue(isIntegerType(inferTypeResultForExpression("myI = templateOp(myI, myI)", scopes).getType()));
 		
-		expectNoErrors("myF = genericOp(3+5, 2.3)", scopes);
-		assertTrue(isRealType(inferTypeResultForExpression("myF = genericOp(3+5, 2.3)", scopes).getType()));
+		expectNoErrors("myF = templateOp(3+5, 2.3)", scopes);
+		assertTrue(isRealType(inferTypeResultForExpression("myF = templateOp(3+5, 2.3)", scopes).getType()));
 		
-		expectNoErrors("myCPT = genericOp(myCPT, myCPT)", scopes);
+		expectNoErrors("myCPT = templateOp(myCPT, myCPT)", scopes);
 		
-		expectError("myB = genericOp(myI, myI)", scopes, ITypeSystemInferrer.NOT_COMPATIBLE_CODE);
-		expectError("myB = genericOp(3+5, boolean)", scopes, ITypeSystemInferrer.NOT_INFERRABLE_TYPE_PARAMETER_CODE);
+		expectError("myB = templateOp(myI, myI)", scopes, ITypeSystemInferrer.NOT_COMPATIBLE_CODE);
+		expectError("myB = templateOp(3+5, boolean)", scopes, ITypeSystemInferrer.NOT_INFERRABLE_TYPE_PARAMETER_CODE);
 		
-		expectErrors("myCPT2 = genericOp(myCPT, myCPT)", scopes, ITypeSystemInferrer.NOT_SAME_CODE, 2);
-		expectErrors("myCPT = genericOp(myCPT, myCPT2)", scopes, ITypeSystemInferrer.NOT_SAME_CODE, 2);
+		expectErrors("myCPT2 = templateOp(myCPT, myCPT)", scopes, ITypeSystemInferrer.NOT_SAME_CODE, 2);
+		expectErrors("myCPT = templateOp(myCPT, myCPT2)", scopes, ITypeSystemInferrer.NOT_SAME_CODE, 2);
 	}
 	
 	@Test

+ 2 - 2
test-plugins/org.yakindu.sct.model.stext.test/src/org/yakindu/sct/model/stext/test/util/STextTestScopeProvider.xtend

@@ -207,14 +207,14 @@ class STextTestScopeProvider extends STextScopeProvider {
 	 * Returns a model of the following function:
 	 * 
 	 * template <typename T>
-	 * T genericOp(T a, T b) {
+	 * T templateOp(T a, T b) {
 	 * 		return a > b ? a : b;
 	 * }
 	 */
 	def Package createPackageWithTemplateFunction() {
 		createRootPackage("simpleTemplate") => [ types |
 			types.member += factory.createOperation => [ op |
-				op.name = "genericOp"
+				op.name = "templateOp"
 				op.typeParameters += createTypeParameter("T")
 				op.parameters += factory.createParameter => [
 					name = "a"