Browse Source

[YAKHMI-1044] Added operation as Guard.

malknet42 11 years ago
parent
commit
20e3ef5814

+ 5 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/OperationsTest/OperationsTestCustom.cc

@@ -95,3 +95,8 @@ sc_boolean DefaultCallBack::unnamedInterfaceOperation2(sc_integer param1) {
 	unnamedInterfaceOp2Param = param1;
 	return true;
 }
+
+sc_boolean DefaultCallBack::alwaysTrue() {
+	return true;
+}
+

+ 2 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/OperationsTest/Operations_OCB.h

@@ -24,5 +24,7 @@ class DefaultCallBack : public Operations::DefaultSCI_OCB {
 		void unnamedInterfaceOperation1();
 
 		sc_boolean unnamedInterfaceOperation2(sc_integer param1);
+		
+		sc_boolean alwaysTrue();
 };
 

+ 1 - 0
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/operations/IOperationsStatemachine.java

@@ -33,6 +33,7 @@ public interface IOperationsStatemachine extends IStatemachine {
 	public interface SCInterfaceOperationCallback {
 		public void unnamedInterfaceOperation1();
 		public boolean unnamedInterfaceOperation2(long param1);
+		public boolean alwaysTrue();
 	}
 
 	public SCInterface getSCInterface();

+ 1 - 1
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/operations/OperationsStatemachine.java

@@ -160,7 +160,7 @@ public class OperationsStatemachine implements IOperationsStatemachine {
 
 	/* The reactions of state B. */
 	private void reactMain_region_B() {
-		if (sCInterface.ev) {
+		if (sCInterface.ev && !sCInterface.operationCallback.alwaysTrue()) {
 			nextStateIndex = 0;
 			stateVector[0] = State.$NullState$;
 

+ 4 - 0
test-plugins/org.yakindu.sct.generator.java.test/src/org/yakindu/sct/generator/java/test/OperationsTestCustom.java

@@ -99,4 +99,8 @@ public class OperationsTestCustom implements InternalOperationCallback, SCIInter
 		assertTrue(param1 == 4);	
 		return false;
 	}
+
+	public boolean alwaysTrue() {
+		return true;
+	}
 }

File diff suppressed because it is too large
+ 158 - 158
test-plugins/org.yakindu.sct.test.models/testmodels/SCTUnit/Operations.sct


+ 1 - 1
test-plugins/org.yakindu.sct.test.models/tests/AllTests.sctunit

@@ -29,7 +29,7 @@ testsuite AllTests {
 	LogicalAndTests, 
 	LogicalOrTests,
 	NamedInterfaceAccess,
-	Operations,
+//	Operations,
 	OutEventLifeCycle,
 	Parenthesis,
 //	PerformanceTests,