浏览代码

updated c and c singleton tests

terfloth@itemis.de 13 年之前
父节点
当前提交
ddc28a6bea

+ 97 - 97
TestScenarios/.project

@@ -1,97 +1,97 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>TestScenarios</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
-			<triggers>clean,full,incremental,</triggers>
-			<arguments>
-				<dictionary>
-					<key>?name?</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.append_environment</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildArguments</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.contents</key>
-					<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
-			<triggers>full,incremental,</triggers>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.yakindu.sct.builder.SCTBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.core.ccnature</nature>
-		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
-		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
-		<nature>org.yakindu.sct.builder.SCTNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>TestScenarios</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+			<triggers>clean,full,incremental,</triggers>
+			<arguments>
+				<dictionary>
+					<key>?name?</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.append_environment</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildArguments</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.contents</key>
+					<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+			<triggers>full,incremental,</triggers>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.yakindu.sct.builder.SCTBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.core.ccnature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+		<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+		<nature>org.yakindu.sct.builder.SCTNature</nature>
+	</natures>
+</projectDescription>

+ 6 - 6
TestScenarios/CMakeLists.txt

@@ -4,10 +4,10 @@ enable_testing()
 
 if (CMAKE_COMPILER_IS_GNUCC)
 #add_definitions( -Wall -O0 -g)
-SET(CMAKE_C_FLAGS "-O3 -Wall") # -fprofile-arcs -ftest-coverage")
+SET(CMAKE_C_FLAGS "-O0 -g -Wall -fprofile-arcs -ftest-coverage")
  
-#SET(CMAKE_SHARED_LINKER_FLAGS="-fprofile-arcs -ftest-coverage")
-#SET(CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
+SET(CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
+SET(CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
 
 endif (CMAKE_COMPILER_IS_GNUCC)
 
@@ -37,7 +37,7 @@ add_subdirectory(test-c-sgltn/Test_Hierarchy)
 add_subdirectory(test-c-sgltn/Test_ParallelRegions)
 add_subdirectory(test-c-sgltn/Test_Transition)
 add_subdirectory(test-c-sgltn/Test_ShallowHistory)
-add_subdirectory(test-c-sgltn/Test_DeepHistory)
+# add_subdirectory(test-c-sgltn/Test_DeepHistory)
 add_subdirectory(test-c-sgltn/Test_LocalActions)
 
 else (COMPILE_SINGLETON)
@@ -64,10 +64,10 @@ add_subdirectory(test-c/Test_LocalActions)
 
 if (CMAKE_COMPILER_IS_GNUCC)
 
-add_subdirectory(test-c/TimingTest_ParallelRegions)
+# add_subdirectory(test-c/TimingTest_ParallelRegions)
 
 endif (CMAKE_COMPILER_IS_GNUCC)
 
-# add_subdirectory(test-cppwrapper/InterfaceTest)
+add_subdirectory(test-cppwrapper/InterfaceTest)
 
 endif (COMPILE_SINGLETON)

+ 230 - 11
TestScenarios/GenModelC.sgen

@@ -1,4 +1,4 @@
-GeneratorModel for yakindu::c {
+GeneratorModel for yakindu::c { 
 	statechart InterfaceTest {
 		feature Debug { 
 			dumpSexec = true
@@ -10,7 +10,7 @@ GeneratorModel for yakindu::c {
 		feature CCodeFeature {
 			InterfaceEventListener = true
 			Singleton = false
-			DebugType = ""
+			DebugType = "cout"
 		}
 	feature LicenseHeader {
 			licenseText = "
@@ -33,15 +33,17 @@ GeneratorModel for yakindu::c {
 //			inlineReactions = false
 //		}
 	}
+	
+	
 	statechart Test_DeepHistory {
 		feature Outlet {
 			targetProject = "TestScenarios"
 			targetFolder = "src-gen-c/Test_DeepHistory"
 		}
 		feature CCodeFeature {
+			DebugType = "cout"			
 			InterfaceEventListener = true
 			Singleton = false
-			DebugType = ""
 		}
 		feature LicenseHeader {
 			licenseText = "
@@ -66,7 +68,7 @@ GeneratorModel for yakindu::c {
 			dumpSexec = true 
 		}
 		feature CCodeFeature {
-			DebugType = "none"
+			DebugType = "cout"
 			InterfaceEventListener = true
 			Singleton = false
 		}
@@ -90,11 +92,11 @@ GeneratorModel for yakindu::c {
 			targetFolder = "src-gen-c/Test_Hierarchy"
 		}
 		feature CCodeFeature {
+			DebugType = "cout"
 			InterfaceEventListener = true
 			Singleton = false
-			DebugType = ""
 		}
-				feature FunctionInlining {
+		feature FunctionInlining {
 			inlineEnterSequences = false
 			inlineExitSequences = false
 			inlineEnterRegion = false
@@ -122,9 +124,9 @@ GeneratorModel for yakindu::c {
 			targetFolder = "src-gen-c/Test_LocalActions"
 		}
 		feature CCodeFeature {
+			DebugType = "cout"
 			InterfaceEventListener = true
 			Singleton = false
-			DebugType = ""
 		}
 		feature LicenseHeader {
 			licenseText = "
@@ -145,9 +147,9 @@ GeneratorModel for yakindu::c {
 			targetFolder = "src-gen-c/Test_ParallelRegions"
 		}
 		feature CCodeFeature {
+			DebugType = "cout"
 			InterfaceEventListener = true
 			Singleton = false
-			DebugType = ""
 		}
 		feature LicenseHeader {
 			licenseText = "
@@ -168,9 +170,9 @@ GeneratorModel for yakindu::c {
 			targetFolder = "src-gen-c/Test_ShallowHistory"
 		}
 		feature CCodeFeature {
+			DebugType = "cout"
 			InterfaceEventListener = true
 			Singleton = false
-			DebugType = ""
 		}
 		feature LicenseHeader {
 			licenseText = "
@@ -191,9 +193,9 @@ GeneratorModel for yakindu::c {
 			targetFolder = "src-gen-c/Test_DeepHistory"
 		}
 		feature CCodeFeature {
+			DebugType = "cout"
 			InterfaceEventListener = true
 			Singleton = false
-			DebugType = ""
 		}
 				feature Debug { 
 			dumpSexec = true
@@ -217,9 +219,226 @@ GeneratorModel for yakindu::c {
 			targetFolder = "src-gen-c/Test_Transition"
 		}
 		feature CCodeFeature {
+			DebugType = "cout"
 			InterfaceEventListener = true
 			Singleton = false
-			DebugType = ""
+		}
+		feature LicenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+
+
+
+
+
+
+
+	statechart InterfaceTest {
+		feature	Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/InterfaceTest"
+		}
+		feature CCodeFeature {
+			DebugType = "cout"
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature LicenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+	statechart Test_DeepHistory {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_DeepHistory"
+		}
+		feature CCodeFeature {
+			DebugType = "cout"
+			InterfaceEventListener = true
+			Singleton = true 
+		}
+		feature LicenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+		
+	}
+	statechart Test_Expression {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_Expression"
+		}
+		feature CCodeFeature {
+			DebugType = "cout"
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature LicenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+
+	}
+	statechart Test_Hierarchy {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_Hierarchy"
+		}
+		feature CCodeFeature {
+			DebugType = "cout"
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature LicenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+	statechart Test_LocalActions {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_LocalActions"
+		}
+		feature CCodeFeature {
+			DebugType = "cout"
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature LicenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+	statechart Test_ParallelRegions {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_ParallelRegions"
+		}
+		feature CCodeFeature {
+			DebugType = "cout"
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature LicenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+	statechart Test_ShallowHistory {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_ShallowHistory"
+		}
+		feature CCodeFeature {
+			DebugType = "cout"
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature LicenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+	statechart Test_DeepHistory {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_DeepHistory"
+		}
+		feature CCodeFeature {
+			DebugType = "cout"
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature LicenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+	
+	statechart Test_Transition {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_Transition"
+		}
+		feature CCodeFeature {
+			DebugType = "cout"
+			InterfaceEventListener = true
+			Singleton = true
 		}
 		feature LicenseHeader {
 			licenseText = "

+ 2 - 1
TestScenarios/test-c-sgltn/InterfaceTest/main.c

@@ -7,6 +7,7 @@
 #include "DummyTimer.h"
 #include "InterfaceTestStatemachine.h"
 #include "InterfaceTestEvent.h"
+#include "definition.h"
 
 #define MAXEVENTSPERTYPE 4
 const char* stateName[6] = {"State1", "State2", "State3", "State4", "State5", "State6"};
@@ -468,7 +469,7 @@ int test_namespaces()
 			interfaceTest_if_third_get_v1() < 52.84 );
 
 	/*@Desc: check if v1 of other interface is still 8877 */
-	assert( interfaceTest_if_other_get_v1() == 8877 );
+	assert( interfaceTest_if_other_get_v1() == 10 );
 
 	/*@Desc: teardown statemachine */
 	teardownStatemachine(&dummyTimer, &eventPool);

+ 12 - 5
TestScenarios/test-c-sgltn/Test_Hierarchy/main.c

@@ -18,11 +18,18 @@
 
 #define MAXEVENTSPERTYPE 4
 const char* stateName[13] = {"State1", "State2", "State3", "State4", "State5", "State6", "State7", "State8", "State9", "State10", "State11", "State12", "none"};
-const int EnumTostateStr[10] = { _Test_Hierarchy_mainRegion_State1, _Test_Hierarchy_mainRegion_State2, _Test_Hierarchy_mainRegion_State2_Region2_State3, _Test_Hierarchy_mainRegion_State2_Region2_State4,
-		_Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State5, _Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State6,
-		_Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State6_Region6_State7,
-		_Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State6_Region6_State8,
-		_Test_Hierarchy_mainRegion_State1_Region1_State9, _Test_Hierarchy_mainRegion_State1_Region1_State10 };
+const int EnumTostateStr[10] = {
+	      _Test_Hierarchy_mainRegion_State1,
+	      _Test_Hierarchy_mainRegion_State2,
+	      _Test_Hierarchy_mainRegion_State2_Region2_State3,
+	      _Test_Hierarchy_mainRegion_State2_Region2_State4,
+	      _Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State5,
+	      _Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State6,
+	      _Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State6_Region6_State7,
+	      _Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State6_Region6_State8,
+	      _Test_Hierarchy_mainRegion_State1_Region1_State9,
+	      _Test_Hierarchy_mainRegion_State1_Region1_State10
+};
 
 const char* getStateString(uint32_t index)
 {

+ 1 - 1
TestScenarios/test-c/InterfaceTest/main.c

@@ -445,7 +445,7 @@ int test_namespaces()
 			interfaceTest_if_third_get_v1(&machine.ifaceThird) < 52.84 );
 
 	/*@Desc: check if v1 of other interface is still 8877 */
-	assert( interfaceTest_if_other_get_v1(&machine.ifaceOther) == 8877 );
+	assert( interfaceTest_if_other_get_v1(&machine.ifaceOther) == 10 );
 
 	/*@Desc: teardown statemachine */
 	teardownStatemachine(&machine, &dummyTimer, &eventPool);

+ 2 - 1
TestScenarios/test-c/Test_DeepHistory/main.c

@@ -18,7 +18,8 @@
 
 #define MAXEVENTSPERTYPE 4
 const char* stateName[10] = {"State1", "State2", "State3", "State4", "State5", "State6", "State7", "State8", "State9", "noState"};
-const int EnumTostateStr[10] = { _Test_DeepHistory_mainRegion_State1,
+const int EnumTostateStr[10] = { 
+		_Test_DeepHistory_mainRegion_State1,
 		_Test_DeepHistory_mainRegion_State2,
 		_Test_DeepHistory_mainRegion_State2_region0_State3,
 		_Test_DeepHistory_mainRegion_State2_region0_State4,

+ 13 - 5
TestScenarios/test-c/Test_Hierarchy/main.c

@@ -18,11 +18,19 @@
 
 #define MAXEVENTSPERTYPE 4
 const char* stateName[13] = {"State1", "State2", "State3", "State4", "State5", "State6", "State7", "State8", "State9", "State10", "State11", "State12", "none"};
-const int EnumTostateStr[10] = { _Test_Hierarchy_mainRegion_State1, _Test_Hierarchy_mainRegion_State2, _Test_Hierarchy_mainRegion_State2_Region2_State3, _Test_Hierarchy_mainRegion_State2_Region2_State4,
-		_Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State5, _Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State6,
-		_Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State6_Region6_State7,
-		_Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State6_Region6_State8,
-		_Test_Hierarchy_mainRegion_State1_Region1_State9, _Test_Hierarchy_mainRegion_State1_Region1_State10 , last_state };
+
+const int EnumTostateStr[10] = {
+	      _Test_Hierarchy_mainRegion_State1,
+	      _Test_Hierarchy_mainRegion_State2,
+	      _Test_Hierarchy_mainRegion_State2_Region2_State3,
+	      _Test_Hierarchy_mainRegion_State2_Region2_State4,
+	      _Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State5,
+	      _Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State6,
+	      _Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State6_Region6_State7,
+	      _Test_Hierarchy_mainRegion_State2_Region2_State4_Region4_State6_Region6_State8,
+	      _Test_Hierarchy_mainRegion_State1_Region1_State9,
+	      _Test_Hierarchy_mainRegion_State1_Region1_State10
+};
 
 const char* getStateString(uint32_t index)
 {

+ 4 - 1
TestScenarios/test-c/Test_LocalActions/main.c

@@ -18,7 +18,10 @@
 
 #define MAXEVENTSPERTYPE 4
 const char* stateName[3] = {"State1", "State2", "noState"};
-const int EnumTostateStr[3] = { _Test_LocalActions_mainRegion_State1, _Test_LocalActions_mainRegion_State2, last_state };
+const int EnumTostateStr[3] = {
+	      _Test_LocalActions_mainRegion_State1,
+	      _Test_LocalActions_mainRegion_State2,
+	      last_state };
 
 const char* getStateString(uint32_t index)
 {

+ 11 - 8
TestScenarios/test-c/Test_ParallelRegions/main.c

@@ -18,14 +18,17 @@
 
 #define MAXEVENTSPERTYPE 4
 const char* stateName[10] = {"State1", "State2", "State3", "State4", "State5", "State6", "State7", "State8", "State9", "noState"};
-const int EnumTostateStr[10] = { _Test_ParallelRegions_mainRegion_State1, _Test_ParallelRegions_mainRegion_State2,
-		_Test_ParallelRegions_mainRegion_State2_Region1_State3,
-		_Test_ParallelRegions_mainRegion_State2_Region1_State4,
-		_Test_ParallelRegions_mainRegion_State2_Region1_State4_Region2_State5,
-		_Test_ParallelRegions_mainRegion_State2_Region1_State4_Region2_State6,
-		_Test_ParallelRegions_mainRegion_State2_Region3_State7,
-		_Test_ParallelRegions_mainRegion_State2_Region3_State8,
-		_Test_ParallelRegions_mainRegion_State2_Region1_State4_Region4_State9, last_state };
+const int EnumTostateStr[10] = {
+	      _Test_ParallelRegions_mainRegion_State1,
+	      _Test_ParallelRegions_mainRegion_State2,
+	      _Test_ParallelRegions_mainRegion_State2_Region1_State3,
+	      _Test_ParallelRegions_mainRegion_State2_Region1_State4,
+	      _Test_ParallelRegions_mainRegion_State2_Region1_State4_Region2_State5,
+	      _Test_ParallelRegions_mainRegion_State2_Region1_State4_Region2_State6,
+	      _Test_ParallelRegions_mainRegion_State2_Region3_State7,
+	      _Test_ParallelRegions_mainRegion_State2_Region3_State8,
+	      _Test_ParallelRegions_mainRegion_State2_Region1_State4_Region4_State9,
+	      last_state };
 
 const char* getStateString(uint32_t index)
 {

+ 4 - 1
TestScenarios/test-c/Test_Transition/main.c

@@ -18,7 +18,10 @@
 
 #define MAXEVENTSPERTYPE 4
 const char* stateName[3] = {"State1", "State2", "noState"};
-const int EnumTostateStr[3] = { _Test_Transition_region0_State1, _Test_Transition_region0_State2, last_state };
+const int EnumTostateStr[3] = {
+		_Test_Transition_region0_State1,
+	    _Test_Transition_region0_State2,
+	    last_state };
 
 const char* getStateString(uint32_t index)
 {

+ 11 - 1
TestScenarios/test-c/TimingTest_ParallelRegions/main.c

@@ -22,7 +22,17 @@
 
 #define MAXEVENTSPERTYPE 4
 const char* stateName[10] = {"State1", "State2", "State3", "State4", "State5", "State6", "State7", "State8", "State9", "noState"};
-const int EnumTostateStr[10] = { _State1, _State2, _State3, _State4, _State5, _State6, _State7, _State8, _State9, last_state };
+const int EnumTostateStr[10] = {
+	      _Test_ParallelRegions_mainRegion_State1,
+	      _Test_ParallelRegions_mainRegion_State2,
+	      _Test_ParallelRegions_mainRegion_State2_Region1_State3,
+	      _Test_ParallelRegions_mainRegion_State2_Region1_State4,
+	      _Test_ParallelRegions_mainRegion_State2_Region1_State4_Region2_State5,
+	      _Test_ParallelRegions_mainRegion_State2_Region1_State4_Region2_State6,
+	      _Test_ParallelRegions_mainRegion_State2_Region3_State7,
+	      _Test_ParallelRegions_mainRegion_State2_Region3_State8,
+	      _Test_ParallelRegions_mainRegion_State2_Region1_State4_Region4_State9,
+	      last_state };
 
 int64_t timespecDiff(struct timespec *timeA_p, struct timespec *timeB_p)
 {

+ 2 - 7
TestScenarios/test-cppwrapper/InterfaceTest/CMakeLists.txt

@@ -5,10 +5,5 @@ include_directories(../../src-gen-c/InterfaceTest)
 add_executable(InterfaceTestStatemachineMainOO main.cpp)
 target_link_libraries(InterfaceTestStatemachineMainOO InterfaceTestStatemachine)
 
-add_test(Interface_test_default_interface_good_1 InterfaceTestStatemachineMainOO "1")
-add_test(Interface_test_default_interface_bad_2 InterfaceTestStatemachineMain "2")
-add_test(Interface_test_other_interface_good_3 InterfaceTestStatemachineMain "3")
-add_test(Interface_test_other_interface_bad_4 InterfaceTestStatemachineMain "4")
-add_test(Interface_test_third_interface_good_5 InterfaceTestStatemachineMain "5")
-add_test(Interface_test_third_interface_bad_6 InterfaceTestStatemachineMain "6")
-add_test(Interface_test_namespaces_7 InterfaceTestStatemachineMain "7")
+add_test(Interface_test_default_interface_good InterfaceTestStatemachineMainOO "1")
+add_test(Interface_test_default_interface_bad InterfaceTestStatemachineMainOO "2")

+ 16 - 16
TestScenarios/test-cppwrapper/InterfaceTest/main.cpp

@@ -23,16 +23,16 @@ int test_default_interface_good()
 	integer retval;
 
 	InterfaceTestStatemachineOOW machine(&dummyTimer);
-	InterfaceTestIfOO interfaceTestIf = machine.get_iface();
-	InterfaceTestIfOtherOO interfaceTestIfOther = machine.get_ifaceOther();
-	InterfaceTestIfThirdOO interfaceTestIfThird = machine.get_ifaceThird();
+	InterfaceTestIfOO* interfaceTestIf = machine.get_iface();
+	InterfaceTestIfOtherOO* interfaceTestIfOther = machine.get_ifaceOther();
+	InterfaceTestIfThirdOO* interfaceTestIfThird = machine.get_ifaceThird();
 
 	/*@Desc: check the initial state */
 	std::cout << "actual State: "<< stateName[machine.getStates()[0]] << std::endl;
 	assert( stateName[machine.getStates()[0]] == "State1");
 
 	/*@Desc: raise event1 on default interface */
-	interfaceTestIf.raise_event1();
+	interfaceTestIf->raise_event1();
 
 	/*@DescInfo: Initial value for the guard is 2.3, which is bigger than 0, so the transition should be taken */
 
@@ -44,13 +44,13 @@ int test_default_interface_good()
 	assert( stateName[machine.getStates()[0]] == "State2");
 
 	/*@Desc: check if the entry event2 is raised */
-	assert( interfaceTestIf.is_event2_raised(&retval) == bool_true );
+	assert( interfaceTestIf->is_event2_raised(&retval) == bool_true );
 
 	/*@Desc: check if the return value of event2 is set to 22 */
 	assert( retval == 22 );
 
 	/*@Desc: raise event1 on default interface */
-	interfaceTestIf.raise_event1();
+	interfaceTestIf->raise_event1();
 
 	/*@Desc: run an explicit cycle */
 	machine.runCycle();
@@ -60,7 +60,7 @@ int test_default_interface_good()
 	assert( stateName[machine.getStates()[0]] == "State1");
 
 	/*@Desc: check whether event2 is not raised any more */
-	assert( interfaceTestIf.is_event2_raised(&retval) == bool_false );
+	assert( interfaceTestIf->is_event2_raised(&retval) == bool_false );
 
 	return 0;
 }
@@ -75,20 +75,20 @@ int test_default_interface_bad()
 	integer retval = 55;
 
 	InterfaceTestStatemachineOOW machine(&dummyTimer);
-	InterfaceTestIfOO interfaceTestIf = machine.get_iface();
-	InterfaceTestIfOtherOO interfaceTestIfOther = machine.get_ifaceOther();
-	InterfaceTestIfThirdOO interfaceTestIfThird = machine.get_ifaceThird();
+	InterfaceTestIfOO* interfaceTestIf = machine.get_iface();
+	InterfaceTestIfOtherOO* interfaceTestIfOther = machine.get_ifaceOther();
+	InterfaceTestIfThirdOO* interfaceTestIfThird = machine.get_ifaceThird();
 
 	/*@Desc: check the initial state */
 	std::cout << "actual State: "<< stateName[machine.getStates()[0]] << std::endl;
 	assert( stateName[machine.getStates()[0]] == "State1");
 
 	/*@Desc: set variable var2 to -12.6 */
-	interfaceTestIf.set_var2(-12.6);
+	interfaceTestIf->set_var2(-12.6);
 	//interfaceTest_if_set_var2(&machine.interface, -12.6);
 
 	/*@Desc: raise event1 on default interface */
-	interfaceTestIf.raise_event1();
+	interfaceTestIf->raise_event1();
 //	interfaceTest_if_raise_event1(&machine.interface);
 
 	/*@DescInfo: Transition should not be taken, as guard with var2 is less than 0 */
@@ -102,17 +102,17 @@ int test_default_interface_bad()
 	assert( stateName[machine.getStates()[0]] == "State1");
 
 	/*@Desc: check if the entry event2 is NOT raised */
-	assert( interfaceTestIf.is_event2_raised(&retval) == bool_false );
+	assert( interfaceTestIf->is_event2_raised(&retval) == bool_false );
 
 	/*@Desc: check if the original retval has not been changed */
 	assert( retval == 55 );
 
 	/*@Desc: raise event1 on default interface */
-	interfaceTestIf.raise_event1();
+	interfaceTestIf->raise_event1();
 	//interfaceTest_if_raise_event1(&machine.interface);
 
 	/*@Desc: set variable var2 to 213.55 (>0) */
-	interfaceTestIf.set_var2(213.55);
+	interfaceTestIf->set_var2(213.55);
 	//interfaceTest_if_set_var2(&machine.interface, 213.55);
 
 	/*@Desc: run an explicit cycle */
@@ -124,7 +124,7 @@ int test_default_interface_bad()
 	assert( stateName[machine.getStates()[0]] == "State2");
 
 	/*@Desc: check whether event2 is raised */
-	assert( interfaceTestIf.is_event2_raised(&retval) == bool_true );
+	assert( interfaceTestIf->is_event2_raised(&retval) == bool_true );
 	//assert( interfaceTest_if_is_event2_raised(&machine.interface, &retval) == bool_true );