Browse Source

Newly generated the Cpp Tests and corrected the GMockHelper (#1324)

* Newly generated the Cpp Tests and corrected the GMockHelper

The GMockHelper has to use the c++ compiler and not the gcc compiler to
get a correct compiling result.

* Deleted the unnecessary custom test for Operations

* Adapted the AllTestsTestCustom class

* Only one Initialization of the statechart

* Added setUp and TearDown Class to the gtests

* install gmock via wget

* Fix cd command

* Attempt to add gmock to library load path

* Attempt to add gmock to library load path

* Attempt to add gmock to library load path

* Another attempt at fixing gmock

* Add gtest to include path

* Temporarely Fix, only assert whether the Operation with is String Param

is called, not asserting whether it is called with the right parameters.
Still need a way to fix the problem, to assert whether the operation was
called with the right parameters.
jthoene 8 years ago
parent
commit
a162c2601a
100 changed files with 7045 additions and 438 deletions
  1. 14 9
      .travis.yml
  2. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/AlwaysOncycleTest/AlwaysOncycleTest.cc
  3. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/AssignmentAsExpressionTest/AssignmentAsExpressionTest.cc
  4. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/BitExpressionsTest/BitExpressionsTest.cc
  5. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/BooleanExpressionsTest/BooleanExpressionsTest.cc
  6. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/CKeywordsTest/CKeywordsTest.cc
  7. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/CastExpressionsTest/CastExpressionsTest.cc
  8. 14 22
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ChoiceTest/ChoiceTest.cc
  9. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ConditionalExpression/ConditionalExpression.cc
  10. 9 7
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstOnlyDefaultScopeTest/ConstOnlyDefaultScopeTest.cc
  11. 9 7
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstOnlyInternalScopeTest/ConstOnlyInternalScopeTest.cc
  12. 9 7
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstOnlyNamedScopeTest/ConstOnlyNamedScopeTest.cc
  13. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstantsTests/ConstantsTests.cc
  14. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/DeclarationsTest/DeclarationsTest.cc
  15. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/DeepEntryTest/DeepEntryTest.cc
  16. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/DeepHistoryTest/DeepHistoryTest.cc
  17. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/DynamicChoiceTest/DynamicChoiceTest.cc
  18. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/EmptyTransitionTest/EmptyTransitionTest.cc
  19. 10 10
      test-plugins/org.yakindu.sct.generator.c.test/gtests/EnterStateTest/EnterStateTest.cc
  20. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/EntryChoiceTest/EntryChoiceTest.cc
  21. 9 7
      test-plugins/org.yakindu.sct.generator.c.test/gtests/EntryExitSelfTransitionTest/EntryExitSelfTransitionTest.cc
  22. 10 10
      test-plugins/org.yakindu.sct.generator.c.test/gtests/EntryReactionActionTest/EntryReactionActionTest.cc
  23. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ExitOnSelfTransitionTest/ExitOnSelfTransitionTest.cc
  24. 11 13
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ExitStateTest/ExitStateTest.cc
  25. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/FeatureCallsTest/FeatureCallsTest.cc
  26. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/FinalStateTest/FinalStateTest.cc
  27. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/GuardTest/GuardTest.cc
  28. 11 13
      test-plugins/org.yakindu.sct.generator.c.test/gtests/GuardedEntryTest/GuardedEntryTest.cc
  29. 9 7
      test-plugins/org.yakindu.sct.generator.c.test/gtests/GuardedExitTest/GuardedExitTest.cc
  30. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/HistoryWithExitPointTest/HistoryWithExitPointTest.cc
  31. 10 10
      test-plugins/org.yakindu.sct.generator.c.test/gtests/HistoryWithoutInitialStepTest/HistoryWithoutInitialStepTest.cc
  32. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/InEventLifeCycleTest/InEventLifeCycleTest.cc
  33. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/IntegerExpressionsTest/IntegerExpressionsTest.cc
  34. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/InternalEventLifeCycleTest/InternalEventLifeCycleTest.cc
  35. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/LocalReactionsTest/LocalReactionsTest.cc
  36. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/LogicalAndTests/LogicalAndTests.cc
  37. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/LogicalOrTests/LogicalOrTests.cc
  38. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/NamedInterfaceAccessTest/NamedInterfaceAccessTest.cc
  39. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/NullCheckTest/NullCheckTest.cc
  40. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/OperationsTest/OperationsTest.cc
  41. 11 13
      test-plugins/org.yakindu.sct.generator.c.test/gtests/OutEventLifeCycleTest/OutEventLifeCycleTest.cc
  42. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ParenthesisTest/ParenthesisTest.cc
  43. 9 7
      test-plugins/org.yakindu.sct.generator.c.test/gtests/PriorityValuesTest/PriorityValuesTest.cc
  44. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/RaiseEventTest/RaiseEventTest.cc
  45. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ReadOnlyVariableTest/ReadOnlyVariableTest.cc
  46. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/STextKeywordsInStatesAndRegionsTest/STextKeywordsInStatesAndRegionsTest.cc
  47. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/SameNameDifferentRegionTest/SameNameDifferentRegionTest.cc
  48. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ShallowHistoryTest/ShallowHistoryTest.cc
  49. 10 10
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ShallowHistoryWithDeepEntryTest/ShallowHistoryWithDeepEntryTest.cc
  50. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/SimpleEventTest/SimpleEventTest.cc
  51. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/SimpleHierachyTest/SimpleHierachyTest.cc
  52. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StateIsActiveTest/StateIsActiveTest.cc
  53. 11 13
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StatechartActiveTest/StatechartActiveTest.cc
  54. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StatechartLocalReactionsTest/StatechartLocalReactionsTest.cc
  55. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StatemachineKeywords/StatemachineKeywords.cc
  56. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StaticChoiceTest/StaticChoiceTest.cc
  57. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StringExpressionsTest/StringExpressionsTest.cc
  58. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/SyncForkTest/SyncForkTest.cc
  59. 10 10
      test-plugins/org.yakindu.sct.generator.c.test/gtests/SyncJoinTest/SyncJoinTest.cc
  60. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/TimedTransitionsTest/TimedTransitionsTest.cc
  61. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/TransitionWithoutConditionTest/TransitionWithoutConditionTest.cc
  62. 11 13
      test-plugins/org.yakindu.sct.generator.c.test/gtests/TriggerExpressionPrecedenceTest/TriggerExpressionPrecedenceTest.cc
  63. 9 7
      test-plugins/org.yakindu.sct.generator.c.test/gtests/TriggerGuardExpressionsTest/TriggerGuardExpressionsTest.cc
  64. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/TypeAliasTest/TypeAliasTest.cc
  65. 8 4
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ValuedEventsTest/ValuedEventsTest.cc
  66. 5 0
      test-plugins/org.yakindu.sct.generator.c.test/src/org/yakindu/sct/generator/c/gtest/GMockHelper.java
  67. 313 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AlwaysOncycleTest/AlwaysOncycle.cpp
  68. 135 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AlwaysOncycleTest/AlwaysOncycle.h
  69. 25 5
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AlwaysOncycleTest/AlwaysOncycleTest.cc
  70. 42 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AlwaysOncycleTest/StatemachineInterface.h
  71. 24 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AlwaysOncycleTest/sc_types.h
  72. 1096 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AssignmentAsExpressionTest/AssignmentAsExpression.cpp
  73. 451 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AssignmentAsExpressionTest/AssignmentAsExpression.h
  74. 47 5
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AssignmentAsExpressionTest/AssignmentAsExpressionTest.cc
  75. 42 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AssignmentAsExpressionTest/StatemachineInterface.h
  76. 24 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AssignmentAsExpressionTest/sc_types.h
  77. 415 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BitExpressionsTest/BitExpressions.cpp
  78. 214 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BitExpressionsTest/BitExpressions.h
  79. 30 5
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BitExpressionsTest/BitExpressionsTest.cc
  80. 42 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BitExpressionsTest/StatemachineInterface.h
  81. 24 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BitExpressionsTest/sc_types.h
  82. 393 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BooleanExpressionsTest/BooleanExpressions.cpp
  83. 201 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BooleanExpressionsTest/BooleanExpressions.h
  84. 29 5
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BooleanExpressionsTest/BooleanExpressionsTest.cc
  85. 42 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BooleanExpressionsTest/StatemachineInterface.h
  86. 24 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BooleanExpressionsTest/sc_types.h
  87. 984 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CKeywordsTest/CKeywords.cpp
  88. 470 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CKeywordsTest/CKeywords.h
  89. 24 5
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CKeywordsTest/CKeywordsTest.cc
  90. 42 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CKeywordsTest/StatemachineInterface.h
  91. 24 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CKeywordsTest/sc_types.h
  92. 319 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CastExpressionsTest/CastExpressions.cpp
  93. 135 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CastExpressionsTest/CastExpressions.h
  94. 25 5
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CastExpressionsTest/CastExpressionsTest.cc
  95. 42 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CastExpressionsTest/StatemachineInterface.h
  96. 24 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CastExpressionsTest/sc_types.h
  97. 521 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ChoiceTest/Choice.cpp
  98. 176 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ChoiceTest/Choice.h
  99. 77 29
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ChoiceTest/ChoiceTest.cc
  100. 0 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ChoiceTest/StatemachineInterface.h

+ 14 - 9
.travis.yml

@@ -6,8 +6,6 @@ jdk:
 addons:
  apt:
   packages:
-  - libgtest-dev
-  - google-mock
  coverity_scan:
    project:
      name: Yakindu/statecharts
@@ -20,7 +18,10 @@ cache:
 env:
   global:
   - DISPLAY=:99.0
-  - GTEST_DIR=${TRAVIS_BUILD_DIR}/gtest
+  - GTEST_DIR=${TRAVIS_BUILD_DIR}/googletest-release-1.8.0/googletest
+  - LIBRARY_PATH=${TRAVIS_BUILD_DIR}/googletest-release-1.8.0/googletest/build:${TRAVIS_BUILD_DIR}/googletest-release-1.8.0/googlemock/build:$LIBRARY_PATH
+  - CPATH=${TRAVIS_BUILD_DIR}/googletest-release-1.8.0/googletest/include:${TRAVIS_BUILD_DIR}/googletest-release-1.8.0/googlemock/include:$CPATH
+  - GMOCK_HOME
   # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
   # via the "travis encrypt" command using the project repo's public key
   - secure: "e6AtFe0HJAHRdmzp4uXx4b+xZaEUUd2jeYiLdIkYuRa84op9iSzCmPj5uT3Vkvqps5snBrDx47Wl1EO9rl+Z91WYp1JgTT5Ek37SKj/ikhJ0HfAYBycU/MRTMO5wXEfwL29G0gjygzFxlUe7t/Y92M/VsvlEQ9nHrtqJ4hQA968="
@@ -37,12 +38,16 @@ matrix:
    - jdk: oraclejdk7
      env: TARGET=Neon.target
 before_script:
- - mkdir gtest 
- - cd gtest
- - cp -r /usr/src/gtest/. .
- - ls
- - cmake CMakeLists.txt
- - make
+ - wget https://github.com/google/googletest/archive/release-1.8.0.zip
+ - unzip release-1.8.0.zip
+ - cd googletest-release-1.8.0/googlemock
+ - mkdir build && cd build && cmake .. && make
+ - export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH
+ - cd ../../googletest
+ - mkdir build && cd build && cmake .. && make
+ - export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH
+ - cd ../..
+ - export GMOCK_HOME=`pwd`
  - cd $TRAVIS_BUILD_DIR
 before_install:
 - sh -e /etc/init.d/xvfb start - sleep 10

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/AlwaysOncycleTest/AlwaysOncycleTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "AlwaysOncycle.h"
 
 AlwaysOncycle handle;
 
-TEST(StatemachineTest, alwaysOncycleTest) {
-	alwaysOncycle_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		alwaysOncycle_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, alwaysOncycleTest) {					
 	alwaysOncycle_enter(&handle);
 	EXPECT_TRUE(alwaysOncycle_isStateActive(&handle, AlwaysOncycle_main_region_StateA));
 	while (alwaysOncycleIface_get_value(&handle)< 5l) {

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/AssignmentAsExpressionTest/AssignmentAsExpressionTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "AssignmentAsExpression.h"
 
 AssignmentAsExpression handle;
 
-TEST(StatemachineTest, simpleAssignment) {
-	assignmentAsExpression_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		assignmentAsExpression_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, simpleAssignment) {					
 	assignmentAsExpression_enter(&handle);
 	EXPECT_TRUE(assignmentAsExpression_isStateActive(&handle, AssignmentAsExpression_main_region_Add));
 	EXPECT_TRUE(assignmentAsExpressionIface_get_b(&handle)== 5l);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/BitExpressionsTest/BitExpressionsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "BitExpressions.h"
 
 BitExpressions handle;
 
-TEST(StatemachineTest, BitExpressions) {
-	bitExpressions_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		bitExpressions_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, BitExpressions) {					
 	bitExpressions_enter(&handle);
 	EXPECT_TRUE(bitExpressions_isStateActive(&handle, BitExpressions_main_region_StateA));
 	EXPECT_TRUE(bitExpressionsIface_get_myBit1(&handle)== 5l);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/BooleanExpressionsTest/BooleanExpressionsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "BooleanExpressions.h"
 
 BooleanExpressions handle;
 
-TEST(StatemachineTest, booleanExpressions) {
-	booleanExpressions_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		booleanExpressions_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, booleanExpressions) {					
 	booleanExpressions_enter(&handle);
 	EXPECT_TRUE(booleanExpressions_isStateActive(&handle, BooleanExpressions_main_region_StateA));
 	EXPECT_TRUE(booleanExpressionsIface_get_myBool1(&handle)== true);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/CKeywordsTest/CKeywordsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "CKeywords.h"
 
 CKeywords handle;
 
-TEST(StatemachineTest, CKeywordsTest) {
-	cKeywords_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		cKeywords_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, CKeywordsTest) {					
 	cKeywords_enter(&handle);
 	EXPECT_TRUE(cKeywords_isStateActive(&handle, CKeywords_auto_char));
 	cKeywordsIface_raise_auto(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/CastExpressionsTest/CastExpressionsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "CastExpressions.h"
 
 CastExpressions handle;
 
-TEST(StatemachineTest, CastExpressionTest) {
-	castExpressions_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		castExpressions_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, CastExpressionTest) {					
 	castExpressions_enter(&handle);
 	EXPECT_TRUE(castExpressionsIface_get_realValue(&handle)== 5l);
 	EXPECT_TRUE(castExpressionsIface_get_intValue(&handle)== 5l);

+ 14 - 22
test-plugins/org.yakindu.sct.generator.c.test/gtests/ChoiceTest/ChoiceTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "Choice.h"
 
 Choice handle;
 
-TEST(StatemachineTest, elseChoiceUsingNonDefaultTransition) {
-	choice_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		choice_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, elseChoiceUsingNonDefaultTransition) {					
 	choice_enter(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
 	choiceIface_set_c(&handle,true);
@@ -24,9 +28,7 @@ TEST(StatemachineTest, elseChoiceUsingNonDefaultTransition) {
 	choice_runCycle(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_C));
 }
-TEST(StatemachineTest, elseChoiceUsingDefaultTransition) {
-	choice_init(&handle);
-	
+TEST_F(StatemachineTest, elseChoiceUsingDefaultTransition) {					
 	choice_enter(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
 	choiceIface_set_c(&handle,false);
@@ -34,9 +36,7 @@ TEST(StatemachineTest, elseChoiceUsingDefaultTransition) {
 	choice_runCycle(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_B));
 }
-TEST(StatemachineTest, defaultChoiceUsingNonDefaultTransition) {
-	choice_init(&handle);
-	
+TEST_F(StatemachineTest, defaultChoiceUsingNonDefaultTransition) {					
 	choice_enter(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
 	choiceIface_set_c(&handle,true);
@@ -44,9 +44,7 @@ TEST(StatemachineTest, defaultChoiceUsingNonDefaultTransition) {
 	choice_runCycle(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_C));
 }
-TEST(StatemachineTest, defaultChoiceUsingDefaultTransition) {
-	choice_init(&handle);
-	
+TEST_F(StatemachineTest, defaultChoiceUsingDefaultTransition) {					
 	choice_enter(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
 	choiceIface_set_c(&handle,false);
@@ -54,9 +52,7 @@ TEST(StatemachineTest, defaultChoiceUsingDefaultTransition) {
 	choice_runCycle(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_B));
 }
-TEST(StatemachineTest, uncheckedChoiceUsingNonDefaultTransition) {
-	choice_init(&handle);
-	
+TEST_F(StatemachineTest, uncheckedChoiceUsingNonDefaultTransition) {					
 	choice_enter(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
 	choiceIface_set_c(&handle,true);
@@ -64,9 +60,7 @@ TEST(StatemachineTest, uncheckedChoiceUsingNonDefaultTransition) {
 	choice_runCycle(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_C));
 }
-TEST(StatemachineTest, uncheckedChoiceUsingDefaultTransition) {
-	choice_init(&handle);
-	
+TEST_F(StatemachineTest, uncheckedChoiceUsingDefaultTransition) {					
 	choice_enter(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
 	choiceIface_set_c(&handle,false);
@@ -74,9 +68,7 @@ TEST(StatemachineTest, uncheckedChoiceUsingDefaultTransition) {
 	choice_runCycle(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_B));
 }
-TEST(StatemachineTest, alwaysTrueTransitionInChoice) {
-	choice_init(&handle);
-	
+TEST_F(StatemachineTest, alwaysTrueTransitionInChoice) {					
 	choice_enter(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
 	choiceIface_set_c(&handle,true);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/ConditionalExpression/ConditionalExpression.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "ConditionalExpressions.h"
 
 ConditionalExpressions handle;
 
-TEST(StatemachineTest, ConditionalExpressionTest) {
-	conditionalExpressions_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		conditionalExpressions_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, ConditionalExpressionTest) {					
 	conditionalExpressions_enter(&handle);
 	EXPECT_TRUE(conditionalExpressions_isStateActive(&handle, ConditionalExpressions_main_region_A));
 	EXPECT_TRUE(conditionalExpressionsIface_get_condition(&handle)== 1l);

+ 9 - 7
test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstOnlyDefaultScopeTest/ConstOnlyDefaultScopeTest.cc

@@ -8,21 +8,23 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "ConstOnlyDefaultScope.h"
 
 ConstOnlyDefaultScope handle;
 
-TEST(StatemachineTest, statechartEntry) {
-	constOnlyDefaultScope_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		constOnlyDefaultScope_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, statechartEntry) {					
 	constOnlyDefaultScope_enter(&handle);
 	EXPECT_TRUE(constOnlyDefaultScope_isStateActive(&handle, ConstOnlyDefaultScope_ConstOnlyDefaultScope_main_region_A));
 }
-TEST(StatemachineTest, stateTransition) {
-	constOnlyDefaultScope_init(&handle);
-	
+TEST_F(StatemachineTest, stateTransition) {					
 	constOnlyDefaultScope_enter(&handle);
 	constOnlyDefaultScopeIfaceA_raise_e(&handle, 1l);
 	constOnlyDefaultScope_runCycle(&handle);

+ 9 - 7
test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstOnlyInternalScopeTest/ConstOnlyInternalScopeTest.cc

@@ -8,21 +8,23 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "ConstOnlyInternalScope.h"
 
 ConstOnlyInternalScope handle;
 
-TEST(StatemachineTest, statechartEntry) {
-	constOnlyInternalScope_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		constOnlyInternalScope_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, statechartEntry) {					
 	constOnlyInternalScope_enter(&handle);
 	EXPECT_TRUE(constOnlyInternalScope_isStateActive(&handle, ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_A));
 }
-TEST(StatemachineTest, stateTransition) {
-	constOnlyInternalScope_init(&handle);
-	
+TEST_F(StatemachineTest, stateTransition) {					
 	constOnlyInternalScope_enter(&handle);
 	constOnlyInternalScopeIface_raise_e(&handle, 1l);
 	constOnlyInternalScope_runCycle(&handle);

+ 9 - 7
test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstOnlyNamedScopeTest/ConstOnlyNamedScopeTest.cc

@@ -8,21 +8,23 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "ConstOnlyNamedScope.h"
 
 ConstOnlyNamedScope handle;
 
-TEST(StatemachineTest, statechartEntry) {
-	constOnlyNamedScope_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		constOnlyNamedScope_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, statechartEntry) {					
 	constOnlyNamedScope_enter(&handle);
 	EXPECT_TRUE(constOnlyNamedScope_isStateActive(&handle, ConstOnlyNamedScope_ConstOnlyNamedScope_main_region_A));
 }
-TEST(StatemachineTest, stateTransition) {
-	constOnlyNamedScope_init(&handle);
-	
+TEST_F(StatemachineTest, stateTransition) {					
 	constOnlyNamedScope_enter(&handle);
 	constOnlyNamedScopeIface_raise_e(&handle, 1l);
 	constOnlyNamedScope_runCycle(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstantsTests/ConstantsTests.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "Constants.h"
 
 Constants handle;
 
-TEST(StatemachineTest, constantDefinition) {
-	constants_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		constants_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, constantDefinition) {					
 	constants_enter(&handle);
 	EXPECT_TRUE(constants_isStateActive(&handle, Constants_main_region_A));
 	EXPECT_TRUE(constantsIface_get_x(&handle)== 10l);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/DeclarationsTest/DeclarationsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "Declarations.h"
 
 Declarations handle;
 
-TEST(StatemachineTest, declarationsTest) {
-	declarations_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		declarations_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, declarationsTest) {					
 	declarations_enter(&handle);
 }
 

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/DeepEntryTest/DeepEntryTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "DeepEntry.h"
 
 DeepEntry handle;
 
-TEST(StatemachineTest, enterToSubstate) {
-	deepEntry_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		deepEntry_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, enterToSubstate) {					
 	EXPECT_TRUE(deepEntryIface_get_x(&handle)== 0l);
 	EXPECT_TRUE(deepEntryIface_get_y(&handle)== 0l);
 	EXPECT_TRUE(deepEntryIface_get_z(&handle)== 0l);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/DeepHistoryTest/DeepHistoryTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "DeepHistory.h"
 
 DeepHistory handle;
 
-TEST(StatemachineTest, deepHistoryTest) {
-	deepHistory_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		deepHistory_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, deepHistoryTest) {					
 	deepHistory_enter(&handle);
 	deepHistoryIface_raise_event1(&handle);
 	deepHistory_runCycle(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/DynamicChoiceTest/DynamicChoiceTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "DynamicChoice.h"
 
 DynamicChoice handle;
 
-TEST(StatemachineTest, DynamicChoiceTest) {
-	dynamicChoice_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		dynamicChoice_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, DynamicChoiceTest) {					
 	dynamicChoice_enter(&handle);
 	EXPECT_TRUE(dynamicChoice_isStateActive(&handle, DynamicChoice_main_region_Start));
 	dynamicChoice_runCycle(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/EmptyTransitionTest/EmptyTransitionTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "EmptyTransition.h"
 
 EmptyTransition handle;
 
-TEST(StatemachineTest, EmptyTransitionTest) {
-	emptyTransition_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		emptyTransition_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, EmptyTransitionTest) {					
 	emptyTransition_enter(&handle);
 	emptyTransition_runCycle(&handle);
 	EXPECT_TRUE(!emptyTransition_isStateActive(&handle, EmptyTransition_main_region_B));

+ 10 - 10
test-plugins/org.yakindu.sct.generator.c.test/gtests/EnterStateTest/EnterStateTest.cc

@@ -8,33 +8,33 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "EnterState.h"
 
 EnterState handle;
 
-TEST(StatemachineTest, defaultEntry) {
-	enterState_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		enterState_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, defaultEntry) {					
 	enterState_enter(&handle);
 	EXPECT_TRUE(enterState_isStateActive(&handle, EnterState_r_A));
 	enterStateIface_raise_e(&handle);
 	enterState_runCycle(&handle);
 	EXPECT_TRUE(enterState_isStateActive(&handle, EnterState_r_B_r_E));
 }
-TEST(StatemachineTest, namedEntryThroughNamedTransition) {
-	enterState_init(&handle);
-	
+TEST_F(StatemachineTest, namedEntryThroughNamedTransition) {					
 	enterState_enter(&handle);
 	EXPECT_TRUE(enterState_isStateActive(&handle, EnterState_r_A));
 	enterStateIface_raise_f(&handle);
 	enterState_runCycle(&handle);
 	EXPECT_TRUE(enterState_isStateActive(&handle, EnterState_r_B_r_F));
 }
-TEST(StatemachineTest, namedEntryThroughDefaultTransition) {
-	enterState_init(&handle);
-	
+TEST_F(StatemachineTest, namedEntryThroughDefaultTransition) {					
 	enterState_enter(&handle);
 	EXPECT_TRUE(enterState_isStateActive(&handle, EnterState_r_A));
 	enterStateIface_raise_g(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/EntryChoiceTest/EntryChoiceTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "EntryChoice.h"
 
 EntryChoice handle;
 
-TEST(StatemachineTest, EntryChoiceTest) {
-	entryChoice_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		entryChoice_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, EntryChoiceTest) {					
 	entryChoice_enter(&handle);
 	entryChoice_runCycle(&handle);
 	entryChoice_runCycle(&handle);

+ 9 - 7
test-plugins/org.yakindu.sct.generator.c.test/gtests/EntryExitSelfTransitionTest/EntryExitSelfTransitionTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "EntryExitSelfTransition.h"
 
 EntryExitSelfTransition handle;
 
-TEST(StatemachineTest, SelfTransitionToChildState) {
-	entryExitSelfTransition_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		entryExitSelfTransition_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, SelfTransitionToChildState) {					
 	entryExitSelfTransition_enter(&handle);
 	entryExitSelfTransition_runCycle(&handle);
 	EXPECT_TRUE(entryExitSelfTransitionIface_get_entries(&handle)== 1l);
@@ -28,9 +32,7 @@ TEST(StatemachineTest, SelfTransitionToChildState) {
 	EXPECT_TRUE(entryExitSelfTransitionIface_get_exits(&handle)== 1l);
 	EXPECT_TRUE(entryExitSelfTransition_isStateActive(&handle, EntryExitSelfTransition_main_region_A__region0_C));
 }
-TEST(StatemachineTest, SelfTransitionFromChildState) {
-	entryExitSelfTransition_init(&handle);
-	
+TEST_F(StatemachineTest, SelfTransitionFromChildState) {					
 	entryExitSelfTransition_enter(&handle);
 	entryExitSelfTransition_runCycle(&handle);
 	EXPECT_TRUE(entryExitSelfTransitionIface_get_entries(&handle)== 1l);

+ 10 - 10
test-plugins/org.yakindu.sct.generator.c.test/gtests/EntryReactionActionTest/EntryReactionActionTest.cc

@@ -8,24 +8,26 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "EntryReactionAction.h"
 
 EntryReactionAction handle;
 
-TEST(StatemachineTest, entryTransitionActionOnStatechartEnter) {
-	entryReactionAction_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		entryReactionAction_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, entryTransitionActionOnStatechartEnter) {					
 	entryReactionAction_enter(&handle);
 	EXPECT_TRUE(entryReactionActionIface_get_enteredR1(&handle));
 	EXPECT_TRUE(entryReactionActionIface_get_enteredR2(&handle));
 	EXPECT_TRUE(entryReactionActionIface_get_enteredBdefault(&handle));
 	EXPECT_TRUE(!entryReactionActionIface_get_enteredBother(&handle));
 }
-TEST(StatemachineTest, entryOnRTS) {
-	entryReactionAction_init(&handle);
-	
+TEST_F(StatemachineTest, entryOnRTS) {					
 	entryReactionAction_enter(&handle);
 	entryReactionActionIface_raise_b(&handle);
 	entryReactionAction_runCycle(&handle);
@@ -42,9 +44,7 @@ TEST(StatemachineTest, entryOnRTS) {
 	EXPECT_TRUE(!entryReactionActionIface_get_enteredBdefault(&handle));
 	EXPECT_TRUE(entryReactionActionIface_get_enteredBother(&handle));
 }
-TEST(StatemachineTest, noEntryTransitionActionOnHistory) {
-	entryReactionAction_init(&handle);
-	
+TEST_F(StatemachineTest, noEntryTransitionActionOnHistory) {					
 	entryReactionAction_enter(&handle);
 	entryReactionActionIface_raise_b(&handle);
 	entryReactionAction_runCycle(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/ExitOnSelfTransitionTest/ExitOnSelfTransitionTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "ExitOnSelfTransition.h"
 
 ExitOnSelfTransition handle;
 
-TEST(StatemachineTest, ExitOnSelfTransitionTest) {
-	exitOnSelfTransition_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		exitOnSelfTransition_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, ExitOnSelfTransitionTest) {					
 	exitOnSelfTransition_enter(&handle);
 	EXPECT_TRUE(exitOnSelfTransition_isStateActive(&handle, ExitOnSelfTransition_main_region_A));
 	EXPECT_TRUE(exitOnSelfTransitionIface_get_entryCount(&handle)== 1l);

+ 11 - 13
test-plugins/org.yakindu.sct.generator.c.test/gtests/ExitStateTest/ExitStateTest.cc

@@ -8,42 +8,40 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "ExitState.h"
 
 ExitState handle;
 
-TEST(StatemachineTest, defaultExit) {
-	exitState_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		exitState_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, defaultExit) {					
 	exitState_enter(&handle);
 	EXPECT_TRUE(exitState_isStateActive(&handle, ExitState_r_A));
 	exitStateIface_raise_e(&handle);
 	exitState_runCycle(&handle);
 	EXPECT_TRUE(exitState_isStateActive(&handle, ExitState_r_E));
 }
-TEST(StatemachineTest, namedExitThroughNamedTransition) {
-	exitState_init(&handle);
-	
+TEST_F(StatemachineTest, namedExitThroughNamedTransition) {					
 	exitState_enter(&handle);
 	EXPECT_TRUE(exitState_isStateActive(&handle, ExitState_r_A));
 	exitStateIface_raise_f(&handle);
 	exitState_runCycle(&handle);
 	EXPECT_TRUE(exitState_isStateActive(&handle, ExitState_r_F));
 }
-TEST(StatemachineTest, namedExitThroughDefaultTransition) {
-	exitState_init(&handle);
-	
+TEST_F(StatemachineTest, namedExitThroughDefaultTransition) {					
 	exitState_enter(&handle);
 	EXPECT_TRUE(exitState_isStateActive(&handle, ExitState_r_A));
 	exitStateIface_raise_g(&handle);
 	exitState_runCycle(&handle);
 	EXPECT_TRUE(exitState_isStateActive(&handle, ExitState_r_E));
 }
-TEST(StatemachineTest, remainInA) {
-	exitState_init(&handle);
-	
+TEST_F(StatemachineTest, remainInA) {					
 	exitState_enter(&handle);
 	EXPECT_TRUE(exitState_isStateActive(&handle, ExitState_r_A));
 	exitState_runCycle(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/FeatureCallsTest/FeatureCallsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "FeatureCalls.h"
 
 FeatureCalls handle;
 
-TEST(StatemachineTest, FeatureCalls) {
-	featureCalls_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		featureCalls_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, FeatureCalls) {					
 	featureCalls_enter(&handle);
 	EXPECT_TRUE(featureCalls_isStateActive(&handle, FeatureCalls_main_region_A));
 	featureCalls_runCycle(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/FinalStateTest/FinalStateTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "FinalState.h"
 
 FinalState handle;
 
-TEST(StatemachineTest, StatechartNameTest) {
-	finalState_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		finalState_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, StatechartNameTest) {					
 	finalState_enter(&handle);
 	finalState_runCycle(&handle);
 	EXPECT_TRUE(finalState_isFinal(&handle));

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/GuardTest/GuardTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "Guard.h"
 
 Guard handle;
 
-TEST(StatemachineTest, guardTest) {
-	guard_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		guard_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, guardTest) {					
 	guard_enter(&handle);
 	EXPECT_TRUE(guard_isStateActive(&handle, Guard_main_region_A));
 	guardIface_raise_event1(&handle);

+ 11 - 13
test-plugins/org.yakindu.sct.generator.c.test/gtests/GuardedEntryTest/GuardedEntryTest.cc

@@ -8,31 +8,31 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "GuardedEntry.h"
 
 GuardedEntry handle;
 
-TEST(StatemachineTest, EntryNotTakenOnStatechartEnter) {
-	guardedEntry_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		guardedEntry_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, EntryNotTakenOnStatechartEnter) {					
 	EXPECT_TRUE(guardedEntryIface_get_guard(&handle)== false);
 	guardedEntry_enter(&handle);
 	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_A));
 	EXPECT_TRUE(guardedEntryIface_get_done(&handle)== false);
 }
-TEST(StatemachineTest, EntryTakenOnStatechartEnter) {
-	guardedEntry_init(&handle);
-	
+TEST_F(StatemachineTest, EntryTakenOnStatechartEnter) {					
 	guardedEntryIface_set_guard(&handle,true);
 	guardedEntry_enter(&handle);
 	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_A));
 	EXPECT_TRUE(guardedEntryIface_get_done(&handle)== true);
 }
-TEST(StatemachineTest, EntryTakenInTransition) {
-	guardedEntry_init(&handle);
-	
+TEST_F(StatemachineTest, EntryTakenInTransition) {					
 	guardedEntry_enter(&handle);
 	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_A));
 	guardedEntryIface_raise_e(&handle);
@@ -45,9 +45,7 @@ TEST(StatemachineTest, EntryTakenInTransition) {
 	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_A));
 	EXPECT_TRUE(guardedEntryIface_get_done(&handle));
 }
-TEST(StatemachineTest, EntryNotTakenInTransition) {
-	guardedEntry_init(&handle);
-	
+TEST_F(StatemachineTest, EntryNotTakenInTransition) {					
 	guardedEntry_enter(&handle);
 	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_A));
 	guardedEntryIface_raise_e(&handle);

+ 9 - 7
test-plugins/org.yakindu.sct.generator.c.test/gtests/GuardedExitTest/GuardedExitTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "GuardedExit.h"
 
 GuardedExit handle;
 
-TEST(StatemachineTest, ExitTaken) {
-	guardedExit_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		guardedExit_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, ExitTaken) {					
 	guardedExit_enter(&handle);
 	EXPECT_TRUE(guardedExit_isStateActive(&handle, GuardedExit_main_region_A));
 	EXPECT_TRUE(!guardedExitIface_get_guard(&handle));
@@ -25,9 +29,7 @@ TEST(StatemachineTest, ExitTaken) {
 	EXPECT_TRUE(guardedExit_isStateActive(&handle, GuardedExit_main_region_B));
 	EXPECT_TRUE(!guardedExitIface_get_done(&handle));
 }
-TEST(StatemachineTest, ExitNotTaken) {
-	guardedExit_init(&handle);
-	
+TEST_F(StatemachineTest, ExitNotTaken) {					
 	guardedExit_enter(&handle);
 	EXPECT_TRUE(guardedExit_isStateActive(&handle, GuardedExit_main_region_A));
 	guardedExitIface_set_guard(&handle,true);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/HistoryWithExitPointTest/HistoryWithExitPointTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "HistoryWithExitPoint.h"
 
 HistoryWithExitPoint handle;
 
-TEST(StatemachineTest, historyEntryAfterExit) {
-	historyWithExitPoint_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		historyWithExitPoint_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, historyEntryAfterExit) {					
 	historyWithExitPoint_enter(&handle);
 	EXPECT_TRUE(historyWithExitPoint_isStateActive(&handle, HistoryWithExitPoint_mr_A_r_X1));
 	historyWithExitPointIface_raise_push(&handle);

+ 10 - 10
test-plugins/org.yakindu.sct.generator.c.test/gtests/HistoryWithoutInitialStepTest/HistoryWithoutInitialStepTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "HistoryWithoutInitialStep.h"
 
 HistoryWithoutInitialStep handle;
 
-TEST(StatemachineTest, enterThroughInitialEntry) {
-	historyWithoutInitialStep_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		historyWithoutInitialStep_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, enterThroughInitialEntry) {					
 	historyWithoutInitialStep_enter(&handle);
 	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_A));
 	historyWithoutInitialStepIface_raise_toB(&handle);
@@ -26,9 +30,7 @@ TEST(StatemachineTest, enterThroughInitialEntry) {
 	historyWithoutInitialStep_runCycle(&handle);
 	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_B_r1_D));
 }
-TEST(StatemachineTest, enterCThroughHistory) {
-	historyWithoutInitialStep_init(&handle);
-	
+TEST_F(StatemachineTest, enterCThroughHistory) {					
 	historyWithoutInitialStep_enter(&handle);
 	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_A));
 	historyWithoutInitialStepIface_raise_toB(&handle);
@@ -41,9 +43,7 @@ TEST(StatemachineTest, enterCThroughHistory) {
 	historyWithoutInitialStep_runCycle(&handle);
 	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_B_r1_C));
 }
-TEST(StatemachineTest, enterDThroughHistory) {
-	historyWithoutInitialStep_init(&handle);
-	
+TEST_F(StatemachineTest, enterDThroughHistory) {					
 	historyWithoutInitialStep_enter(&handle);
 	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_A));
 	historyWithoutInitialStepIface_raise_toB(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/InEventLifeCycleTest/InEventLifeCycleTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "InEventLifeCycle.h"
 
 InEventLifeCycle handle;
 
-TEST(StatemachineTest, eventLifeCycle) {
-	inEventLifeCycle_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		inEventLifeCycle_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, eventLifeCycle) {					
 	inEventLifeCycle_enter(&handle);
 	inEventLifeCycleIface_raise_e(&handle);
 	EXPECT_TRUE(inEventLifeCycleIface_get_i(&handle)== 0l);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/IntegerExpressionsTest/IntegerExpressionsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "IntegerExpressions.h"
 
 IntegerExpressions handle;
 
-TEST(StatemachineTest, integerExpressions) {
-	integerExpressions_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		integerExpressions_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, integerExpressions) {					
 	integerExpressions_enter(&handle);
 	EXPECT_TRUE(integerExpressions_isStateActive(&handle, IntegerExpressions_main_region_StateA));
 	EXPECT_TRUE(integerExpressionsIface_get_myInt1(&handle)== 10l);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/InternalEventLifeCycleTest/InternalEventLifeCycleTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "InternalEventLifeCycle.h"
 
 InternalEventLifeCycle handle;
 
-TEST(StatemachineTest, InternalEventLifeCycleTest) {
-	internalEventLifeCycle_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		internalEventLifeCycle_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, InternalEventLifeCycleTest) {					
 	internalEventLifeCycle_enter(&handle);
 	EXPECT_TRUE(internalEventLifeCycle_isStateActive(&handle, InternalEventLifeCycle_r1_A));
 	EXPECT_TRUE(internalEventLifeCycle_isStateActive(&handle, InternalEventLifeCycle_r2_C));

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/LocalReactionsTest/LocalReactionsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "LocalReactions.h"
 
 LocalReactions handle;
 
-TEST(StatemachineTest, LocalReactionsTest) {
-	localReactions_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		localReactions_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, LocalReactionsTest) {					
 	localReactions_enter(&handle);
 	EXPECT_TRUE(localReactions_isStateActive(&handle, LocalReactions_main_region_A));
 	localReactions_runCycle(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/LogicalAndTests/LogicalAndTests.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "LogicalAnd.h"
 
 LogicalAnd handle;
 
-TEST(StatemachineTest, operandEvaluationOrder) {
-	logicalAnd_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		logicalAnd_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, operandEvaluationOrder) {					
 	logicalAnd_enter(&handle);
 	logicalAnd_runCycle(&handle);
 	EXPECT_TRUE(logicalAndIface_get_x(&handle)== 4l && logicalAndIface_get_b(&handle)) << "logical and expression was executed in wrong order..." ;

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/LogicalOrTests/LogicalOrTests.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "LogicalOr.h"
 
 LogicalOr handle;
 
-TEST(StatemachineTest, operandEvaluationOrder) {
-	logicalOr_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		logicalOr_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, operandEvaluationOrder) {					
 	logicalOr_enter(&handle);
 	logicalOr_runCycle(&handle);
 	EXPECT_TRUE(logicalOrIface_get_x(&handle)== 4l && logicalOrIface_get_b(&handle)) << "logical or expression was executed in wrong order..." ;

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/NamedInterfaceAccessTest/NamedInterfaceAccessTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "NamedInterfaceAccess.h"
 
 NamedInterfaceAccess handle;
 
-TEST(StatemachineTest, SafeOpenSuccess) {
-	namedInterfaceAccess_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		namedInterfaceAccess_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, SafeOpenSuccess) {					
 	namedInterfaceAccess_enter(&handle);
 	namedInterfaceAccess_runCycle(&handle);
 	namedInterfaceAccessIfaceUser_raise_numberPressed(&handle, 3l);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/NullCheckTest/NullCheckTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "NullCheck.h"
 
 NullCheck handle;
 
-TEST(StatemachineTest, SimpleNullCheckTest) {
-	nullCheck_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		nullCheck_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, SimpleNullCheckTest) {					
 	nullCheck_enter(&handle);
 	EXPECT_TRUE(nullCheck_isStateActive(&handle, NullCheck_main_region_A));
 	nullCheck_runCycle(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/OperationsTest/OperationsTest.cc

@@ -8,7 +8,6 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "Operations.h"
 #include "OperationsRequired.h"
@@ -147,9 +146,14 @@ static struct {
 
 Operations handle;
 
-TEST(StatemachineTest, operationsCalled) {
-	operations_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		operations_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, operationsCalled) {					
 	alwaysTrueMock = new AlwaysTrueMock();
 	internalOperation3aMock = new InternalOperation3aMock();
 	alwaysTrueMock->setAlwaysTrueBehavior(&AlwaysTrueMock::alwaysTrue1);

+ 11 - 13
test-plugins/org.yakindu.sct.generator.c.test/gtests/OutEventLifeCycleTest/OutEventLifeCycleTest.cc

@@ -8,40 +8,38 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "OutEventLifeCycle.h"
 
 OutEventLifeCycle handle;
 
-TEST(StatemachineTest, availableAfterCycle) {
-	outEventLifeCycle_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		outEventLifeCycle_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, availableAfterCycle) {					
 	outEventLifeCycle_enter(&handle);
 	outEventLifeCycleIface_raise_e(&handle);
 	outEventLifeCycle_runCycle(&handle);
 	EXPECT_TRUE(outEventLifeCycleIface_israised_f(&handle));
 }
-TEST(StatemachineTest, availableWithinCycle) {
-	outEventLifeCycle_init(&handle);
-	
+TEST_F(StatemachineTest, availableWithinCycle) {					
 	outEventLifeCycle_enter(&handle);
 	outEventLifeCycleIface_raise_e(&handle);
 	outEventLifeCycle_runCycle(&handle);
 	EXPECT_TRUE(outEventLifeCycleIface_get_f_available_in_cycle(&handle));
 }
-TEST(StatemachineTest, unvailableWithin2ndCycle) {
-	outEventLifeCycle_init(&handle);
-	
+TEST_F(StatemachineTest, unvailableWithin2ndCycle) {					
 	outEventLifeCycle_enter(&handle);
 	outEventLifeCycleIface_raise_e(&handle);
 	outEventLifeCycle_runCycle(&handle);
 	outEventLifeCycle_runCycle(&handle);
 	EXPECT_TRUE(!outEventLifeCycleIface_get_f_available_in_next_cycle(&handle));
 }
-TEST(StatemachineTest, unvailableAfter2ndCycle) {
-	outEventLifeCycle_init(&handle);
-	
+TEST_F(StatemachineTest, unvailableAfter2ndCycle) {					
 	outEventLifeCycle_enter(&handle);
 	outEventLifeCycleIface_raise_e(&handle);
 	outEventLifeCycle_runCycle(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/ParenthesisTest/ParenthesisTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "Parenthesis.h"
 
 Parenthesis handle;
 
-TEST(StatemachineTest, simple) {
-	parenthesis_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		parenthesis_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, simple) {					
 	parenthesis_enter(&handle);
 	EXPECT_TRUE(parenthesis_isStateActive(&handle, Parenthesis_mainRegion_A));
 	EXPECT_TRUE(parenthesisIface_get_erg(&handle)== 8l);

+ 9 - 7
test-plugins/org.yakindu.sct.generator.c.test/gtests/PriorityValuesTest/PriorityValuesTest.cc

@@ -8,24 +8,26 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "PriorityValues.h"
 
 PriorityValues handle;
 
-TEST(StatemachineTest, transitionPriority) {
-	priorityValues_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		priorityValues_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, transitionPriority) {					
 	priorityValues_enter(&handle);
 	EXPECT_TRUE(priorityValues_isStateActive(&handle, PriorityValues_main_region_A));
 	priorityValuesIface_raise_event1(&handle);
 	priorityValues_runCycle(&handle);
 	EXPECT_TRUE(priorityValues_isStateActive(&handle, PriorityValues_main_region_C));
 }
-TEST(StatemachineTest, regionPriority) {
-	priorityValues_init(&handle);
-	
+TEST_F(StatemachineTest, regionPriority) {					
 	priorityValues_enter(&handle);
 	EXPECT_TRUE(priorityValues_isStateActive(&handle, PriorityValues_someRegion_A));
 	priorityValuesIface_raise_event2(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/RaiseEventTest/RaiseEventTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "RaiseEvent.h"
 
 RaiseEvent handle;
 
-TEST(StatemachineTest, raiseEvent) {
-	raiseEvent_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		raiseEvent_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, raiseEvent) {					
 	raiseEvent_enter(&handle);
 	EXPECT_TRUE(raiseEvent_isStateActive(&handle, RaiseEvent_second_region_SateA));
 	EXPECT_TRUE(raiseEvent_isStateActive(&handle, RaiseEvent_main_region_StateA));

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/ReadOnlyVariableTest/ReadOnlyVariableTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "ReadOnlyVariable.h"
 
 ReadOnlyVariable handle;
 
-TEST(StatemachineTest, ReadOnlyVariableTest) {
-	readOnlyVariable_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		readOnlyVariable_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, ReadOnlyVariableTest) {					
 	readOnlyVariable_enter(&handle);
 	EXPECT_TRUE(readOnlyVariable_isStateActive(&handle, ReadOnlyVariable_main_region_StateA));
 	EXPECT_TRUE(readOnlyVariableIface_get_myInt(&handle)== 0l);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/STextKeywordsInStatesAndRegionsTest/STextKeywordsInStatesAndRegionsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "STextKeywordsInStatesAndRegions.h"
 
 STextKeywordsInStatesAndRegions handle;
 
-TEST(StatemachineTest, activeCheckWithSTextNamedStates) {
-	sTextKeywordsInStatesAndRegions_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		sTextKeywordsInStatesAndRegions_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, activeCheckWithSTextNamedStates) {					
 	sTextKeywordsInStatesAndRegions_enter(&handle);
 	EXPECT_TRUE(sTextKeywordsInStatesAndRegions_isStateActive(&handle, STextKeywordsInStatesAndRegions_default_namespace));
 	EXPECT_TRUE(sTextKeywordsInStatesAndRegions_isStateActive(&handle, STextKeywordsInStatesAndRegions_operation_interface));

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/SameNameDifferentRegionTest/SameNameDifferentRegionTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "SameNameDifferentRegion.h"
 
 SameNameDifferentRegion handle;
 
-TEST(StatemachineTest, sameNameDifferenRegionTest) {
-	sameNameDifferentRegion_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		sameNameDifferentRegion_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, sameNameDifferenRegionTest) {					
 	sameNameDifferentRegion_enter(&handle);
 	EXPECT_TRUE(sameNameDifferentRegion_isStateActive(&handle, SameNameDifferentRegion_main_region_StateA));
 	sameNameDifferentRegionIface_raise_e1(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/ShallowHistoryTest/ShallowHistoryTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "ShallowHistory.h"
 
 ShallowHistory handle;
 
-TEST(StatemachineTest, shallowHistoryTest) {
-	shallowHistory_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		shallowHistory_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, shallowHistoryTest) {					
 	shallowHistory_enter(&handle);
 	shallowHistoryIface_raise_event1(&handle);
 	shallowHistory_runCycle(&handle);

+ 10 - 10
test-plugins/org.yakindu.sct.generator.c.test/gtests/ShallowHistoryWithDeepEntryTest/ShallowHistoryWithDeepEntryTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "ShallowHistoryWithDeepEntry.h"
 
 ShallowHistoryWithDeepEntry handle;
 
-TEST(StatemachineTest, noDeepEntryWithinHistory) {
-	shallowHistoryWithDeepEntry_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		shallowHistoryWithDeepEntry_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, noDeepEntryWithinHistory) {					
 	shallowHistoryWithDeepEntry_enter(&handle);
 	EXPECT_TRUE(shallowHistoryWithDeepEntry_isStateActive(&handle, ShallowHistoryWithDeepEntry_main_region_Y));
 	shallowHistoryWithDeepEntryIface_raise_toZ(&handle);
@@ -29,9 +33,7 @@ TEST(StatemachineTest, noDeepEntryWithinHistory) {
 	shallowHistoryWithDeepEntry_runCycle(&handle);
 	EXPECT_TRUE(shallowHistoryWithDeepEntry_isStateActive(&handle, ShallowHistoryWithDeepEntry_main_region_Z__region0_A));
 }
-TEST(StatemachineTest, deepEntryWithinHistory) {
-	shallowHistoryWithDeepEntry_init(&handle);
-	
+TEST_F(StatemachineTest, deepEntryWithinHistory) {					
 	shallowHistoryWithDeepEntry_enter(&handle);
 	EXPECT_TRUE(shallowHistoryWithDeepEntry_isStateActive(&handle, ShallowHistoryWithDeepEntry_main_region_Y));
 	shallowHistoryWithDeepEntryIface_raise_toZ(&handle);
@@ -49,9 +51,7 @@ TEST(StatemachineTest, deepEntryWithinHistory) {
 	EXPECT_TRUE(shallowHistoryWithDeepEntry_isStateActive(&handle, ShallowHistoryWithDeepEntry_main_region_Z__region0_B__region0_C));
 	EXPECT_TRUE(shallowHistoryWithDeepEntry_isStateActive(&handle, ShallowHistoryWithDeepEntry_main_region_Z__region0_B));
 }
-TEST(StatemachineTest, directDeepEntryIntoHistory) {
-	shallowHistoryWithDeepEntry_init(&handle);
-	
+TEST_F(StatemachineTest, directDeepEntryIntoHistory) {					
 	shallowHistoryWithDeepEntry_enter(&handle);
 	EXPECT_TRUE(shallowHistoryWithDeepEntry_isStateActive(&handle, ShallowHistoryWithDeepEntry_main_region_Y));
 	shallowHistoryWithDeepEntryIface_raise_toC(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/SimpleEventTest/SimpleEventTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "SimpleEvent.h"
 
 SimpleEvent handle;
 
-TEST(StatemachineTest, simpleEventTest) {
-	simpleEvent_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		simpleEvent_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, simpleEventTest) {					
 	simpleEvent_enter(&handle);
 	EXPECT_TRUE(simpleEvent_isStateActive(&handle, SimpleEvent_main_region_A)) << "Expected A to be active" ;
 	EXPECT_TRUE(5l== 5l);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/SimpleHierachyTest/SimpleHierachyTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "SimpleHierachy.h"
 
 SimpleHierachy handle;
 
-TEST(StatemachineTest, simpleHierachyTest) {
-	simpleHierachy_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		simpleHierachy_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, simpleHierachyTest) {					
 	simpleHierachy_enter(&handle);
 	EXPECT_TRUE(simpleHierachy_isStateActive(&handle, SimpleHierachy_main_region_A));
 	simpleHierachyIface_raise_event1(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/StateIsActiveTest/StateIsActiveTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "StateIsActive.h"
 
 StateIsActive handle;
 
-TEST(StatemachineTest, stateIsActive) {
-	stateIsActive_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		stateIsActive_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, stateIsActive) {					
 	stateIsActive_enter(&handle);
 	EXPECT_TRUE(stateIsActive_isStateActive(&handle, StateIsActive_R1_R1A));
 	EXPECT_TRUE(stateIsActive_isStateActive(&handle, StateIsActive_R2_R2A));

+ 11 - 13
test-plugins/org.yakindu.sct.generator.c.test/gtests/StatechartActiveTest/StatechartActiveTest.cc

@@ -8,33 +8,31 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "StatechartActive.h"
 
 StatechartActive handle;
 
-TEST(StatemachineTest, inactiveBeforeEnter) {
-	statechartActive_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		statechartActive_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, inactiveBeforeEnter) {					
 	EXPECT_TRUE(!statechartActive_isActive(&handle));
 }
-TEST(StatemachineTest, activeAfterEnter) {
-	statechartActive_init(&handle);
-	
+TEST_F(StatemachineTest, activeAfterEnter) {					
 	statechartActive_enter(&handle);
 	EXPECT_TRUE(statechartActive_isActive(&handle));
 }
-TEST(StatemachineTest, inactiveAfterExit) {
-	statechartActive_init(&handle);
-	
+TEST_F(StatemachineTest, inactiveAfterExit) {					
 	statechartActive_enter(&handle);
 	statechartActive_exit(&handle);
 	EXPECT_TRUE(!statechartActive_isActive(&handle));
 }
-TEST(StatemachineTest, activeAfterReenter) {
-	statechartActive_init(&handle);
-	
+TEST_F(StatemachineTest, activeAfterReenter) {					
 	statechartActive_enter(&handle);
 	statechartActive_exit(&handle);
 	statechartActive_enter(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/StatechartLocalReactionsTest/StatechartLocalReactionsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "StatechartLocalReactions.h"
 
 StatechartLocalReactions handle;
 
-TEST(StatemachineTest, statechartLocalReactionsTest) {
-	statechartLocalReactions_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		statechartLocalReactions_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, statechartLocalReactionsTest) {					
 	statechartLocalReactions_enter(&handle);
 	EXPECT_TRUE(statechartLocalReactions_isStateActive(&handle, StatechartLocalReactions_main_region_S1));
 	EXPECT_TRUE(statechartLocalReactions_isStateActive(&handle, StatechartLocalReactions_region2_a));

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/StatemachineKeywords/StatemachineKeywords.cc

@@ -8,16 +8,20 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "StatechartKeywords.h"
 #include "StatechartKeywordsRequired.h"
 
 StatechartKeywords handle;
 
-TEST(StatemachineTest, statemachineKeywords) {
-	statechartKeywords_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		statechartKeywords_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, statemachineKeywords) {					
 	statechartKeywords_enter(&handle);
 	EXPECT_TRUE(statechartKeywords_isStateActive(&handle, StatechartKeywords_main_region_Timer));
 }

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/StaticChoiceTest/StaticChoiceTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "StaticChoice.h"
 
 StaticChoice handle;
 
-TEST(StatemachineTest, StaticChoiceTest) {
-	staticChoice_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		staticChoice_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, StaticChoiceTest) {					
 	staticChoice_enter(&handle);
 	EXPECT_TRUE(staticChoice_isStateActive(&handle, StaticChoice_main_region_Start));
 	staticChoice_runCycle(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/StringExpressionsTest/StringExpressionsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "StringExpressions.h"
 
 StringExpressions handle;
 
-TEST(StatemachineTest, StringExpressionsTest) {
-	stringExpressions_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		stringExpressions_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, StringExpressionsTest) {					
 	EXPECT_TRUE(strcmp(stringExpressionsIface_get_quotedStringX(&handle), "\"X\"") == 0);
 	EXPECT_TRUE(strcmp(stringExpressionsIface_get_quotedStringY(&handle), "\"Y\"") == 0);
 	stringExpressions_enter(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/SyncForkTest/SyncForkTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "SyncFork.h"
 
 SyncFork handle;
 
-TEST(StatemachineTest, syncForkTest) {
-	syncFork_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		syncFork_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, syncForkTest) {					
 	syncFork_enter(&handle);
 	EXPECT_TRUE(syncFork_isStateActive(&handle, SyncFork_main_region_A));
 	syncForkIface_raise_f(&handle);

+ 10 - 10
test-plugins/org.yakindu.sct.generator.c.test/gtests/SyncJoinTest/SyncJoinTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "SyncJoin.h"
 
 SyncJoin handle;
 
-TEST(StatemachineTest, syncJoin_C2_Waits) {
-	syncJoin_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		syncJoin_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, syncJoin_C2_Waits) {					
 	syncJoin_enter(&handle);
 	EXPECT_TRUE(syncJoin_isStateActive(&handle, SyncJoin_main_region_B));
 	EXPECT_TRUE(syncJoin_isStateActive(&handle, SyncJoin_main_region_B_r1_C1));
@@ -55,9 +59,7 @@ TEST(StatemachineTest, syncJoin_C2_Waits) {
 	syncJoin_runCycle(&handle);
 	EXPECT_TRUE(syncJoin_isStateActive(&handle, SyncJoin_main_region_A));
 }
-TEST(StatemachineTest, syncJoin_D2_Waits) {
-	syncJoin_init(&handle);
-	
+TEST_F(StatemachineTest, syncJoin_D2_Waits) {					
 	syncJoin_enter(&handle);
 	EXPECT_TRUE(syncJoin_isStateActive(&handle, SyncJoin_main_region_B));
 	EXPECT_TRUE(syncJoin_isStateActive(&handle, SyncJoin_main_region_B_r1_C1));
@@ -84,9 +86,7 @@ TEST(StatemachineTest, syncJoin_D2_Waits) {
 	EXPECT_TRUE(syncJoin_isStateActive(&handle, SyncJoin_main_region_B_r1_C2));
 	EXPECT_TRUE(syncJoin_isStateActive(&handle, SyncJoin_main_region_B_r2_D2));
 }
-TEST(StatemachineTest, doubleEntryActionBug) {
-	syncJoin_init(&handle);
-	
+TEST_F(StatemachineTest, doubleEntryActionBug) {					
 	syncJoin_enter(&handle);
 	syncJoinIface_raise_e(&handle);
 	syncJoinIface_raise_f(&handle);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/TimedTransitionsTest/TimedTransitionsTest.cc

@@ -8,16 +8,20 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "TimedTransitions.h"
 #include "TimedTransitionsRequired.h"
 
 TimedTransitions handle;
 
-TEST(StatemachineTest, Timer01) {
-	timedTransitions_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		timedTransitions_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, Timer01) {					
 	timedTransitions_enter(&handle);
 	EXPECT_TRUE(timedTransitions_isStateActive(&handle, TimedTransitions_main_region_Start));
 	// here should be waited 2030 Seconds

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/TransitionWithoutConditionTest/TransitionWithoutConditionTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "TransitionWithoutCondition.h"
 
 TransitionWithoutCondition handle;
 
-TEST(StatemachineTest, TransitionWithoutConditionTest) {
-	transitionWithoutCondition_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		transitionWithoutCondition_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, TransitionWithoutConditionTest) {					
 	transitionWithoutCondition_enter(&handle);
 	EXPECT_TRUE(transitionWithoutCondition_isStateActive(&handle, TransitionWithoutCondition_main_region_A));
 	transitionWithoutCondition_runCycle(&handle);

+ 11 - 13
test-plugins/org.yakindu.sct.generator.c.test/gtests/TriggerExpressionPrecedenceTest/TriggerExpressionPrecedenceTest.cc

@@ -8,42 +8,40 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "TriggerExpressionPrecedence.h"
 
 TriggerExpressionPrecedence handle;
 
-TEST(StatemachineTest, unsatisfiedTriggerAndFGuardFalseOrFalse) {
-	triggerExpressionPrecedence_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		triggerExpressionPrecedence_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, unsatisfiedTriggerAndFGuardFalseOrFalse) {					
 	triggerExpressionPrecedence_enter(&handle);
 	triggerExpressionPrecedenceIface_set_c1(&handle,false);
 	triggerExpressionPrecedenceIface_set_c2(&handle,false);
 	triggerExpressionPrecedence_runCycle(&handle);
 	EXPECT_TRUE(!triggerExpressionPrecedenceIface_get_e1_transition(&handle));
 }
-TEST(StatemachineTest, unsatisfiedTriggerAndFGuardTrueOrFalse) {
-	triggerExpressionPrecedence_init(&handle);
-	
+TEST_F(StatemachineTest, unsatisfiedTriggerAndFGuardTrueOrFalse) {					
 	triggerExpressionPrecedence_enter(&handle);
 	triggerExpressionPrecedenceIface_set_c1(&handle,true);
 	triggerExpressionPrecedenceIface_set_c2(&handle,false);
 	triggerExpressionPrecedence_runCycle(&handle);
 	EXPECT_TRUE(!triggerExpressionPrecedenceIface_get_e1_transition(&handle));
 }
-TEST(StatemachineTest, unsatisfiedTriggerAndFGuardFalseOrTrue) {
-	triggerExpressionPrecedence_init(&handle);
-	
+TEST_F(StatemachineTest, unsatisfiedTriggerAndFGuardFalseOrTrue) {					
 	triggerExpressionPrecedence_enter(&handle);
 	triggerExpressionPrecedenceIface_set_c1(&handle,false);
 	triggerExpressionPrecedenceIface_set_c2(&handle,true);
 	triggerExpressionPrecedence_runCycle(&handle);
 	EXPECT_TRUE(!triggerExpressionPrecedenceIface_get_e1_transition(&handle));
 }
-TEST(StatemachineTest, unsatisfiedTriggerAndFGuardTrueOrTrue) {
-	triggerExpressionPrecedence_init(&handle);
-	
+TEST_F(StatemachineTest, unsatisfiedTriggerAndFGuardTrueOrTrue) {					
 	triggerExpressionPrecedence_enter(&handle);
 	triggerExpressionPrecedenceIface_set_c1(&handle,true);
 	triggerExpressionPrecedenceIface_set_c2(&handle,true);

+ 9 - 7
test-plugins/org.yakindu.sct.generator.c.test/gtests/TriggerGuardExpressionsTest/TriggerGuardExpressionsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "TriggerGuardExpressions.h"
 
 TriggerGuardExpressions handle;
 
-TEST(StatemachineTest, trueGuard) {
-	triggerGuardExpressions_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		triggerGuardExpressions_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, trueGuard) {					
 	triggerGuardExpressions_enter(&handle);
 	EXPECT_TRUE(triggerGuardExpressions_isStateActive(&handle, TriggerGuardExpressions_main_region_A));
 	triggerGuardExpressionsIface_raise_e1(&handle);
@@ -35,9 +39,7 @@ TEST(StatemachineTest, trueGuard) {
 	triggerGuardExpressions_runCycle(&handle);
 	EXPECT_TRUE(triggerGuardExpressions_isStateActive(&handle, TriggerGuardExpressions_main_region_B));
 }
-TEST(StatemachineTest, falseGuard) {
-	triggerGuardExpressions_init(&handle);
-	
+TEST_F(StatemachineTest, falseGuard) {					
 	triggerGuardExpressions_enter(&handle);
 	EXPECT_TRUE(triggerGuardExpressions_isStateActive(&handle, TriggerGuardExpressions_main_region_A));
 	triggerGuardExpressionsIface_set_b(&handle,false);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/TypeAliasTest/TypeAliasTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "TypeAlias.h"
 
 TypeAlias handle;
 
-TEST(StatemachineTest, TypeAliasTest) {
-	typeAlias_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		typeAlias_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, TypeAliasTest) {					
 	typeAlias_enter(&handle);
 	EXPECT_TRUE(typeAlias_isStateActive(&handle, TypeAlias_main_region_Start));
 	EXPECT_TRUE(typeAliasIface_get_myVar(&handle)== 1l);

+ 8 - 4
test-plugins/org.yakindu.sct.generator.c.test/gtests/ValuedEventsTest/ValuedEventsTest.cc

@@ -8,15 +8,19 @@
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
-#include <string>
 #include "gtest/gtest.h"
 #include "ValuedEvents.h"
 
 ValuedEvents handle;
 
-TEST(StatemachineTest, valuedEventsTest) {
-	valuedEvents_init(&handle);
-	
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		valuedEvents_init(&handle);
+	}
+};
+
+TEST_F(StatemachineTest, valuedEventsTest) {					
 	valuedEvents_enter(&handle);
 	valuedEvents_runCycle(&handle);
 	EXPECT_TRUE(strcmp(valuedEventsIface_get_myString(&handle), "sct") == 0);

+ 5 - 0
test-plugins/org.yakindu.sct.generator.c.test/src/org/yakindu/sct/generator/c/gtest/GMockHelper.java

@@ -14,4 +14,9 @@ public class GMockHelper extends GTestHelper {
 		command.add("-lgmock_main");
 		return command;
 	}
+	
+	@Override
+	protected String getCompilerCommand() {
+		return "g++";
+	}
 }

+ 313 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AlwaysOncycleTest/AlwaysOncycle.cpp

@@ -0,0 +1,313 @@
+
+#include "AlwaysOncycle.h"
+#include <string.h>
+
+/*! \file Implementation of the state machine 'AlwaysOncycle'
+*/
+
+AlwaysOncycle::AlwaysOncycle()
+{
+	
+	
+	stateConfVectorPosition = 0;
+	
+}
+
+AlwaysOncycle::~AlwaysOncycle()
+{
+}
+
+
+void AlwaysOncycle::init()
+{
+	for (int i = 0; i < maxOrthogonalStates; ++i)
+		stateConfVector[i] = AlwaysOncycle_last_state;
+	
+	stateConfVectorPosition = 0;
+
+	clearInEvents();
+	clearOutEvents();
+	
+	/* Default init sequence for statechart AlwaysOncycle */
+	iface.value = 0;
+	iface.v2 = false;
+}
+
+void AlwaysOncycle::enter()
+{
+	/* Default enter sequence for statechart AlwaysOncycle */
+	enseq_main_region_default();
+}
+
+void AlwaysOncycle::exit()
+{
+	/* Default exit sequence for statechart AlwaysOncycle */
+	exseq_main_region();
+}
+
+sc_boolean AlwaysOncycle::isActive() const
+{
+	return stateConfVector[0] != AlwaysOncycle_last_state;
+}
+
+/* 
+ * Always returns 'false' since this state machine can never become final.
+ */
+sc_boolean AlwaysOncycle::isFinal() const
+{
+   return false;}
+
+void AlwaysOncycle::runCycle()
+{
+	
+	clearOutEvents();
+	
+	for (stateConfVectorPosition = 0;
+		stateConfVectorPosition < maxOrthogonalStates;
+		stateConfVectorPosition++)
+		{
+			
+		switch (stateConfVector[stateConfVectorPosition])
+		{
+		case main_region_StateA :
+		{
+			react_main_region_StateA();
+			break;
+		}
+		case main_region_StateB :
+		{
+			react_main_region_StateB();
+			break;
+		}
+		default:
+			break;
+		}
+	}
+	
+	clearInEvents();
+}
+
+void AlwaysOncycle::clearInEvents()
+{
+}
+
+void AlwaysOncycle::clearOutEvents()
+{
+}
+
+
+sc_boolean AlwaysOncycle::isStateActive(AlwaysOncycleStates state) const
+{
+	switch (state)
+	{
+		case main_region_StateA : 
+			return (sc_boolean) (stateConfVector[0] == main_region_StateA
+			);
+		case main_region_StateB : 
+			return (sc_boolean) (stateConfVector[0] == main_region_StateB
+			);
+		default: return false;
+	}
+}
+
+AlwaysOncycle::DefaultSCI* AlwaysOncycle::getDefaultSCI()
+{
+	return &iface;
+}
+
+
+sc_integer AlwaysOncycle::DefaultSCI::get_value() const
+{
+	return value;
+}
+
+sc_integer AlwaysOncycle::get_value() const
+{
+	return iface.value;
+}
+
+void AlwaysOncycle::DefaultSCI::set_value(sc_integer value)
+{
+	value = value;
+}
+
+void AlwaysOncycle::set_value(sc_integer value)
+{
+	iface.value = value;
+}
+
+sc_boolean AlwaysOncycle::DefaultSCI::get_v2() const
+{
+	return v2;
+}
+
+sc_boolean AlwaysOncycle::get_v2() const
+{
+	return iface.v2;
+}
+
+void AlwaysOncycle::DefaultSCI::set_v2(sc_boolean value)
+{
+	v2 = value;
+}
+
+void AlwaysOncycle::set_v2(sc_boolean value)
+{
+	iface.v2 = value;
+}
+
+
+// implementations of all internal functions
+
+sc_boolean AlwaysOncycle::check_main_region_StateA_tr0_tr0()
+{
+	return iface.value == 5;
+}
+
+sc_boolean AlwaysOncycle::check_main_region_StateA_lr1_lr1()
+{
+	return true;
+}
+
+sc_boolean AlwaysOncycle::check_main_region_StateB_tr0_tr0()
+{
+	return iface.value == 5;
+}
+
+sc_boolean AlwaysOncycle::check_main_region_StateB_lr0_lr0()
+{
+	return true;
+}
+
+void AlwaysOncycle::effect_main_region_StateA_tr0()
+{
+	exseq_main_region_StateA();
+	enseq_main_region_StateB_default();
+}
+
+void AlwaysOncycle::effect_main_region_StateA_lr1_lr1()
+{
+	iface.value += 1;
+}
+
+void AlwaysOncycle::effect_main_region_StateB_tr0()
+{
+	exseq_main_region_StateB();
+	enseq_main_region_StateA_default();
+}
+
+void AlwaysOncycle::effect_main_region_StateB_lr0_lr0()
+{
+	iface.value += 1;
+}
+
+/* Entry action for state 'StateA'. */
+void AlwaysOncycle::enact_main_region_StateA()
+{
+	/* Entry action for state 'StateA'. */
+	iface.value = 0;
+}
+
+/* Exit action for state 'StateA'. */
+void AlwaysOncycle::exact_main_region_StateA()
+{
+	/* Exit action for state 'StateA'. */
+	iface.value = 0;
+}
+
+/* 'default' enter sequence for state StateA */
+void AlwaysOncycle::enseq_main_region_StateA_default()
+{
+	/* 'default' enter sequence for state StateA */
+	enact_main_region_StateA();
+	stateConfVector[0] = main_region_StateA;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for state StateB */
+void AlwaysOncycle::enseq_main_region_StateB_default()
+{
+	/* 'default' enter sequence for state StateB */
+	stateConfVector[0] = main_region_StateB;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for region main region */
+void AlwaysOncycle::enseq_main_region_default()
+{
+	/* 'default' enter sequence for region main region */
+	react_main_region__entry_Default();
+}
+
+/* Default exit sequence for state StateA */
+void AlwaysOncycle::exseq_main_region_StateA()
+{
+	/* Default exit sequence for state StateA */
+	stateConfVector[0] = AlwaysOncycle_last_state;
+	stateConfVectorPosition = 0;
+	exact_main_region_StateA();
+}
+
+/* Default exit sequence for state StateB */
+void AlwaysOncycle::exseq_main_region_StateB()
+{
+	/* Default exit sequence for state StateB */
+	stateConfVector[0] = AlwaysOncycle_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for region main region */
+void AlwaysOncycle::exseq_main_region()
+{
+	/* Default exit sequence for region main region */
+	/* Handle exit of all possible states (of AlwaysOncycle.main_region) at position 0... */
+	switch(stateConfVector[ 0 ])
+	{
+		case main_region_StateA :
+		{
+			exseq_main_region_StateA();
+			break;
+		}
+		case main_region_StateB :
+		{
+			exseq_main_region_StateB();
+			break;
+		}
+		default: break;
+	}
+}
+
+/* The reactions of state StateA. */
+void AlwaysOncycle::react_main_region_StateA()
+{
+	/* The reactions of state StateA. */
+	if (check_main_region_StateA_tr0_tr0())
+	{ 
+		effect_main_region_StateA_tr0();
+	}  else
+	{
+		effect_main_region_StateA_lr1_lr1();
+	}
+}
+
+/* The reactions of state StateB. */
+void AlwaysOncycle::react_main_region_StateB()
+{
+	/* The reactions of state StateB. */
+	if (check_main_region_StateB_tr0_tr0())
+	{ 
+		effect_main_region_StateB_tr0();
+	}  else
+	{
+		effect_main_region_StateB_lr0_lr0();
+	}
+}
+
+/* Default react sequence for initial entry  */
+void AlwaysOncycle::react_main_region__entry_Default()
+{
+	/* Default react sequence for initial entry  */
+	enseq_main_region_StateA_default();
+}
+
+

+ 135 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AlwaysOncycleTest/AlwaysOncycle.h

@@ -0,0 +1,135 @@
+
+#ifndef ALWAYSONCYCLE_H_
+#define ALWAYSONCYCLE_H_
+
+#include "sc_types.h"
+#include "StatemachineInterface.h"
+
+/*! \file Header of the state machine 'AlwaysOncycle'.
+*/
+
+class AlwaysOncycle : public StatemachineInterface
+{
+	
+	public:
+		
+		AlwaysOncycle();
+		
+		~AlwaysOncycle();
+		
+		/*! Enumeration of all states */ 
+		typedef enum
+		{
+			main_region_StateA,
+			main_region_StateB,
+			AlwaysOncycle_last_state
+		} AlwaysOncycleStates;
+		
+		//! Inner class for default interface scope.
+		class DefaultSCI
+		{
+			
+			public:
+				/*! Gets the value of the variable 'value' that is defined in the default interface scope. */
+				sc_integer get_value() const;
+				
+				/*! Sets the value of the variable 'value' that is defined in the default interface scope. */
+				void set_value(sc_integer value);
+				
+				/*! Gets the value of the variable 'v2' that is defined in the default interface scope. */
+				sc_boolean get_v2() const;
+				
+				/*! Sets the value of the variable 'v2' that is defined in the default interface scope. */
+				void set_v2(sc_boolean value);
+				
+				
+			private:
+				friend class AlwaysOncycle;
+				sc_integer value;
+				sc_boolean v2;
+		};
+				
+		
+		/*! Returns an instance of the interface class 'DefaultSCI'. */
+		DefaultSCI* getDefaultSCI();
+		
+		/*! Gets the value of the variable 'value' that is defined in the default interface scope. */
+		sc_integer get_value() const;
+		
+		/*! Sets the value of the variable 'value' that is defined in the default interface scope. */
+		void set_value(sc_integer value);
+		
+		/*! Gets the value of the variable 'v2' that is defined in the default interface scope. */
+		sc_boolean get_v2() const;
+		
+		/*! Sets the value of the variable 'v2' that is defined in the default interface scope. */
+		void set_v2(sc_boolean value);
+		
+		
+		/*
+		 * Functions inherited from StatemachineInterface
+		 */
+		virtual void init();
+		
+		virtual void enter();
+		
+		virtual void exit();
+		
+		virtual void runCycle();
+		
+		/*!
+		* Checks if the state machine is active (until 2.4.1 this method was used for states).
+		* A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+		*/
+		virtual sc_boolean isActive() const;
+		
+		
+		/*!
+		* Checks if all active states are final. 
+		* If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+		*/
+		virtual sc_boolean isFinal() const;
+		
+		
+		/*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
+		sc_boolean isStateActive(AlwaysOncycleStates state) const;
+	
+	private:
+	
+	
+		//! the maximum number of orthogonal states defines the dimension of the state configuration vector.
+		static const sc_integer maxOrthogonalStates = 1;
+		
+		
+		AlwaysOncycleStates stateConfVector[maxOrthogonalStates];
+		
+		sc_ushort stateConfVectorPosition;
+		
+		DefaultSCI iface;
+		
+		// prototypes of all internal functions
+		
+		sc_boolean check_main_region_StateA_tr0_tr0();
+		sc_boolean check_main_region_StateA_lr1_lr1();
+		sc_boolean check_main_region_StateB_tr0_tr0();
+		sc_boolean check_main_region_StateB_lr0_lr0();
+		void effect_main_region_StateA_tr0();
+		void effect_main_region_StateA_lr1_lr1();
+		void effect_main_region_StateB_tr0();
+		void effect_main_region_StateB_lr0_lr0();
+		void enact_main_region_StateA();
+		void exact_main_region_StateA();
+		void enseq_main_region_StateA_default();
+		void enseq_main_region_StateB_default();
+		void enseq_main_region_default();
+		void exseq_main_region_StateA();
+		void exseq_main_region_StateB();
+		void exseq_main_region();
+		void react_main_region_StateA();
+		void react_main_region_StateB();
+		void react_main_region__entry_Default();
+		void clearInEvents();
+		void clearOutEvents();
+		
+};
+#endif /* ALWAYSONCYCLE_H_ */

+ 25 - 5
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AlwaysOncycleTest/AlwaysOncycleTest.cc

@@ -1,5 +1,5 @@
 /**
-* Copyright (c) 2016 committers of YAKINDU and others.
+* Copyright (c) 2017 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
@@ -11,23 +11,43 @@
 #include <string>
 #include "gtest/gtest.h"
 #include "AlwaysOncycle.h"
+#include "sc_types.h"
+AlwaysOncycle* statechart;
 
-TEST(StatemachineTest, alwaysOncycleTest) {
-	AlwaysOncycle* statechart = new AlwaysOncycle();
-	statechart->init();
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		statechart = new AlwaysOncycle();
+		statechart->init();
+	}
+	virtual void TearDown() {
+		delete statechart;
+	}
+};
+
+TEST_F(StatemachineTest, alwaysOncycleTest) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->isStateActive(AlwaysOncycle::main_region_StateA));
+	
 	while (statechart->getDefaultSCI()->get_value()< 5l) {
 		statechart->runCycle();
 		EXPECT_TRUE(statechart->isStateActive(AlwaysOncycle::main_region_StateA));
 	}
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(AlwaysOncycle::main_region_StateB));
+	
 	while (statechart->getDefaultSCI()->get_value()< 5l) {
 		statechart->runCycle();
 		EXPECT_TRUE(statechart->isStateActive(AlwaysOncycle::main_region_StateB));
 	}
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(AlwaysOncycle::main_region_StateA));
-	delete statechart;
+	
 }

+ 42 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AlwaysOncycleTest/StatemachineInterface.h

@@ -0,0 +1,42 @@
+
+#ifndef STATEMACHINEINTERFACE_H_
+#define STATEMACHINEINTERFACE_H_
+
+/*! \file Basic interface for state machines.
+ */
+class StatemachineInterface
+{
+	public:
+	
+		virtual ~StatemachineInterface() = 0;
+		
+		/*! Initializes the state machine. Used to initialize internal variables etc.
+		*/
+		virtual void init() = 0;
+	
+		/*! Enters the state machine. Sets the state machine into a defined state.
+		*/
+		virtual void enter() = 0;
+	
+		/*! Exits the state machine. Leaves the state machine with a defined state.
+		*/
+		virtual void exit() = 0;
+	
+		/*! Start a run-to-completion cycle.
+		*/
+		virtual void runCycle() = 0;
+		
+		/*! Checks whether the state machine is active. 
+	 	    A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+	 	*/	
+		virtual	sc_boolean isActive() const = 0;
+		
+		/*! Checks if all active states are final. 
+	 		If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+	 	*/
+		virtual sc_boolean isFinal() const = 0;
+};
+
+inline StatemachineInterface::~StatemachineInterface() {}
+
+#endif /* STATEMACHINEINTERFACE_H_ */

+ 24 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AlwaysOncycleTest/sc_types.h

@@ -0,0 +1,24 @@
+
+#ifndef SC_TYPES_H_
+#define SC_TYPES_H_
+
+/* As <cstdint> is not available on all platforms we choose to include <stdint.h>. You can switch to <cstdint> by commenting and uncommenting the lines below.*/
+// #include <cstdint>
+#include <stdint.h>
+
+
+#define sc_string      char*
+
+typedef int_fast16_t   sc_short;
+typedef uint_fast16_t  sc_ushort;
+typedef int32_t        sc_integer;
+typedef double         sc_real;
+typedef bool           sc_boolean;
+
+typedef intptr_t       sc_eventid;
+
+#ifndef null
+	#define null 0
+#endif
+
+#endif /* SC_TYPES_H_ */

File diff suppressed because it is too large
+ 1096 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AssignmentAsExpressionTest/AssignmentAsExpression.cpp


+ 451 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AssignmentAsExpressionTest/AssignmentAsExpression.h

@@ -0,0 +1,451 @@
+
+#ifndef ASSIGNMENTASEXPRESSION_H_
+#define ASSIGNMENTASEXPRESSION_H_
+
+#include "sc_types.h"
+#include "StatemachineInterface.h"
+
+/*! \file Header of the state machine 'AssignmentAsExpression'.
+*/
+
+class AssignmentAsExpression : public StatemachineInterface
+{
+	
+	public:
+		
+		AssignmentAsExpression();
+		
+		~AssignmentAsExpression();
+		
+		/*! Enumeration of all states */ 
+		typedef enum
+		{
+			main_region_Add,
+			main_region_Multiply,
+			main_region_Divide,
+			main_region_Modulo,
+			main_region_Shift,
+			main_region_boolean_And,
+			main_region_boolean_Or,
+			main_region_boolean_Xor,
+			main_region_Subtract,
+			AssignmentAsExpression_last_state
+		} AssignmentAsExpressionStates;
+		
+		//! Inner class for default interface scope.
+		class DefaultSCI
+		{
+			
+			public:
+				/*! Gets the value of the variable 'a' that is defined in the default interface scope. */
+				sc_integer get_a() const;
+				
+				/*! Sets the value of the variable 'a' that is defined in the default interface scope. */
+				void set_a(sc_integer value);
+				
+				/*! Gets the value of the variable 'b' that is defined in the default interface scope. */
+				sc_integer get_b() const;
+				
+				/*! Sets the value of the variable 'b' that is defined in the default interface scope. */
+				void set_b(sc_integer value);
+				
+				/*! Gets the value of the variable 'c' that is defined in the default interface scope. */
+				sc_integer get_c() const;
+				
+				/*! Sets the value of the variable 'c' that is defined in the default interface scope. */
+				void set_c(sc_integer value);
+				
+				/*! Gets the value of the variable 'd' that is defined in the default interface scope. */
+				sc_integer get_d() const;
+				
+				/*! Sets the value of the variable 'd' that is defined in the default interface scope. */
+				void set_d(sc_integer value);
+				
+				/*! Gets the value of the variable 'e' that is defined in the default interface scope. */
+				sc_integer get_e() const;
+				
+				/*! Sets the value of the variable 'e' that is defined in the default interface scope. */
+				void set_e(sc_integer value);
+				
+				/*! Gets the value of the variable 'f' that is defined in the default interface scope. */
+				sc_integer get_f() const;
+				
+				/*! Sets the value of the variable 'f' that is defined in the default interface scope. */
+				void set_f(sc_integer value);
+				
+				/*! Gets the value of the variable 'g' that is defined in the default interface scope. */
+				sc_integer get_g() const;
+				
+				/*! Sets the value of the variable 'g' that is defined in the default interface scope. */
+				void set_g(sc_integer value);
+				
+				/*! Gets the value of the variable 'h' that is defined in the default interface scope. */
+				sc_integer get_h() const;
+				
+				/*! Sets the value of the variable 'h' that is defined in the default interface scope. */
+				void set_h(sc_integer value);
+				
+				/*! Gets the value of the variable 'i' that is defined in the default interface scope. */
+				sc_integer get_i() const;
+				
+				/*! Sets the value of the variable 'i' that is defined in the default interface scope. */
+				void set_i(sc_integer value);
+				
+				/*! Gets the value of the variable 'i1' that is defined in the default interface scope. */
+				sc_integer get_i1() const;
+				
+				/*! Sets the value of the variable 'i1' that is defined in the default interface scope. */
+				void set_i1(sc_integer value);
+				
+				/*! Gets the value of the variable 'j' that is defined in the default interface scope. */
+				sc_integer get_j() const;
+				
+				/*! Sets the value of the variable 'j' that is defined in the default interface scope. */
+				void set_j(sc_integer value);
+				
+				/*! Gets the value of the variable 'j1' that is defined in the default interface scope. */
+				sc_integer get_j1() const;
+				
+				/*! Sets the value of the variable 'j1' that is defined in the default interface scope. */
+				void set_j1(sc_integer value);
+				
+				/*! Gets the value of the variable 'k' that is defined in the default interface scope. */
+				sc_integer get_k() const;
+				
+				/*! Sets the value of the variable 'k' that is defined in the default interface scope. */
+				void set_k(sc_integer value);
+				
+				/*! Gets the value of the variable 'k1' that is defined in the default interface scope. */
+				sc_integer get_k1() const;
+				
+				/*! Sets the value of the variable 'k1' that is defined in the default interface scope. */
+				void set_k1(sc_integer value);
+				
+				/*! Gets the value of the variable 'l' that is defined in the default interface scope. */
+				sc_integer get_l() const;
+				
+				/*! Sets the value of the variable 'l' that is defined in the default interface scope. */
+				void set_l(sc_integer value);
+				
+				/*! Gets the value of the variable 'm' that is defined in the default interface scope. */
+				sc_integer get_m() const;
+				
+				/*! Sets the value of the variable 'm' that is defined in the default interface scope. */
+				void set_m(sc_integer value);
+				
+				/*! Gets the value of the variable 'n' that is defined in the default interface scope. */
+				sc_integer get_n() const;
+				
+				/*! Sets the value of the variable 'n' that is defined in the default interface scope. */
+				void set_n(sc_integer value);
+				
+				/*! Gets the value of the variable 'p' that is defined in the default interface scope. */
+				sc_integer get_p() const;
+				
+				/*! Sets the value of the variable 'p' that is defined in the default interface scope. */
+				void set_p(sc_integer value);
+				
+				/*! Gets the value of the variable 'r' that is defined in the default interface scope. */
+				sc_integer get_r() const;
+				
+				/*! Sets the value of the variable 'r' that is defined in the default interface scope. */
+				void set_r(sc_integer value);
+				
+				/*! Gets the value of the variable 't' that is defined in the default interface scope. */
+				sc_integer get_t() const;
+				
+				/*! Sets the value of the variable 't' that is defined in the default interface scope. */
+				void set_t(sc_integer value);
+				
+				/*! Gets the value of the variable 'u' that is defined in the default interface scope. */
+				sc_integer get_u() const;
+				
+				/*! Sets the value of the variable 'u' that is defined in the default interface scope. */
+				void set_u(sc_integer value);
+				
+				/*! Gets the value of the variable 'v' that is defined in the default interface scope. */
+				sc_integer get_v() const;
+				
+				/*! Sets the value of the variable 'v' that is defined in the default interface scope. */
+				void set_v(sc_integer value);
+				
+				/*! Gets the value of the variable 'w' that is defined in the default interface scope. */
+				sc_integer get_w() const;
+				
+				/*! Sets the value of the variable 'w' that is defined in the default interface scope. */
+				void set_w(sc_integer value);
+				
+				
+			private:
+				friend class AssignmentAsExpression;
+				sc_integer a;
+				sc_integer b;
+				sc_integer c;
+				sc_integer d;
+				sc_integer e;
+				sc_integer f;
+				sc_integer g;
+				sc_integer h;
+				sc_integer i;
+				sc_integer i1;
+				sc_integer j;
+				sc_integer j1;
+				sc_integer k;
+				sc_integer k1;
+				sc_integer l;
+				sc_integer m;
+				sc_integer n;
+				sc_integer p;
+				sc_integer r;
+				sc_integer t;
+				sc_integer u;
+				sc_integer v;
+				sc_integer w;
+		};
+				
+		
+		/*! Returns an instance of the interface class 'DefaultSCI'. */
+		DefaultSCI* getDefaultSCI();
+		
+		/*! Gets the value of the variable 'a' that is defined in the default interface scope. */
+		sc_integer get_a() const;
+		
+		/*! Sets the value of the variable 'a' that is defined in the default interface scope. */
+		void set_a(sc_integer value);
+		
+		/*! Gets the value of the variable 'b' that is defined in the default interface scope. */
+		sc_integer get_b() const;
+		
+		/*! Sets the value of the variable 'b' that is defined in the default interface scope. */
+		void set_b(sc_integer value);
+		
+		/*! Gets the value of the variable 'c' that is defined in the default interface scope. */
+		sc_integer get_c() const;
+		
+		/*! Sets the value of the variable 'c' that is defined in the default interface scope. */
+		void set_c(sc_integer value);
+		
+		/*! Gets the value of the variable 'd' that is defined in the default interface scope. */
+		sc_integer get_d() const;
+		
+		/*! Sets the value of the variable 'd' that is defined in the default interface scope. */
+		void set_d(sc_integer value);
+		
+		/*! Gets the value of the variable 'e' that is defined in the default interface scope. */
+		sc_integer get_e() const;
+		
+		/*! Sets the value of the variable 'e' that is defined in the default interface scope. */
+		void set_e(sc_integer value);
+		
+		/*! Gets the value of the variable 'f' that is defined in the default interface scope. */
+		sc_integer get_f() const;
+		
+		/*! Sets the value of the variable 'f' that is defined in the default interface scope. */
+		void set_f(sc_integer value);
+		
+		/*! Gets the value of the variable 'g' that is defined in the default interface scope. */
+		sc_integer get_g() const;
+		
+		/*! Sets the value of the variable 'g' that is defined in the default interface scope. */
+		void set_g(sc_integer value);
+		
+		/*! Gets the value of the variable 'h' that is defined in the default interface scope. */
+		sc_integer get_h() const;
+		
+		/*! Sets the value of the variable 'h' that is defined in the default interface scope. */
+		void set_h(sc_integer value);
+		
+		/*! Gets the value of the variable 'i' that is defined in the default interface scope. */
+		sc_integer get_i() const;
+		
+		/*! Sets the value of the variable 'i' that is defined in the default interface scope. */
+		void set_i(sc_integer value);
+		
+		/*! Gets the value of the variable 'i1' that is defined in the default interface scope. */
+		sc_integer get_i1() const;
+		
+		/*! Sets the value of the variable 'i1' that is defined in the default interface scope. */
+		void set_i1(sc_integer value);
+		
+		/*! Gets the value of the variable 'j' that is defined in the default interface scope. */
+		sc_integer get_j() const;
+		
+		/*! Sets the value of the variable 'j' that is defined in the default interface scope. */
+		void set_j(sc_integer value);
+		
+		/*! Gets the value of the variable 'j1' that is defined in the default interface scope. */
+		sc_integer get_j1() const;
+		
+		/*! Sets the value of the variable 'j1' that is defined in the default interface scope. */
+		void set_j1(sc_integer value);
+		
+		/*! Gets the value of the variable 'k' that is defined in the default interface scope. */
+		sc_integer get_k() const;
+		
+		/*! Sets the value of the variable 'k' that is defined in the default interface scope. */
+		void set_k(sc_integer value);
+		
+		/*! Gets the value of the variable 'k1' that is defined in the default interface scope. */
+		sc_integer get_k1() const;
+		
+		/*! Sets the value of the variable 'k1' that is defined in the default interface scope. */
+		void set_k1(sc_integer value);
+		
+		/*! Gets the value of the variable 'l' that is defined in the default interface scope. */
+		sc_integer get_l() const;
+		
+		/*! Sets the value of the variable 'l' that is defined in the default interface scope. */
+		void set_l(sc_integer value);
+		
+		/*! Gets the value of the variable 'm' that is defined in the default interface scope. */
+		sc_integer get_m() const;
+		
+		/*! Sets the value of the variable 'm' that is defined in the default interface scope. */
+		void set_m(sc_integer value);
+		
+		/*! Gets the value of the variable 'n' that is defined in the default interface scope. */
+		sc_integer get_n() const;
+		
+		/*! Sets the value of the variable 'n' that is defined in the default interface scope. */
+		void set_n(sc_integer value);
+		
+		/*! Gets the value of the variable 'p' that is defined in the default interface scope. */
+		sc_integer get_p() const;
+		
+		/*! Sets the value of the variable 'p' that is defined in the default interface scope. */
+		void set_p(sc_integer value);
+		
+		/*! Gets the value of the variable 'r' that is defined in the default interface scope. */
+		sc_integer get_r() const;
+		
+		/*! Sets the value of the variable 'r' that is defined in the default interface scope. */
+		void set_r(sc_integer value);
+		
+		/*! Gets the value of the variable 't' that is defined in the default interface scope. */
+		sc_integer get_t() const;
+		
+		/*! Sets the value of the variable 't' that is defined in the default interface scope. */
+		void set_t(sc_integer value);
+		
+		/*! Gets the value of the variable 'u' that is defined in the default interface scope. */
+		sc_integer get_u() const;
+		
+		/*! Sets the value of the variable 'u' that is defined in the default interface scope. */
+		void set_u(sc_integer value);
+		
+		/*! Gets the value of the variable 'v' that is defined in the default interface scope. */
+		sc_integer get_v() const;
+		
+		/*! Sets the value of the variable 'v' that is defined in the default interface scope. */
+		void set_v(sc_integer value);
+		
+		/*! Gets the value of the variable 'w' that is defined in the default interface scope. */
+		sc_integer get_w() const;
+		
+		/*! Sets the value of the variable 'w' that is defined in the default interface scope. */
+		void set_w(sc_integer value);
+		
+		
+		/*
+		 * Functions inherited from StatemachineInterface
+		 */
+		virtual void init();
+		
+		virtual void enter();
+		
+		virtual void exit();
+		
+		virtual void runCycle();
+		
+		/*!
+		* Checks if the state machine is active (until 2.4.1 this method was used for states).
+		* A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+		*/
+		virtual sc_boolean isActive() const;
+		
+		
+		/*!
+		* Checks if all active states are final. 
+		* If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+		*/
+		virtual sc_boolean isFinal() const;
+		
+		
+		/*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
+		sc_boolean isStateActive(AssignmentAsExpressionStates state) const;
+	
+	private:
+	
+	
+		//! the maximum number of orthogonal states defines the dimension of the state configuration vector.
+		static const sc_integer maxOrthogonalStates = 1;
+		
+		
+		AssignmentAsExpressionStates stateConfVector[maxOrthogonalStates];
+		
+		sc_ushort stateConfVectorPosition;
+		
+		DefaultSCI iface;
+		
+		// prototypes of all internal functions
+		
+		sc_boolean check_main_region_Add_tr0_tr0();
+		sc_boolean check_main_region_Multiply_tr0_tr0();
+		sc_boolean check_main_region_Divide_tr0_tr0();
+		sc_boolean check_main_region_Modulo_tr0_tr0();
+		sc_boolean check_main_region_Shift_tr0_tr0();
+		sc_boolean check_main_region_boolean_And_tr0_tr0();
+		sc_boolean check_main_region_boolean_Or_tr0_tr0();
+		sc_boolean check_main_region_Subtract_tr0_tr0();
+		void effect_main_region_Add_tr0();
+		void effect_main_region_Multiply_tr0();
+		void effect_main_region_Divide_tr0();
+		void effect_main_region_Modulo_tr0();
+		void effect_main_region_Shift_tr0();
+		void effect_main_region_boolean_And_tr0();
+		void effect_main_region_boolean_Or_tr0();
+		void effect_main_region_Subtract_tr0();
+		void enact_main_region_Add();
+		void enact_main_region_Multiply();
+		void enact_main_region_Divide();
+		void enact_main_region_Modulo();
+		void enact_main_region_Shift();
+		void enact_main_region_boolean_And();
+		void enact_main_region_boolean_Or();
+		void enact_main_region_boolean_Xor();
+		void enact_main_region_Subtract();
+		void enseq_main_region_Add_default();
+		void enseq_main_region_Multiply_default();
+		void enseq_main_region_Divide_default();
+		void enseq_main_region_Modulo_default();
+		void enseq_main_region_Shift_default();
+		void enseq_main_region_boolean_And_default();
+		void enseq_main_region_boolean_Or_default();
+		void enseq_main_region_boolean_Xor_default();
+		void enseq_main_region_Subtract_default();
+		void enseq_main_region_default();
+		void exseq_main_region_Add();
+		void exseq_main_region_Multiply();
+		void exseq_main_region_Divide();
+		void exseq_main_region_Modulo();
+		void exseq_main_region_Shift();
+		void exseq_main_region_boolean_And();
+		void exseq_main_region_boolean_Or();
+		void exseq_main_region_boolean_Xor();
+		void exseq_main_region_Subtract();
+		void exseq_main_region();
+		void react_main_region_Add();
+		void react_main_region_Multiply();
+		void react_main_region_Divide();
+		void react_main_region_Modulo();
+		void react_main_region_Shift();
+		void react_main_region_boolean_And();
+		void react_main_region_boolean_Or();
+		void react_main_region_boolean_Xor();
+		void react_main_region_Subtract();
+		void react_main_region__entry_Default();
+		void clearInEvents();
+		void clearOutEvents();
+		
+};
+#endif /* ASSIGNMENTASEXPRESSION_H_ */

+ 47 - 5
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AssignmentAsExpressionTest/AssignmentAsExpressionTest.cc

@@ -1,5 +1,5 @@
 /**
-* Copyright (c) 2016 committers of YAKINDU and others.
+* Copyright (c) 2017 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
@@ -11,39 +11,81 @@
 #include <string>
 #include "gtest/gtest.h"
 #include "AssignmentAsExpression.h"
+#include "sc_types.h"
+AssignmentAsExpression* statechart;
 
-TEST(StatemachineTest, simpleAssignment) {
-	AssignmentAsExpression* statechart = new AssignmentAsExpression();
-	statechart->init();
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		statechart = new AssignmentAsExpression();
+		statechart->init();
+	}
+	virtual void TearDown() {
+		delete statechart;
+	}
+};
+
+TEST_F(StatemachineTest, simpleAssignment) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->isStateActive(AssignmentAsExpression::main_region_Add));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_b()== 5l);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_a()== 9l);
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(AssignmentAsExpression::main_region_Subtract));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_d()== 6l);
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(AssignmentAsExpression::main_region_Multiply));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_e()== 15l);
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(AssignmentAsExpression::main_region_Divide));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_g()== 1l);
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(AssignmentAsExpression::main_region_Modulo));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_i()== 1l);
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(AssignmentAsExpression::main_region_Shift));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_j()== 16l);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_k()== 4l);
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(AssignmentAsExpression::main_region_boolean_And));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_l()== 1l);
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(AssignmentAsExpression::main_region_boolean_Or));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_p()== 15l);
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(AssignmentAsExpression::main_region_boolean_Xor));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_u()== 12l);
+	
 	statechart->exit();
-	delete statechart;
+	
 }

+ 42 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AssignmentAsExpressionTest/StatemachineInterface.h

@@ -0,0 +1,42 @@
+
+#ifndef STATEMACHINEINTERFACE_H_
+#define STATEMACHINEINTERFACE_H_
+
+/*! \file Basic interface for state machines.
+ */
+class StatemachineInterface
+{
+	public:
+	
+		virtual ~StatemachineInterface() = 0;
+		
+		/*! Initializes the state machine. Used to initialize internal variables etc.
+		*/
+		virtual void init() = 0;
+	
+		/*! Enters the state machine. Sets the state machine into a defined state.
+		*/
+		virtual void enter() = 0;
+	
+		/*! Exits the state machine. Leaves the state machine with a defined state.
+		*/
+		virtual void exit() = 0;
+	
+		/*! Start a run-to-completion cycle.
+		*/
+		virtual void runCycle() = 0;
+		
+		/*! Checks whether the state machine is active. 
+	 	    A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+	 	*/	
+		virtual	sc_boolean isActive() const = 0;
+		
+		/*! Checks if all active states are final. 
+	 		If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+	 	*/
+		virtual sc_boolean isFinal() const = 0;
+};
+
+inline StatemachineInterface::~StatemachineInterface() {}
+
+#endif /* STATEMACHINEINTERFACE_H_ */

+ 24 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AssignmentAsExpressionTest/sc_types.h

@@ -0,0 +1,24 @@
+
+#ifndef SC_TYPES_H_
+#define SC_TYPES_H_
+
+/* As <cstdint> is not available on all platforms we choose to include <stdint.h>. You can switch to <cstdint> by commenting and uncommenting the lines below.*/
+// #include <cstdint>
+#include <stdint.h>
+
+
+#define sc_string      char*
+
+typedef int_fast16_t   sc_short;
+typedef uint_fast16_t  sc_ushort;
+typedef int32_t        sc_integer;
+typedef double         sc_real;
+typedef bool           sc_boolean;
+
+typedef intptr_t       sc_eventid;
+
+#ifndef null
+	#define null 0
+#endif
+
+#endif /* SC_TYPES_H_ */

+ 415 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BitExpressionsTest/BitExpressions.cpp

@@ -0,0 +1,415 @@
+
+#include "BitExpressions.h"
+#include <string.h>
+
+/*! \file Implementation of the state machine 'BitExpressions'
+*/
+
+BitExpressions::BitExpressions()
+{
+	
+	
+	stateConfVectorPosition = 0;
+	
+}
+
+BitExpressions::~BitExpressions()
+{
+}
+
+
+void BitExpressions::init()
+{
+	for (int i = 0; i < maxOrthogonalStates; ++i)
+		stateConfVector[i] = BitExpressions_last_state;
+	
+	stateConfVectorPosition = 0;
+
+	clearInEvents();
+	clearOutEvents();
+	
+	/* Default init sequence for statechart BitExpressions */
+	iface.myBit1 = 0;
+	iface.myBit2 = 0;
+	iface.leftBitshift = 0;
+	iface.rightBitshift = 0;
+	iface.complementBitshift = 0;
+	iface.bitwiseAnd = 0;
+	iface.bitwiseOr = 0;
+	iface.bitwiseXor = 0;
+}
+
+void BitExpressions::enter()
+{
+	/* Default enter sequence for statechart BitExpressions */
+	enseq_main_region_default();
+}
+
+void BitExpressions::exit()
+{
+	/* Default exit sequence for statechart BitExpressions */
+	exseq_main_region();
+}
+
+sc_boolean BitExpressions::isActive() const
+{
+	return stateConfVector[0] != BitExpressions_last_state;
+}
+
+/* 
+ * Always returns 'false' since this state machine can never become final.
+ */
+sc_boolean BitExpressions::isFinal() const
+{
+   return false;}
+
+void BitExpressions::runCycle()
+{
+	
+	clearOutEvents();
+	
+	for (stateConfVectorPosition = 0;
+		stateConfVectorPosition < maxOrthogonalStates;
+		stateConfVectorPosition++)
+		{
+			
+		switch (stateConfVector[stateConfVectorPosition])
+		{
+		case main_region_StateA :
+		{
+			react_main_region_StateA();
+			break;
+		}
+		case main_region_StateB :
+		{
+			react_main_region_StateB();
+			break;
+		}
+		default:
+			break;
+		}
+	}
+	
+	clearInEvents();
+}
+
+void BitExpressions::clearInEvents()
+{
+	iface.e1_raised = false;
+}
+
+void BitExpressions::clearOutEvents()
+{
+}
+
+
+sc_boolean BitExpressions::isStateActive(BitExpressionsStates state) const
+{
+	switch (state)
+	{
+		case main_region_StateA : 
+			return (sc_boolean) (stateConfVector[0] == main_region_StateA
+			);
+		case main_region_StateB : 
+			return (sc_boolean) (stateConfVector[0] == main_region_StateB
+			);
+		default: return false;
+	}
+}
+
+BitExpressions::DefaultSCI* BitExpressions::getDefaultSCI()
+{
+	return &iface;
+}
+
+void BitExpressions::DefaultSCI::raise_e1()
+{
+	e1_raised = true;
+}
+
+void BitExpressions::raise_e1()
+{
+	iface.raise_e1();
+}
+
+
+sc_integer BitExpressions::DefaultSCI::get_myBit1() const
+{
+	return myBit1;
+}
+
+sc_integer BitExpressions::get_myBit1() const
+{
+	return iface.myBit1;
+}
+
+void BitExpressions::DefaultSCI::set_myBit1(sc_integer value)
+{
+	myBit1 = value;
+}
+
+void BitExpressions::set_myBit1(sc_integer value)
+{
+	iface.myBit1 = value;
+}
+
+sc_integer BitExpressions::DefaultSCI::get_myBit2() const
+{
+	return myBit2;
+}
+
+sc_integer BitExpressions::get_myBit2() const
+{
+	return iface.myBit2;
+}
+
+void BitExpressions::DefaultSCI::set_myBit2(sc_integer value)
+{
+	myBit2 = value;
+}
+
+void BitExpressions::set_myBit2(sc_integer value)
+{
+	iface.myBit2 = value;
+}
+
+sc_integer BitExpressions::DefaultSCI::get_leftBitshift() const
+{
+	return leftBitshift;
+}
+
+sc_integer BitExpressions::get_leftBitshift() const
+{
+	return iface.leftBitshift;
+}
+
+void BitExpressions::DefaultSCI::set_leftBitshift(sc_integer value)
+{
+	leftBitshift = value;
+}
+
+void BitExpressions::set_leftBitshift(sc_integer value)
+{
+	iface.leftBitshift = value;
+}
+
+sc_integer BitExpressions::DefaultSCI::get_rightBitshift() const
+{
+	return rightBitshift;
+}
+
+sc_integer BitExpressions::get_rightBitshift() const
+{
+	return iface.rightBitshift;
+}
+
+void BitExpressions::DefaultSCI::set_rightBitshift(sc_integer value)
+{
+	rightBitshift = value;
+}
+
+void BitExpressions::set_rightBitshift(sc_integer value)
+{
+	iface.rightBitshift = value;
+}
+
+sc_integer BitExpressions::DefaultSCI::get_complementBitshift() const
+{
+	return complementBitshift;
+}
+
+sc_integer BitExpressions::get_complementBitshift() const
+{
+	return iface.complementBitshift;
+}
+
+void BitExpressions::DefaultSCI::set_complementBitshift(sc_integer value)
+{
+	complementBitshift = value;
+}
+
+void BitExpressions::set_complementBitshift(sc_integer value)
+{
+	iface.complementBitshift = value;
+}
+
+sc_integer BitExpressions::DefaultSCI::get_bitwiseAnd() const
+{
+	return bitwiseAnd;
+}
+
+sc_integer BitExpressions::get_bitwiseAnd() const
+{
+	return iface.bitwiseAnd;
+}
+
+void BitExpressions::DefaultSCI::set_bitwiseAnd(sc_integer value)
+{
+	bitwiseAnd = value;
+}
+
+void BitExpressions::set_bitwiseAnd(sc_integer value)
+{
+	iface.bitwiseAnd = value;
+}
+
+sc_integer BitExpressions::DefaultSCI::get_bitwiseOr() const
+{
+	return bitwiseOr;
+}
+
+sc_integer BitExpressions::get_bitwiseOr() const
+{
+	return iface.bitwiseOr;
+}
+
+void BitExpressions::DefaultSCI::set_bitwiseOr(sc_integer value)
+{
+	bitwiseOr = value;
+}
+
+void BitExpressions::set_bitwiseOr(sc_integer value)
+{
+	iface.bitwiseOr = value;
+}
+
+sc_integer BitExpressions::DefaultSCI::get_bitwiseXor() const
+{
+	return bitwiseXor;
+}
+
+sc_integer BitExpressions::get_bitwiseXor() const
+{
+	return iface.bitwiseXor;
+}
+
+void BitExpressions::DefaultSCI::set_bitwiseXor(sc_integer value)
+{
+	bitwiseXor = value;
+}
+
+void BitExpressions::set_bitwiseXor(sc_integer value)
+{
+	iface.bitwiseXor = value;
+}
+
+
+// implementations of all internal functions
+
+sc_boolean BitExpressions::check_main_region_StateA_tr0_tr0()
+{
+	return iface.e1_raised;
+}
+
+void BitExpressions::effect_main_region_StateA_tr0()
+{
+	exseq_main_region_StateA();
+	enseq_main_region_StateB_default();
+}
+
+/* Entry action for state 'StateA'. */
+void BitExpressions::enact_main_region_StateA()
+{
+	/* Entry action for state 'StateA'. */
+	iface.myBit1 = 5;
+	iface.myBit2 = 7;
+}
+
+/* Entry action for state 'StateB'. */
+void BitExpressions::enact_main_region_StateB()
+{
+	/* Entry action for state 'StateB'. */
+	iface.leftBitshift = iface.myBit1 << 1;
+	iface.rightBitshift = iface.myBit1 >> 1;
+	iface.complementBitshift = ~iface.myBit1;
+	iface.bitwiseAnd = iface.myBit1 & iface.myBit2;
+	iface.bitwiseOr = iface.myBit1 | iface.myBit2;
+	iface.bitwiseXor = iface.myBit1 ^ iface.myBit2;
+}
+
+/* 'default' enter sequence for state StateA */
+void BitExpressions::enseq_main_region_StateA_default()
+{
+	/* 'default' enter sequence for state StateA */
+	enact_main_region_StateA();
+	stateConfVector[0] = main_region_StateA;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for state StateB */
+void BitExpressions::enseq_main_region_StateB_default()
+{
+	/* 'default' enter sequence for state StateB */
+	enact_main_region_StateB();
+	stateConfVector[0] = main_region_StateB;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for region main region */
+void BitExpressions::enseq_main_region_default()
+{
+	/* 'default' enter sequence for region main region */
+	react_main_region__entry_Default();
+}
+
+/* Default exit sequence for state StateA */
+void BitExpressions::exseq_main_region_StateA()
+{
+	/* Default exit sequence for state StateA */
+	stateConfVector[0] = BitExpressions_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for state StateB */
+void BitExpressions::exseq_main_region_StateB()
+{
+	/* Default exit sequence for state StateB */
+	stateConfVector[0] = BitExpressions_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for region main region */
+void BitExpressions::exseq_main_region()
+{
+	/* Default exit sequence for region main region */
+	/* Handle exit of all possible states (of BitExpressions.main_region) at position 0... */
+	switch(stateConfVector[ 0 ])
+	{
+		case main_region_StateA :
+		{
+			exseq_main_region_StateA();
+			break;
+		}
+		case main_region_StateB :
+		{
+			exseq_main_region_StateB();
+			break;
+		}
+		default: break;
+	}
+}
+
+/* The reactions of state StateA. */
+void BitExpressions::react_main_region_StateA()
+{
+	/* The reactions of state StateA. */
+	if (check_main_region_StateA_tr0_tr0())
+	{ 
+		effect_main_region_StateA_tr0();
+	} 
+}
+
+/* The reactions of state StateB. */
+void BitExpressions::react_main_region_StateB()
+{
+	/* The reactions of state StateB. */
+}
+
+/* Default react sequence for initial entry  */
+void BitExpressions::react_main_region__entry_Default()
+{
+	/* Default react sequence for initial entry  */
+	enseq_main_region_StateA_default();
+}
+
+

+ 214 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BitExpressionsTest/BitExpressions.h

@@ -0,0 +1,214 @@
+
+#ifndef BITEXPRESSIONS_H_
+#define BITEXPRESSIONS_H_
+
+#include "sc_types.h"
+#include "StatemachineInterface.h"
+
+/*! \file Header of the state machine 'BitExpressions'.
+*/
+
+class BitExpressions : public StatemachineInterface
+{
+	
+	public:
+		
+		BitExpressions();
+		
+		~BitExpressions();
+		
+		/*! Enumeration of all states */ 
+		typedef enum
+		{
+			main_region_StateA,
+			main_region_StateB,
+			BitExpressions_last_state
+		} BitExpressionsStates;
+		
+		//! Inner class for default interface scope.
+		class DefaultSCI
+		{
+			
+			public:
+				/*! Gets the value of the variable 'myBit1' that is defined in the default interface scope. */
+				sc_integer get_myBit1() const;
+				
+				/*! Sets the value of the variable 'myBit1' that is defined in the default interface scope. */
+				void set_myBit1(sc_integer value);
+				
+				/*! Gets the value of the variable 'myBit2' that is defined in the default interface scope. */
+				sc_integer get_myBit2() const;
+				
+				/*! Sets the value of the variable 'myBit2' that is defined in the default interface scope. */
+				void set_myBit2(sc_integer value);
+				
+				/*! Gets the value of the variable 'leftBitshift' that is defined in the default interface scope. */
+				sc_integer get_leftBitshift() const;
+				
+				/*! Sets the value of the variable 'leftBitshift' that is defined in the default interface scope. */
+				void set_leftBitshift(sc_integer value);
+				
+				/*! Gets the value of the variable 'rightBitshift' that is defined in the default interface scope. */
+				sc_integer get_rightBitshift() const;
+				
+				/*! Sets the value of the variable 'rightBitshift' that is defined in the default interface scope. */
+				void set_rightBitshift(sc_integer value);
+				
+				/*! Gets the value of the variable 'complementBitshift' that is defined in the default interface scope. */
+				sc_integer get_complementBitshift() const;
+				
+				/*! Sets the value of the variable 'complementBitshift' that is defined in the default interface scope. */
+				void set_complementBitshift(sc_integer value);
+				
+				/*! Gets the value of the variable 'bitwiseAnd' that is defined in the default interface scope. */
+				sc_integer get_bitwiseAnd() const;
+				
+				/*! Sets the value of the variable 'bitwiseAnd' that is defined in the default interface scope. */
+				void set_bitwiseAnd(sc_integer value);
+				
+				/*! Gets the value of the variable 'bitwiseOr' that is defined in the default interface scope. */
+				sc_integer get_bitwiseOr() const;
+				
+				/*! Sets the value of the variable 'bitwiseOr' that is defined in the default interface scope. */
+				void set_bitwiseOr(sc_integer value);
+				
+				/*! Gets the value of the variable 'bitwiseXor' that is defined in the default interface scope. */
+				sc_integer get_bitwiseXor() const;
+				
+				/*! Sets the value of the variable 'bitwiseXor' that is defined in the default interface scope. */
+				void set_bitwiseXor(sc_integer value);
+				
+				/*! Raises the in event 'e1' that is defined in the default interface scope. */
+				void raise_e1();
+				
+				
+			private:
+				friend class BitExpressions;
+				sc_integer myBit1;
+				sc_integer myBit2;
+				sc_integer leftBitshift;
+				sc_integer rightBitshift;
+				sc_integer complementBitshift;
+				sc_integer bitwiseAnd;
+				sc_integer bitwiseOr;
+				sc_integer bitwiseXor;
+				sc_boolean e1_raised;
+		};
+				
+		
+		/*! Returns an instance of the interface class 'DefaultSCI'. */
+		DefaultSCI* getDefaultSCI();
+		
+		/*! Gets the value of the variable 'myBit1' that is defined in the default interface scope. */
+		sc_integer get_myBit1() const;
+		
+		/*! Sets the value of the variable 'myBit1' that is defined in the default interface scope. */
+		void set_myBit1(sc_integer value);
+		
+		/*! Gets the value of the variable 'myBit2' that is defined in the default interface scope. */
+		sc_integer get_myBit2() const;
+		
+		/*! Sets the value of the variable 'myBit2' that is defined in the default interface scope. */
+		void set_myBit2(sc_integer value);
+		
+		/*! Gets the value of the variable 'leftBitshift' that is defined in the default interface scope. */
+		sc_integer get_leftBitshift() const;
+		
+		/*! Sets the value of the variable 'leftBitshift' that is defined in the default interface scope. */
+		void set_leftBitshift(sc_integer value);
+		
+		/*! Gets the value of the variable 'rightBitshift' that is defined in the default interface scope. */
+		sc_integer get_rightBitshift() const;
+		
+		/*! Sets the value of the variable 'rightBitshift' that is defined in the default interface scope. */
+		void set_rightBitshift(sc_integer value);
+		
+		/*! Gets the value of the variable 'complementBitshift' that is defined in the default interface scope. */
+		sc_integer get_complementBitshift() const;
+		
+		/*! Sets the value of the variable 'complementBitshift' that is defined in the default interface scope. */
+		void set_complementBitshift(sc_integer value);
+		
+		/*! Gets the value of the variable 'bitwiseAnd' that is defined in the default interface scope. */
+		sc_integer get_bitwiseAnd() const;
+		
+		/*! Sets the value of the variable 'bitwiseAnd' that is defined in the default interface scope. */
+		void set_bitwiseAnd(sc_integer value);
+		
+		/*! Gets the value of the variable 'bitwiseOr' that is defined in the default interface scope. */
+		sc_integer get_bitwiseOr() const;
+		
+		/*! Sets the value of the variable 'bitwiseOr' that is defined in the default interface scope. */
+		void set_bitwiseOr(sc_integer value);
+		
+		/*! Gets the value of the variable 'bitwiseXor' that is defined in the default interface scope. */
+		sc_integer get_bitwiseXor() const;
+		
+		/*! Sets the value of the variable 'bitwiseXor' that is defined in the default interface scope. */
+		void set_bitwiseXor(sc_integer value);
+		
+		/*! Raises the in event 'e1' that is defined in the default interface scope. */
+		void raise_e1();
+		
+		
+		/*
+		 * Functions inherited from StatemachineInterface
+		 */
+		virtual void init();
+		
+		virtual void enter();
+		
+		virtual void exit();
+		
+		virtual void runCycle();
+		
+		/*!
+		* Checks if the state machine is active (until 2.4.1 this method was used for states).
+		* A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+		*/
+		virtual sc_boolean isActive() const;
+		
+		
+		/*!
+		* Checks if all active states are final. 
+		* If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+		*/
+		virtual sc_boolean isFinal() const;
+		
+		
+		/*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
+		sc_boolean isStateActive(BitExpressionsStates state) const;
+	
+	private:
+	
+	
+		//! the maximum number of orthogonal states defines the dimension of the state configuration vector.
+		static const sc_integer maxOrthogonalStates = 1;
+		
+		
+		BitExpressionsStates stateConfVector[maxOrthogonalStates];
+		
+		sc_ushort stateConfVectorPosition;
+		
+		DefaultSCI iface;
+		
+		// prototypes of all internal functions
+		
+		sc_boolean check_main_region_StateA_tr0_tr0();
+		void effect_main_region_StateA_tr0();
+		void enact_main_region_StateA();
+		void enact_main_region_StateB();
+		void enseq_main_region_StateA_default();
+		void enseq_main_region_StateB_default();
+		void enseq_main_region_default();
+		void exseq_main_region_StateA();
+		void exseq_main_region_StateB();
+		void exseq_main_region();
+		void react_main_region_StateA();
+		void react_main_region_StateB();
+		void react_main_region__entry_Default();
+		void clearInEvents();
+		void clearOutEvents();
+		
+};
+#endif /* BITEXPRESSIONS_H_ */

+ 30 - 5
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BitExpressionsTest/BitExpressionsTest.cc

@@ -1,5 +1,5 @@
 /**
-* Copyright (c) 2016 committers of YAKINDU and others.
+* Copyright (c) 2017 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
@@ -11,22 +11,47 @@
 #include <string>
 #include "gtest/gtest.h"
 #include "BitExpressions.h"
+#include "sc_types.h"
+BitExpressions* statechart;
 
-TEST(StatemachineTest, BitExpressions) {
-	BitExpressions* statechart = new BitExpressions();
-	statechart->init();
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		statechart = new BitExpressions();
+		statechart->init();
+	}
+	virtual void TearDown() {
+		delete statechart;
+	}
+};
+
+TEST_F(StatemachineTest, BitExpressions) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->isStateActive(BitExpressions::main_region_StateA));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_myBit1()== 5l);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_myBit2()== 7l);
+	
 	statechart->raise_e1();
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(BitExpressions::main_region_StateB));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_leftBitshift()== 10l);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_rightBitshift()== 2l);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_complementBitshift()== - 6l );
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_bitwiseAnd()== 5l);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_bitwiseOr()== 7l);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_bitwiseXor()== 2l);
-	delete statechart;
+	
 }

+ 42 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BitExpressionsTest/StatemachineInterface.h

@@ -0,0 +1,42 @@
+
+#ifndef STATEMACHINEINTERFACE_H_
+#define STATEMACHINEINTERFACE_H_
+
+/*! \file Basic interface for state machines.
+ */
+class StatemachineInterface
+{
+	public:
+	
+		virtual ~StatemachineInterface() = 0;
+		
+		/*! Initializes the state machine. Used to initialize internal variables etc.
+		*/
+		virtual void init() = 0;
+	
+		/*! Enters the state machine. Sets the state machine into a defined state.
+		*/
+		virtual void enter() = 0;
+	
+		/*! Exits the state machine. Leaves the state machine with a defined state.
+		*/
+		virtual void exit() = 0;
+	
+		/*! Start a run-to-completion cycle.
+		*/
+		virtual void runCycle() = 0;
+		
+		/*! Checks whether the state machine is active. 
+	 	    A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+	 	*/	
+		virtual	sc_boolean isActive() const = 0;
+		
+		/*! Checks if all active states are final. 
+	 		If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+	 	*/
+		virtual sc_boolean isFinal() const = 0;
+};
+
+inline StatemachineInterface::~StatemachineInterface() {}
+
+#endif /* STATEMACHINEINTERFACE_H_ */

+ 24 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BitExpressionsTest/sc_types.h

@@ -0,0 +1,24 @@
+
+#ifndef SC_TYPES_H_
+#define SC_TYPES_H_
+
+/* As <cstdint> is not available on all platforms we choose to include <stdint.h>. You can switch to <cstdint> by commenting and uncommenting the lines below.*/
+// #include <cstdint>
+#include <stdint.h>
+
+
+#define sc_string      char*
+
+typedef int_fast16_t   sc_short;
+typedef uint_fast16_t  sc_ushort;
+typedef int32_t        sc_integer;
+typedef double         sc_real;
+typedef bool           sc_boolean;
+
+typedef intptr_t       sc_eventid;
+
+#ifndef null
+	#define null 0
+#endif
+
+#endif /* SC_TYPES_H_ */

+ 393 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BooleanExpressionsTest/BooleanExpressions.cpp

@@ -0,0 +1,393 @@
+
+#include "BooleanExpressions.h"
+#include <string.h>
+
+/*! \file Implementation of the state machine 'BooleanExpressions'
+*/
+
+BooleanExpressions::BooleanExpressions()
+{
+	
+	
+	stateConfVectorPosition = 0;
+	
+}
+
+BooleanExpressions::~BooleanExpressions()
+{
+}
+
+
+void BooleanExpressions::init()
+{
+	for (int i = 0; i < maxOrthogonalStates; ++i)
+		stateConfVector[i] = BooleanExpressions_last_state;
+	
+	stateConfVectorPosition = 0;
+
+	clearInEvents();
+	clearOutEvents();
+	
+	/* Default init sequence for statechart BooleanExpressions */
+	iface.myBool1 = false;
+	iface.myBool2 = false;
+	iface.and_ID = false;
+	iface.or_ID = false;
+	iface.not_ID = false;
+	iface.equal = false;
+	iface.notequal = false;
+}
+
+void BooleanExpressions::enter()
+{
+	/* Default enter sequence for statechart BooleanExpressions */
+	enseq_main_region_default();
+}
+
+void BooleanExpressions::exit()
+{
+	/* Default exit sequence for statechart BooleanExpressions */
+	exseq_main_region();
+}
+
+sc_boolean BooleanExpressions::isActive() const
+{
+	return stateConfVector[0] != BooleanExpressions_last_state;
+}
+
+/* 
+ * Always returns 'false' since this state machine can never become final.
+ */
+sc_boolean BooleanExpressions::isFinal() const
+{
+   return false;}
+
+void BooleanExpressions::runCycle()
+{
+	
+	clearOutEvents();
+	
+	for (stateConfVectorPosition = 0;
+		stateConfVectorPosition < maxOrthogonalStates;
+		stateConfVectorPosition++)
+		{
+			
+		switch (stateConfVector[stateConfVectorPosition])
+		{
+		case main_region_StateA :
+		{
+			react_main_region_StateA();
+			break;
+		}
+		case main_region_StateB :
+		{
+			react_main_region_StateB();
+			break;
+		}
+		default:
+			break;
+		}
+	}
+	
+	clearInEvents();
+}
+
+void BooleanExpressions::clearInEvents()
+{
+	iface.e1_raised = false;
+}
+
+void BooleanExpressions::clearOutEvents()
+{
+}
+
+
+sc_boolean BooleanExpressions::isStateActive(BooleanExpressionsStates state) const
+{
+	switch (state)
+	{
+		case main_region_StateA : 
+			return (sc_boolean) (stateConfVector[0] == main_region_StateA
+			);
+		case main_region_StateB : 
+			return (sc_boolean) (stateConfVector[0] == main_region_StateB
+			);
+		default: return false;
+	}
+}
+
+BooleanExpressions::DefaultSCI* BooleanExpressions::getDefaultSCI()
+{
+	return &iface;
+}
+
+void BooleanExpressions::DefaultSCI::raise_e1()
+{
+	e1_raised = true;
+}
+
+void BooleanExpressions::raise_e1()
+{
+	iface.raise_e1();
+}
+
+
+sc_boolean BooleanExpressions::DefaultSCI::get_myBool1() const
+{
+	return myBool1;
+}
+
+sc_boolean BooleanExpressions::get_myBool1() const
+{
+	return iface.myBool1;
+}
+
+void BooleanExpressions::DefaultSCI::set_myBool1(sc_boolean value)
+{
+	myBool1 = value;
+}
+
+void BooleanExpressions::set_myBool1(sc_boolean value)
+{
+	iface.myBool1 = value;
+}
+
+sc_boolean BooleanExpressions::DefaultSCI::get_myBool2() const
+{
+	return myBool2;
+}
+
+sc_boolean BooleanExpressions::get_myBool2() const
+{
+	return iface.myBool2;
+}
+
+void BooleanExpressions::DefaultSCI::set_myBool2(sc_boolean value)
+{
+	myBool2 = value;
+}
+
+void BooleanExpressions::set_myBool2(sc_boolean value)
+{
+	iface.myBool2 = value;
+}
+
+sc_boolean BooleanExpressions::DefaultSCI::get_and() const
+{
+	return and_ID;
+}
+
+sc_boolean BooleanExpressions::get_and() const
+{
+	return iface.and_ID;
+}
+
+void BooleanExpressions::DefaultSCI::set_and(sc_boolean value)
+{
+	and_ID = value;
+}
+
+void BooleanExpressions::set_and(sc_boolean value)
+{
+	iface.and_ID = value;
+}
+
+sc_boolean BooleanExpressions::DefaultSCI::get_or() const
+{
+	return or_ID;
+}
+
+sc_boolean BooleanExpressions::get_or() const
+{
+	return iface.or_ID;
+}
+
+void BooleanExpressions::DefaultSCI::set_or(sc_boolean value)
+{
+	or_ID = value;
+}
+
+void BooleanExpressions::set_or(sc_boolean value)
+{
+	iface.or_ID = value;
+}
+
+sc_boolean BooleanExpressions::DefaultSCI::get_not() const
+{
+	return not_ID;
+}
+
+sc_boolean BooleanExpressions::get_not() const
+{
+	return iface.not_ID;
+}
+
+void BooleanExpressions::DefaultSCI::set_not(sc_boolean value)
+{
+	not_ID = value;
+}
+
+void BooleanExpressions::set_not(sc_boolean value)
+{
+	iface.not_ID = value;
+}
+
+sc_boolean BooleanExpressions::DefaultSCI::get_equal() const
+{
+	return equal;
+}
+
+sc_boolean BooleanExpressions::get_equal() const
+{
+	return iface.equal;
+}
+
+void BooleanExpressions::DefaultSCI::set_equal(sc_boolean value)
+{
+	equal = value;
+}
+
+void BooleanExpressions::set_equal(sc_boolean value)
+{
+	iface.equal = value;
+}
+
+sc_boolean BooleanExpressions::DefaultSCI::get_notequal() const
+{
+	return notequal;
+}
+
+sc_boolean BooleanExpressions::get_notequal() const
+{
+	return iface.notequal;
+}
+
+void BooleanExpressions::DefaultSCI::set_notequal(sc_boolean value)
+{
+	notequal = value;
+}
+
+void BooleanExpressions::set_notequal(sc_boolean value)
+{
+	iface.notequal = value;
+}
+
+
+// implementations of all internal functions
+
+sc_boolean BooleanExpressions::check_main_region_StateA_tr0_tr0()
+{
+	return iface.e1_raised;
+}
+
+void BooleanExpressions::effect_main_region_StateA_tr0()
+{
+	exseq_main_region_StateA();
+	enseq_main_region_StateB_default();
+}
+
+/* Entry action for state 'StateA'. */
+void BooleanExpressions::enact_main_region_StateA()
+{
+	/* Entry action for state 'StateA'. */
+	iface.myBool1 = true;
+	iface.myBool2 = false;
+}
+
+/* Entry action for state 'StateB'. */
+void BooleanExpressions::enact_main_region_StateB()
+{
+	/* Entry action for state 'StateB'. */
+	iface.and_ID = iface.myBool1 && iface.myBool2;
+	iface.or_ID = iface.myBool1 || iface.myBool2;
+	iface.not_ID = !iface.myBool1;
+	iface.equal = iface.myBool1 == iface.myBool2;
+	iface.notequal = (iface.myBool1 != iface.myBool2);
+}
+
+/* 'default' enter sequence for state StateA */
+void BooleanExpressions::enseq_main_region_StateA_default()
+{
+	/* 'default' enter sequence for state StateA */
+	enact_main_region_StateA();
+	stateConfVector[0] = main_region_StateA;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for state StateB */
+void BooleanExpressions::enseq_main_region_StateB_default()
+{
+	/* 'default' enter sequence for state StateB */
+	enact_main_region_StateB();
+	stateConfVector[0] = main_region_StateB;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for region main region */
+void BooleanExpressions::enseq_main_region_default()
+{
+	/* 'default' enter sequence for region main region */
+	react_main_region__entry_Default();
+}
+
+/* Default exit sequence for state StateA */
+void BooleanExpressions::exseq_main_region_StateA()
+{
+	/* Default exit sequence for state StateA */
+	stateConfVector[0] = BooleanExpressions_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for state StateB */
+void BooleanExpressions::exseq_main_region_StateB()
+{
+	/* Default exit sequence for state StateB */
+	stateConfVector[0] = BooleanExpressions_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for region main region */
+void BooleanExpressions::exseq_main_region()
+{
+	/* Default exit sequence for region main region */
+	/* Handle exit of all possible states (of BooleanExpressions.main_region) at position 0... */
+	switch(stateConfVector[ 0 ])
+	{
+		case main_region_StateA :
+		{
+			exseq_main_region_StateA();
+			break;
+		}
+		case main_region_StateB :
+		{
+			exseq_main_region_StateB();
+			break;
+		}
+		default: break;
+	}
+}
+
+/* The reactions of state StateA. */
+void BooleanExpressions::react_main_region_StateA()
+{
+	/* The reactions of state StateA. */
+	if (check_main_region_StateA_tr0_tr0())
+	{ 
+		effect_main_region_StateA_tr0();
+	} 
+}
+
+/* The reactions of state StateB. */
+void BooleanExpressions::react_main_region_StateB()
+{
+	/* The reactions of state StateB. */
+}
+
+/* Default react sequence for initial entry  */
+void BooleanExpressions::react_main_region__entry_Default()
+{
+	/* Default react sequence for initial entry  */
+	enseq_main_region_StateA_default();
+}
+
+

+ 201 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BooleanExpressionsTest/BooleanExpressions.h

@@ -0,0 +1,201 @@
+
+#ifndef BOOLEANEXPRESSIONS_H_
+#define BOOLEANEXPRESSIONS_H_
+
+#include "sc_types.h"
+#include "StatemachineInterface.h"
+
+/*! \file Header of the state machine 'BooleanExpressions'.
+*/
+
+class BooleanExpressions : public StatemachineInterface
+{
+	
+	public:
+		
+		BooleanExpressions();
+		
+		~BooleanExpressions();
+		
+		/*! Enumeration of all states */ 
+		typedef enum
+		{
+			main_region_StateA,
+			main_region_StateB,
+			BooleanExpressions_last_state
+		} BooleanExpressionsStates;
+		
+		//! Inner class for default interface scope.
+		class DefaultSCI
+		{
+			
+			public:
+				/*! Gets the value of the variable 'myBool1' that is defined in the default interface scope. */
+				sc_boolean get_myBool1() const;
+				
+				/*! Sets the value of the variable 'myBool1' that is defined in the default interface scope. */
+				void set_myBool1(sc_boolean value);
+				
+				/*! Gets the value of the variable 'myBool2' that is defined in the default interface scope. */
+				sc_boolean get_myBool2() const;
+				
+				/*! Sets the value of the variable 'myBool2' that is defined in the default interface scope. */
+				void set_myBool2(sc_boolean value);
+				
+				/*! Gets the value of the variable 'and' that is defined in the default interface scope. */
+				sc_boolean get_and() const;
+				
+				/*! Sets the value of the variable 'and' that is defined in the default interface scope. */
+				void set_and(sc_boolean value);
+				
+				/*! Gets the value of the variable 'or' that is defined in the default interface scope. */
+				sc_boolean get_or() const;
+				
+				/*! Sets the value of the variable 'or' that is defined in the default interface scope. */
+				void set_or(sc_boolean value);
+				
+				/*! Gets the value of the variable 'not' that is defined in the default interface scope. */
+				sc_boolean get_not() const;
+				
+				/*! Sets the value of the variable 'not' that is defined in the default interface scope. */
+				void set_not(sc_boolean value);
+				
+				/*! Gets the value of the variable 'equal' that is defined in the default interface scope. */
+				sc_boolean get_equal() const;
+				
+				/*! Sets the value of the variable 'equal' that is defined in the default interface scope. */
+				void set_equal(sc_boolean value);
+				
+				/*! Gets the value of the variable 'notequal' that is defined in the default interface scope. */
+				sc_boolean get_notequal() const;
+				
+				/*! Sets the value of the variable 'notequal' that is defined in the default interface scope. */
+				void set_notequal(sc_boolean value);
+				
+				/*! Raises the in event 'e1' that is defined in the default interface scope. */
+				void raise_e1();
+				
+				
+			private:
+				friend class BooleanExpressions;
+				sc_boolean myBool1;
+				sc_boolean myBool2;
+				sc_boolean and_ID;
+				sc_boolean or_ID;
+				sc_boolean not_ID;
+				sc_boolean equal;
+				sc_boolean notequal;
+				sc_boolean e1_raised;
+		};
+				
+		
+		/*! Returns an instance of the interface class 'DefaultSCI'. */
+		DefaultSCI* getDefaultSCI();
+		
+		/*! Gets the value of the variable 'myBool1' that is defined in the default interface scope. */
+		sc_boolean get_myBool1() const;
+		
+		/*! Sets the value of the variable 'myBool1' that is defined in the default interface scope. */
+		void set_myBool1(sc_boolean value);
+		
+		/*! Gets the value of the variable 'myBool2' that is defined in the default interface scope. */
+		sc_boolean get_myBool2() const;
+		
+		/*! Sets the value of the variable 'myBool2' that is defined in the default interface scope. */
+		void set_myBool2(sc_boolean value);
+		
+		/*! Gets the value of the variable 'and' that is defined in the default interface scope. */
+		sc_boolean get_and() const;
+		
+		/*! Sets the value of the variable 'and' that is defined in the default interface scope. */
+		void set_and(sc_boolean value);
+		
+		/*! Gets the value of the variable 'or' that is defined in the default interface scope. */
+		sc_boolean get_or() const;
+		
+		/*! Sets the value of the variable 'or' that is defined in the default interface scope. */
+		void set_or(sc_boolean value);
+		
+		/*! Gets the value of the variable 'not' that is defined in the default interface scope. */
+		sc_boolean get_not() const;
+		
+		/*! Sets the value of the variable 'not' that is defined in the default interface scope. */
+		void set_not(sc_boolean value);
+		
+		/*! Gets the value of the variable 'equal' that is defined in the default interface scope. */
+		sc_boolean get_equal() const;
+		
+		/*! Sets the value of the variable 'equal' that is defined in the default interface scope. */
+		void set_equal(sc_boolean value);
+		
+		/*! Gets the value of the variable 'notequal' that is defined in the default interface scope. */
+		sc_boolean get_notequal() const;
+		
+		/*! Sets the value of the variable 'notequal' that is defined in the default interface scope. */
+		void set_notequal(sc_boolean value);
+		
+		/*! Raises the in event 'e1' that is defined in the default interface scope. */
+		void raise_e1();
+		
+		
+		/*
+		 * Functions inherited from StatemachineInterface
+		 */
+		virtual void init();
+		
+		virtual void enter();
+		
+		virtual void exit();
+		
+		virtual void runCycle();
+		
+		/*!
+		* Checks if the state machine is active (until 2.4.1 this method was used for states).
+		* A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+		*/
+		virtual sc_boolean isActive() const;
+		
+		
+		/*!
+		* Checks if all active states are final. 
+		* If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+		*/
+		virtual sc_boolean isFinal() const;
+		
+		
+		/*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
+		sc_boolean isStateActive(BooleanExpressionsStates state) const;
+	
+	private:
+	
+	
+		//! the maximum number of orthogonal states defines the dimension of the state configuration vector.
+		static const sc_integer maxOrthogonalStates = 1;
+		
+		
+		BooleanExpressionsStates stateConfVector[maxOrthogonalStates];
+		
+		sc_ushort stateConfVectorPosition;
+		
+		DefaultSCI iface;
+		
+		// prototypes of all internal functions
+		
+		sc_boolean check_main_region_StateA_tr0_tr0();
+		void effect_main_region_StateA_tr0();
+		void enact_main_region_StateA();
+		void enact_main_region_StateB();
+		void enseq_main_region_StateA_default();
+		void enseq_main_region_StateB_default();
+		void enseq_main_region_default();
+		void exseq_main_region_StateA();
+		void exseq_main_region_StateB();
+		void exseq_main_region();
+		void react_main_region_StateA();
+		void react_main_region_StateB();
+		void react_main_region__entry_Default();
+		void clearInEvents();
+		void clearOutEvents();
+		
+};
+#endif /* BOOLEANEXPRESSIONS_H_ */

+ 29 - 5
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BooleanExpressionsTest/BooleanExpressionsTest.cc

@@ -1,5 +1,5 @@
 /**
-* Copyright (c) 2016 committers of YAKINDU and others.
+* Copyright (c) 2017 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
@@ -11,21 +11,45 @@
 #include <string>
 #include "gtest/gtest.h"
 #include "BooleanExpressions.h"
+#include "sc_types.h"
+BooleanExpressions* statechart;
 
-TEST(StatemachineTest, booleanExpressions) {
-	BooleanExpressions* statechart = new BooleanExpressions();
-	statechart->init();
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		statechart = new BooleanExpressions();
+		statechart->init();
+	}
+	virtual void TearDown() {
+		delete statechart;
+	}
+};
+
+TEST_F(StatemachineTest, booleanExpressions) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->isStateActive(BooleanExpressions::main_region_StateA));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_myBool1()== true);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_myBool2()== false);
+	
 	statechart->raise_e1();
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(BooleanExpressions::main_region_StateB));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_and()== false);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_or()== true);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_not()== false);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_equal()== false);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_notequal()== true);
-	delete statechart;
+	
 }

+ 42 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BooleanExpressionsTest/StatemachineInterface.h

@@ -0,0 +1,42 @@
+
+#ifndef STATEMACHINEINTERFACE_H_
+#define STATEMACHINEINTERFACE_H_
+
+/*! \file Basic interface for state machines.
+ */
+class StatemachineInterface
+{
+	public:
+	
+		virtual ~StatemachineInterface() = 0;
+		
+		/*! Initializes the state machine. Used to initialize internal variables etc.
+		*/
+		virtual void init() = 0;
+	
+		/*! Enters the state machine. Sets the state machine into a defined state.
+		*/
+		virtual void enter() = 0;
+	
+		/*! Exits the state machine. Leaves the state machine with a defined state.
+		*/
+		virtual void exit() = 0;
+	
+		/*! Start a run-to-completion cycle.
+		*/
+		virtual void runCycle() = 0;
+		
+		/*! Checks whether the state machine is active. 
+	 	    A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+	 	*/	
+		virtual	sc_boolean isActive() const = 0;
+		
+		/*! Checks if all active states are final. 
+	 		If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+	 	*/
+		virtual sc_boolean isFinal() const = 0;
+};
+
+inline StatemachineInterface::~StatemachineInterface() {}
+
+#endif /* STATEMACHINEINTERFACE_H_ */

+ 24 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BooleanExpressionsTest/sc_types.h

@@ -0,0 +1,24 @@
+
+#ifndef SC_TYPES_H_
+#define SC_TYPES_H_
+
+/* As <cstdint> is not available on all platforms we choose to include <stdint.h>. You can switch to <cstdint> by commenting and uncommenting the lines below.*/
+// #include <cstdint>
+#include <stdint.h>
+
+
+#define sc_string      char*
+
+typedef int_fast16_t   sc_short;
+typedef uint_fast16_t  sc_ushort;
+typedef int32_t        sc_integer;
+typedef double         sc_real;
+typedef bool           sc_boolean;
+
+typedef intptr_t       sc_eventid;
+
+#ifndef null
+	#define null 0
+#endif
+
+#endif /* SC_TYPES_H_ */

+ 984 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CKeywordsTest/CKeywords.cpp

@@ -0,0 +1,984 @@
+
+#include "CKeywords.h"
+#include <string.h>
+
+/*! \file Implementation of the state machine 'CKeywords'
+*/
+
+CKeywords::CKeywords()
+{
+	
+	
+	for (int i = 0; i < maxHistoryStates; ++i)
+		historyVector[i] = CKeywords_last_state;
+	
+	stateConfVectorPosition = 0;
+	
+}
+
+CKeywords::~CKeywords()
+{
+}
+
+
+void CKeywords::init()
+{
+	for (int i = 0; i < maxOrthogonalStates; ++i)
+		stateConfVector[i] = CKeywords_last_state;
+	
+	for (int i = 0; i < maxHistoryStates; ++i)
+		historyVector[i] = CKeywords_last_state;
+	
+	stateConfVectorPosition = 0;
+
+	clearInEvents();
+	clearOutEvents();
+	
+	/* Default init sequence for statechart CKeywords */
+	iface.case_ID = false;
+	iface.do_ID = 0;
+	iface.continue_ID = false;
+	iface.double_ID = false;
+	iface.enum_ID = false;
+	iface.extern_ID = false;
+	iface.float_ID = false;
+	iface.for_ID = false;
+	iface.goto_ID = false;
+	iface.if_ID = false;
+	iface.int_ID = false;
+	iface.long_ID = false;
+	iface.register_ID = false;
+	iface.return_ID = false;
+	iface.short_ID = false;
+	iface.signed_ID = false;
+	iface.sizeof_ID = false;
+	iface.static_ID = false;
+	iface.struct_ID = false;
+	iface.switch_ID = false;
+	iface.typedef_ID = false;
+	iface.union_ID = false;
+	iface.unsigned_ID = false;
+	iface.void_ID = false;
+	iface.volatile_ID = false;
+	iface.while_ID = false;
+}
+
+void CKeywords::enter()
+{
+	/* Default enter sequence for statechart CKeywords */
+	enseq_auto_default();
+}
+
+void CKeywords::exit()
+{
+	/* Default exit sequence for statechart CKeywords */
+	exseq_auto();
+}
+
+sc_boolean CKeywords::isActive() const
+{
+	return stateConfVector[0] != CKeywords_last_state;
+}
+
+/* 
+ * Always returns 'false' since this state machine can never become final.
+ */
+sc_boolean CKeywords::isFinal() const
+{
+   return false;}
+
+void CKeywords::runCycle()
+{
+	
+	clearOutEvents();
+	
+	for (stateConfVectorPosition = 0;
+		stateConfVectorPosition < maxOrthogonalStates;
+		stateConfVectorPosition++)
+		{
+			
+		switch (stateConfVector[stateConfVectorPosition])
+		{
+		case auto_char :
+		{
+			react_auto_char();
+			break;
+		}
+		case auto_loop_switch_case_enum_asm :
+		{
+			react_auto_loop_switch_case_enum_asm();
+			break;
+		}
+		default:
+			break;
+		}
+	}
+	
+	clearInEvents();
+}
+
+void CKeywords::clearInEvents()
+{
+	iface.auto_raised = false;
+	iface.break_raised = false;
+}
+
+void CKeywords::clearOutEvents()
+{
+}
+
+
+sc_boolean CKeywords::isStateActive(CKeywordsStates state) const
+{
+	switch (state)
+	{
+		case auto_char : 
+			return (sc_boolean) (stateConfVector[0] == auto_char
+			);
+		case auto_loop : 
+			return (sc_boolean) (stateConfVector[0] >= auto_loop
+				&& stateConfVector[0] <= auto_loop_switch_case_enum_asm);
+		case auto_loop_switch_case : 
+			return (sc_boolean) (stateConfVector[0] >= auto_loop_switch_case
+				&& stateConfVector[0] <= auto_loop_switch_case_enum_asm);
+		case auto_loop_switch_case_enum_asm : 
+			return (sc_boolean) (stateConfVector[0] == auto_loop_switch_case_enum_asm
+			);
+		default: return false;
+	}
+}
+
+CKeywords::DefaultSCI* CKeywords::getDefaultSCI()
+{
+	return &iface;
+}
+
+void CKeywords::DefaultSCI::raise_auto()
+{
+	auto_raised = true;
+}
+
+void CKeywords::raise_auto()
+{
+	iface.raise_auto();
+}
+
+void CKeywords::DefaultSCI::raise_break()
+{
+	break_raised = true;
+}
+
+void CKeywords::raise_break()
+{
+	iface.raise_break();
+}
+
+
+sc_boolean CKeywords::DefaultSCI::get_case() const
+{
+	return case_ID;
+}
+
+sc_boolean CKeywords::get_case() const
+{
+	return iface.case_ID;
+}
+
+void CKeywords::DefaultSCI::set_case(sc_boolean value)
+{
+	case_ID = value;
+}
+
+void CKeywords::set_case(sc_boolean value)
+{
+	iface.case_ID = value;
+}
+
+sc_integer CKeywords::DefaultSCI::get_do() const
+{
+	return do_ID;
+}
+
+sc_integer CKeywords::get_do() const
+{
+	return iface.do_ID;
+}
+
+void CKeywords::DefaultSCI::set_do(sc_integer value)
+{
+	do_ID = value;
+}
+
+void CKeywords::set_do(sc_integer value)
+{
+	iface.do_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_continue() const
+{
+	return continue_ID;
+}
+
+sc_boolean CKeywords::get_continue() const
+{
+	return iface.continue_ID;
+}
+
+void CKeywords::DefaultSCI::set_continue(sc_boolean value)
+{
+	continue_ID = value;
+}
+
+void CKeywords::set_continue(sc_boolean value)
+{
+	iface.continue_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_double() const
+{
+	return double_ID;
+}
+
+sc_boolean CKeywords::get_double() const
+{
+	return iface.double_ID;
+}
+
+void CKeywords::DefaultSCI::set_double(sc_boolean value)
+{
+	double_ID = value;
+}
+
+void CKeywords::set_double(sc_boolean value)
+{
+	iface.double_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_enum() const
+{
+	return enum_ID;
+}
+
+sc_boolean CKeywords::get_enum() const
+{
+	return iface.enum_ID;
+}
+
+void CKeywords::DefaultSCI::set_enum(sc_boolean value)
+{
+	enum_ID = value;
+}
+
+void CKeywords::set_enum(sc_boolean value)
+{
+	iface.enum_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_extern() const
+{
+	return extern_ID;
+}
+
+sc_boolean CKeywords::get_extern() const
+{
+	return iface.extern_ID;
+}
+
+void CKeywords::DefaultSCI::set_extern(sc_boolean value)
+{
+	extern_ID = value;
+}
+
+void CKeywords::set_extern(sc_boolean value)
+{
+	iface.extern_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_float() const
+{
+	return float_ID;
+}
+
+sc_boolean CKeywords::get_float() const
+{
+	return iface.float_ID;
+}
+
+void CKeywords::DefaultSCI::set_float(sc_boolean value)
+{
+	float_ID = value;
+}
+
+void CKeywords::set_float(sc_boolean value)
+{
+	iface.float_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_for() const
+{
+	return for_ID;
+}
+
+sc_boolean CKeywords::get_for() const
+{
+	return iface.for_ID;
+}
+
+void CKeywords::DefaultSCI::set_for(sc_boolean value)
+{
+	for_ID = value;
+}
+
+void CKeywords::set_for(sc_boolean value)
+{
+	iface.for_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_goto() const
+{
+	return goto_ID;
+}
+
+sc_boolean CKeywords::get_goto() const
+{
+	return iface.goto_ID;
+}
+
+void CKeywords::DefaultSCI::set_goto(sc_boolean value)
+{
+	goto_ID = value;
+}
+
+void CKeywords::set_goto(sc_boolean value)
+{
+	iface.goto_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_if() const
+{
+	return if_ID;
+}
+
+sc_boolean CKeywords::get_if() const
+{
+	return iface.if_ID;
+}
+
+void CKeywords::DefaultSCI::set_if(sc_boolean value)
+{
+	if_ID = value;
+}
+
+void CKeywords::set_if(sc_boolean value)
+{
+	iface.if_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_int() const
+{
+	return int_ID;
+}
+
+sc_boolean CKeywords::get_int() const
+{
+	return iface.int_ID;
+}
+
+void CKeywords::DefaultSCI::set_int(sc_boolean value)
+{
+	int_ID = value;
+}
+
+void CKeywords::set_int(sc_boolean value)
+{
+	iface.int_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_long() const
+{
+	return long_ID;
+}
+
+sc_boolean CKeywords::get_long() const
+{
+	return iface.long_ID;
+}
+
+void CKeywords::DefaultSCI::set_long(sc_boolean value)
+{
+	long_ID = value;
+}
+
+void CKeywords::set_long(sc_boolean value)
+{
+	iface.long_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_register() const
+{
+	return register_ID;
+}
+
+sc_boolean CKeywords::get_register() const
+{
+	return iface.register_ID;
+}
+
+void CKeywords::DefaultSCI::set_register(sc_boolean value)
+{
+	register_ID = value;
+}
+
+void CKeywords::set_register(sc_boolean value)
+{
+	iface.register_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_return() const
+{
+	return return_ID;
+}
+
+sc_boolean CKeywords::get_return() const
+{
+	return iface.return_ID;
+}
+
+void CKeywords::DefaultSCI::set_return(sc_boolean value)
+{
+	return_ID = value;
+}
+
+void CKeywords::set_return(sc_boolean value)
+{
+	iface.return_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_short() const
+{
+	return short_ID;
+}
+
+sc_boolean CKeywords::get_short() const
+{
+	return iface.short_ID;
+}
+
+void CKeywords::DefaultSCI::set_short(sc_boolean value)
+{
+	short_ID = value;
+}
+
+void CKeywords::set_short(sc_boolean value)
+{
+	iface.short_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_signed() const
+{
+	return signed_ID;
+}
+
+sc_boolean CKeywords::get_signed() const
+{
+	return iface.signed_ID;
+}
+
+void CKeywords::DefaultSCI::set_signed(sc_boolean value)
+{
+	signed_ID = value;
+}
+
+void CKeywords::set_signed(sc_boolean value)
+{
+	iface.signed_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_sizeof() const
+{
+	return sizeof_ID;
+}
+
+sc_boolean CKeywords::get_sizeof() const
+{
+	return iface.sizeof_ID;
+}
+
+void CKeywords::DefaultSCI::set_sizeof(sc_boolean value)
+{
+	sizeof_ID = value;
+}
+
+void CKeywords::set_sizeof(sc_boolean value)
+{
+	iface.sizeof_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_static() const
+{
+	return static_ID;
+}
+
+sc_boolean CKeywords::get_static() const
+{
+	return iface.static_ID;
+}
+
+void CKeywords::DefaultSCI::set_static(sc_boolean value)
+{
+	static_ID = value;
+}
+
+void CKeywords::set_static(sc_boolean value)
+{
+	iface.static_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_struct() const
+{
+	return struct_ID;
+}
+
+sc_boolean CKeywords::get_struct() const
+{
+	return iface.struct_ID;
+}
+
+void CKeywords::DefaultSCI::set_struct(sc_boolean value)
+{
+	struct_ID = value;
+}
+
+void CKeywords::set_struct(sc_boolean value)
+{
+	iface.struct_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_switch() const
+{
+	return switch_ID;
+}
+
+sc_boolean CKeywords::get_switch() const
+{
+	return iface.switch_ID;
+}
+
+void CKeywords::DefaultSCI::set_switch(sc_boolean value)
+{
+	switch_ID = value;
+}
+
+void CKeywords::set_switch(sc_boolean value)
+{
+	iface.switch_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_typedef() const
+{
+	return typedef_ID;
+}
+
+sc_boolean CKeywords::get_typedef() const
+{
+	return iface.typedef_ID;
+}
+
+void CKeywords::DefaultSCI::set_typedef(sc_boolean value)
+{
+	typedef_ID = value;
+}
+
+void CKeywords::set_typedef(sc_boolean value)
+{
+	iface.typedef_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_union() const
+{
+	return union_ID;
+}
+
+sc_boolean CKeywords::get_union() const
+{
+	return iface.union_ID;
+}
+
+void CKeywords::DefaultSCI::set_union(sc_boolean value)
+{
+	union_ID = value;
+}
+
+void CKeywords::set_union(sc_boolean value)
+{
+	iface.union_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_unsigned() const
+{
+	return unsigned_ID;
+}
+
+sc_boolean CKeywords::get_unsigned() const
+{
+	return iface.unsigned_ID;
+}
+
+void CKeywords::DefaultSCI::set_unsigned(sc_boolean value)
+{
+	unsigned_ID = value;
+}
+
+void CKeywords::set_unsigned(sc_boolean value)
+{
+	iface.unsigned_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_void() const
+{
+	return void_ID;
+}
+
+sc_boolean CKeywords::get_void() const
+{
+	return iface.void_ID;
+}
+
+void CKeywords::DefaultSCI::set_void(sc_boolean value)
+{
+	void_ID = value;
+}
+
+void CKeywords::set_void(sc_boolean value)
+{
+	iface.void_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_volatile() const
+{
+	return volatile_ID;
+}
+
+sc_boolean CKeywords::get_volatile() const
+{
+	return iface.volatile_ID;
+}
+
+void CKeywords::DefaultSCI::set_volatile(sc_boolean value)
+{
+	volatile_ID = value;
+}
+
+void CKeywords::set_volatile(sc_boolean value)
+{
+	iface.volatile_ID = value;
+}
+
+sc_boolean CKeywords::DefaultSCI::get_while() const
+{
+	return while_ID;
+}
+
+sc_boolean CKeywords::get_while() const
+{
+	return iface.while_ID;
+}
+
+void CKeywords::DefaultSCI::set_while(sc_boolean value)
+{
+	while_ID = value;
+}
+
+void CKeywords::set_while(sc_boolean value)
+{
+	iface.while_ID = value;
+}
+
+
+// implementations of all internal functions
+
+sc_boolean CKeywords::check_auto_char_tr0_tr0()
+{
+	return (iface.auto_raised) && (iface.case_ID);
+}
+
+void CKeywords::effect_auto_char_tr0()
+{
+	exseq_auto_char();
+	iface.do_ID += 1;
+	enseq_auto_loop_default();
+}
+
+/* Entry action for state 'char'. */
+void CKeywords::enact_auto_char()
+{
+	/* Entry action for state 'char'. */
+	iface.case_ID = true;
+	iface.do_ID = 0;
+	iface.continue_ID = true;
+	iface.double_ID = true;
+	iface.enum_ID = true;
+	iface.extern_ID = true;
+	iface.float_ID = true;
+	iface.for_ID = true;
+	iface.goto_ID = true;
+	iface.if_ID = true;
+	iface.int_ID = true;
+	iface.long_ID = true;
+	iface.register_ID = true;
+	iface.return_ID = true;
+	iface.short_ID = true;
+	iface.signed_ID = true;
+	iface.sizeof_ID = true;
+	iface.static_ID = true;
+	iface.struct_ID = true;
+	iface.switch_ID = true;
+	iface.typedef_ID = true;
+	iface.union_ID = true;
+	iface.unsigned_ID = true;
+	iface.void_ID = true;
+	iface.volatile_ID = true;
+	iface.while_ID = true;
+}
+
+/* Entry action for state 'asm'. */
+void CKeywords::enact_auto_loop_switch_case_enum_asm()
+{
+	/* Entry action for state 'asm'. */
+	iface.case_ID = false;
+	iface.do_ID = 0;
+	iface.continue_ID = false;
+	iface.double_ID = false;
+	iface.enum_ID = false;
+	iface.extern_ID = false;
+	iface.float_ID = false;
+	iface.for_ID = false;
+	iface.goto_ID = false;
+	iface.if_ID = false;
+	iface.int_ID = false;
+	iface.long_ID = false;
+	iface.register_ID = false;
+	iface.return_ID = false;
+	iface.short_ID = false;
+	iface.signed_ID = false;
+	iface.sizeof_ID = false;
+	iface.static_ID = false;
+	iface.struct_ID = false;
+	iface.switch_ID = false;
+	iface.typedef_ID = false;
+	iface.union_ID = false;
+	iface.unsigned_ID = false;
+	iface.void_ID = false;
+	iface.volatile_ID = false;
+	iface.while_ID = false;
+}
+
+/* 'default' enter sequence for state char */
+void CKeywords::enseq_auto_char_default()
+{
+	/* 'default' enter sequence for state char */
+	enact_auto_char();
+	stateConfVector[0] = auto_char;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for state loop */
+void CKeywords::enseq_auto_loop_default()
+{
+	/* 'default' enter sequence for state loop */
+	enseq_auto_loop_switch_default();
+}
+
+/* 'default' enter sequence for state case */
+void CKeywords::enseq_auto_loop_switch_case_default()
+{
+	/* 'default' enter sequence for state case */
+	enseq_auto_loop_switch_case_enum_default();
+	historyVector[0] = stateConfVector[0];
+}
+
+/* 'default' enter sequence for state asm */
+void CKeywords::enseq_auto_loop_switch_case_enum_asm_default()
+{
+	/* 'default' enter sequence for state asm */
+	enact_auto_loop_switch_case_enum_asm();
+	stateConfVector[0] = auto_loop_switch_case_enum_asm;
+	stateConfVectorPosition = 0;
+	historyVector[1] = stateConfVector[0];
+}
+
+/* 'default' enter sequence for region auto */
+void CKeywords::enseq_auto_default()
+{
+	/* 'default' enter sequence for region auto */
+	react_auto__entry_Default();
+}
+
+/* 'default' enter sequence for region switch */
+void CKeywords::enseq_auto_loop_switch_default()
+{
+	/* 'default' enter sequence for region switch */
+	react_auto_loop_switch__entry_Default();
+}
+
+/* shallow enterSequence with history in child switch */
+void CKeywords::shenseq_auto_loop_switch()
+{
+	/* shallow enterSequence with history in child switch */
+	/* Handle shallow history entry of switch */
+	switch(historyVector[ 0 ])
+	{
+		case auto_loop_switch_case_enum_asm :
+		{
+			enseq_auto_loop_switch_case_default();
+			break;
+		}
+		default: break;
+	}
+}
+
+/* 'default' enter sequence for region enum */
+void CKeywords::enseq_auto_loop_switch_case_enum_default()
+{
+	/* 'default' enter sequence for region enum */
+	react_auto_loop_switch_case_enum__entry_Default();
+}
+
+/* deep enterSequence with history in child enum */
+void CKeywords::dhenseq_auto_loop_switch_case_enum()
+{
+	/* deep enterSequence with history in child enum */
+	/* Handle deep history entry of enum */
+	switch(historyVector[ 1 ])
+	{
+		case auto_loop_switch_case_enum_asm :
+		{
+			/* enterSequence with history in child asm for leaf asm */
+			enseq_auto_loop_switch_case_enum_asm_default();
+			break;
+		}
+		default: break;
+	}
+}
+
+/* Default exit sequence for state char */
+void CKeywords::exseq_auto_char()
+{
+	/* Default exit sequence for state char */
+	stateConfVector[0] = CKeywords_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for state asm */
+void CKeywords::exseq_auto_loop_switch_case_enum_asm()
+{
+	/* Default exit sequence for state asm */
+	stateConfVector[0] = CKeywords_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for region auto */
+void CKeywords::exseq_auto()
+{
+	/* Default exit sequence for region auto */
+	/* Handle exit of all possible states (of CKeywords.auto) at position 0... */
+	switch(stateConfVector[ 0 ])
+	{
+		case auto_char :
+		{
+			exseq_auto_char();
+			break;
+		}
+		case auto_loop_switch_case_enum_asm :
+		{
+			exseq_auto_loop_switch_case_enum_asm();
+			break;
+		}
+		default: break;
+	}
+}
+
+/* Default exit sequence for region switch */
+void CKeywords::exseq_auto_loop_switch()
+{
+	/* Default exit sequence for region switch */
+	/* Handle exit of all possible states (of CKeywords.auto.loop.switch) at position 0... */
+	switch(stateConfVector[ 0 ])
+	{
+		case auto_loop_switch_case_enum_asm :
+		{
+			exseq_auto_loop_switch_case_enum_asm();
+			break;
+		}
+		default: break;
+	}
+}
+
+/* Default exit sequence for region enum */
+void CKeywords::exseq_auto_loop_switch_case_enum()
+{
+	/* Default exit sequence for region enum */
+	/* Handle exit of all possible states (of CKeywords.auto.loop.switch.case.enum) at position 0... */
+	switch(stateConfVector[ 0 ])
+	{
+		case auto_loop_switch_case_enum_asm :
+		{
+			exseq_auto_loop_switch_case_enum_asm();
+			break;
+		}
+		default: break;
+	}
+}
+
+/* The reactions of state char. */
+void CKeywords::react_auto_char()
+{
+	/* The reactions of state char. */
+	if (check_auto_char_tr0_tr0())
+	{ 
+		effect_auto_char_tr0();
+	} 
+}
+
+/* The reactions of state asm. */
+void CKeywords::react_auto_loop_switch_case_enum_asm()
+{
+	/* The reactions of state asm. */
+}
+
+/* Default react sequence for initial entry  */
+void CKeywords::react_auto__entry_Default()
+{
+	/* Default react sequence for initial entry  */
+	enseq_auto_char_default();
+}
+
+/* Default react sequence for shallow history entry  */
+void CKeywords::react_auto_loop_switch__entry_Default()
+{
+	/* Default react sequence for shallow history entry  */
+	/* Enter the region with shallow history */
+	if (historyVector[0] != CKeywords_last_state)
+	{
+		shenseq_auto_loop_switch();
+	} else
+	{
+		enseq_auto_loop_switch_case_default();
+	} 
+}
+
+/* Default react sequence for deep history entry  */
+void CKeywords::react_auto_loop_switch_case_enum__entry_Default()
+{
+	/* Default react sequence for deep history entry  */
+	/* Enter the region with deep history */
+	if (historyVector[1] != CKeywords_last_state)
+	{
+		dhenseq_auto_loop_switch_case_enum();
+	} else
+	{
+		enseq_auto_loop_switch_case_enum_asm_default();
+	} 
+}
+
+

+ 470 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CKeywordsTest/CKeywords.h

@@ -0,0 +1,470 @@
+
+#ifndef CKEYWORDS_H_
+#define CKEYWORDS_H_
+
+#include "sc_types.h"
+#include "StatemachineInterface.h"
+
+/*! \file Header of the state machine 'CKeywords'.
+*/
+
+class CKeywords : public StatemachineInterface
+{
+	
+	public:
+		
+		CKeywords();
+		
+		~CKeywords();
+		
+		/*! Enumeration of all states */ 
+		typedef enum
+		{
+			auto_char,
+			auto_loop,
+			auto_loop_switch_case,
+			auto_loop_switch_case_enum_asm,
+			CKeywords_last_state
+		} CKeywordsStates;
+		
+		//! Inner class for default interface scope.
+		class DefaultSCI
+		{
+			
+			public:
+				/*! Raises the in event 'auto' that is defined in the default interface scope. */
+				void raise_auto();
+				
+				/*! Raises the in event 'break' that is defined in the default interface scope. */
+				void raise_break();
+				
+				/*! Gets the value of the variable 'case' that is defined in the default interface scope. */
+				sc_boolean get_case() const;
+				
+				/*! Sets the value of the variable 'case' that is defined in the default interface scope. */
+				void set_case(sc_boolean value);
+				
+				/*! Gets the value of the variable 'do' that is defined in the default interface scope. */
+				sc_integer get_do() const;
+				
+				/*! Sets the value of the variable 'do' that is defined in the default interface scope. */
+				void set_do(sc_integer value);
+				
+				/*! Gets the value of the variable 'continue' that is defined in the default interface scope. */
+				sc_boolean get_continue() const;
+				
+				/*! Sets the value of the variable 'continue' that is defined in the default interface scope. */
+				void set_continue(sc_boolean value);
+				
+				/*! Gets the value of the variable 'double' that is defined in the default interface scope. */
+				sc_boolean get_double() const;
+				
+				/*! Sets the value of the variable 'double' that is defined in the default interface scope. */
+				void set_double(sc_boolean value);
+				
+				/*! Gets the value of the variable 'enum' that is defined in the default interface scope. */
+				sc_boolean get_enum() const;
+				
+				/*! Sets the value of the variable 'enum' that is defined in the default interface scope. */
+				void set_enum(sc_boolean value);
+				
+				/*! Gets the value of the variable 'extern' that is defined in the default interface scope. */
+				sc_boolean get_extern() const;
+				
+				/*! Sets the value of the variable 'extern' that is defined in the default interface scope. */
+				void set_extern(sc_boolean value);
+				
+				/*! Gets the value of the variable 'float' that is defined in the default interface scope. */
+				sc_boolean get_float() const;
+				
+				/*! Sets the value of the variable 'float' that is defined in the default interface scope. */
+				void set_float(sc_boolean value);
+				
+				/*! Gets the value of the variable 'for' that is defined in the default interface scope. */
+				sc_boolean get_for() const;
+				
+				/*! Sets the value of the variable 'for' that is defined in the default interface scope. */
+				void set_for(sc_boolean value);
+				
+				/*! Gets the value of the variable 'goto' that is defined in the default interface scope. */
+				sc_boolean get_goto() const;
+				
+				/*! Sets the value of the variable 'goto' that is defined in the default interface scope. */
+				void set_goto(sc_boolean value);
+				
+				/*! Gets the value of the variable 'if' that is defined in the default interface scope. */
+				sc_boolean get_if() const;
+				
+				/*! Sets the value of the variable 'if' that is defined in the default interface scope. */
+				void set_if(sc_boolean value);
+				
+				/*! Gets the value of the variable 'int' that is defined in the default interface scope. */
+				sc_boolean get_int() const;
+				
+				/*! Sets the value of the variable 'int' that is defined in the default interface scope. */
+				void set_int(sc_boolean value);
+				
+				/*! Gets the value of the variable 'long' that is defined in the default interface scope. */
+				sc_boolean get_long() const;
+				
+				/*! Sets the value of the variable 'long' that is defined in the default interface scope. */
+				void set_long(sc_boolean value);
+				
+				/*! Gets the value of the variable 'register' that is defined in the default interface scope. */
+				sc_boolean get_register() const;
+				
+				/*! Sets the value of the variable 'register' that is defined in the default interface scope. */
+				void set_register(sc_boolean value);
+				
+				/*! Gets the value of the variable 'return' that is defined in the default interface scope. */
+				sc_boolean get_return() const;
+				
+				/*! Sets the value of the variable 'return' that is defined in the default interface scope. */
+				void set_return(sc_boolean value);
+				
+				/*! Gets the value of the variable 'short' that is defined in the default interface scope. */
+				sc_boolean get_short() const;
+				
+				/*! Sets the value of the variable 'short' that is defined in the default interface scope. */
+				void set_short(sc_boolean value);
+				
+				/*! Gets the value of the variable 'signed' that is defined in the default interface scope. */
+				sc_boolean get_signed() const;
+				
+				/*! Sets the value of the variable 'signed' that is defined in the default interface scope. */
+				void set_signed(sc_boolean value);
+				
+				/*! Gets the value of the variable 'sizeof' that is defined in the default interface scope. */
+				sc_boolean get_sizeof() const;
+				
+				/*! Sets the value of the variable 'sizeof' that is defined in the default interface scope. */
+				void set_sizeof(sc_boolean value);
+				
+				/*! Gets the value of the variable 'static' that is defined in the default interface scope. */
+				sc_boolean get_static() const;
+				
+				/*! Sets the value of the variable 'static' that is defined in the default interface scope. */
+				void set_static(sc_boolean value);
+				
+				/*! Gets the value of the variable 'struct' that is defined in the default interface scope. */
+				sc_boolean get_struct() const;
+				
+				/*! Sets the value of the variable 'struct' that is defined in the default interface scope. */
+				void set_struct(sc_boolean value);
+				
+				/*! Gets the value of the variable 'switch' that is defined in the default interface scope. */
+				sc_boolean get_switch() const;
+				
+				/*! Sets the value of the variable 'switch' that is defined in the default interface scope. */
+				void set_switch(sc_boolean value);
+				
+				/*! Gets the value of the variable 'typedef' that is defined in the default interface scope. */
+				sc_boolean get_typedef() const;
+				
+				/*! Sets the value of the variable 'typedef' that is defined in the default interface scope. */
+				void set_typedef(sc_boolean value);
+				
+				/*! Gets the value of the variable 'union' that is defined in the default interface scope. */
+				sc_boolean get_union() const;
+				
+				/*! Sets the value of the variable 'union' that is defined in the default interface scope. */
+				void set_union(sc_boolean value);
+				
+				/*! Gets the value of the variable 'unsigned' that is defined in the default interface scope. */
+				sc_boolean get_unsigned() const;
+				
+				/*! Sets the value of the variable 'unsigned' that is defined in the default interface scope. */
+				void set_unsigned(sc_boolean value);
+				
+				/*! Gets the value of the variable 'void' that is defined in the default interface scope. */
+				sc_boolean get_void() const;
+				
+				/*! Sets the value of the variable 'void' that is defined in the default interface scope. */
+				void set_void(sc_boolean value);
+				
+				/*! Gets the value of the variable 'volatile' that is defined in the default interface scope. */
+				sc_boolean get_volatile() const;
+				
+				/*! Sets the value of the variable 'volatile' that is defined in the default interface scope. */
+				void set_volatile(sc_boolean value);
+				
+				/*! Gets the value of the variable 'while' that is defined in the default interface scope. */
+				sc_boolean get_while() const;
+				
+				/*! Sets the value of the variable 'while' that is defined in the default interface scope. */
+				void set_while(sc_boolean value);
+				
+				
+			private:
+				friend class CKeywords;
+				sc_boolean auto_raised;
+				sc_boolean break_raised;
+				sc_boolean case_ID;
+				sc_integer do_ID;
+				sc_boolean continue_ID;
+				sc_boolean double_ID;
+				sc_boolean enum_ID;
+				sc_boolean extern_ID;
+				sc_boolean float_ID;
+				sc_boolean for_ID;
+				sc_boolean goto_ID;
+				sc_boolean if_ID;
+				sc_boolean int_ID;
+				sc_boolean long_ID;
+				sc_boolean register_ID;
+				sc_boolean return_ID;
+				sc_boolean short_ID;
+				sc_boolean signed_ID;
+				sc_boolean sizeof_ID;
+				sc_boolean static_ID;
+				sc_boolean struct_ID;
+				sc_boolean switch_ID;
+				sc_boolean typedef_ID;
+				sc_boolean union_ID;
+				sc_boolean unsigned_ID;
+				sc_boolean void_ID;
+				sc_boolean volatile_ID;
+				sc_boolean while_ID;
+		};
+				
+		
+		/*! Returns an instance of the interface class 'DefaultSCI'. */
+		DefaultSCI* getDefaultSCI();
+		
+		/*! Raises the in event 'auto' that is defined in the default interface scope. */
+		void raise_auto();
+		
+		/*! Raises the in event 'break' that is defined in the default interface scope. */
+		void raise_break();
+		
+		/*! Gets the value of the variable 'case' that is defined in the default interface scope. */
+		sc_boolean get_case() const;
+		
+		/*! Sets the value of the variable 'case' that is defined in the default interface scope. */
+		void set_case(sc_boolean value);
+		
+		/*! Gets the value of the variable 'do' that is defined in the default interface scope. */
+		sc_integer get_do() const;
+		
+		/*! Sets the value of the variable 'do' that is defined in the default interface scope. */
+		void set_do(sc_integer value);
+		
+		/*! Gets the value of the variable 'continue' that is defined in the default interface scope. */
+		sc_boolean get_continue() const;
+		
+		/*! Sets the value of the variable 'continue' that is defined in the default interface scope. */
+		void set_continue(sc_boolean value);
+		
+		/*! Gets the value of the variable 'double' that is defined in the default interface scope. */
+		sc_boolean get_double() const;
+		
+		/*! Sets the value of the variable 'double' that is defined in the default interface scope. */
+		void set_double(sc_boolean value);
+		
+		/*! Gets the value of the variable 'enum' that is defined in the default interface scope. */
+		sc_boolean get_enum() const;
+		
+		/*! Sets the value of the variable 'enum' that is defined in the default interface scope. */
+		void set_enum(sc_boolean value);
+		
+		/*! Gets the value of the variable 'extern' that is defined in the default interface scope. */
+		sc_boolean get_extern() const;
+		
+		/*! Sets the value of the variable 'extern' that is defined in the default interface scope. */
+		void set_extern(sc_boolean value);
+		
+		/*! Gets the value of the variable 'float' that is defined in the default interface scope. */
+		sc_boolean get_float() const;
+		
+		/*! Sets the value of the variable 'float' that is defined in the default interface scope. */
+		void set_float(sc_boolean value);
+		
+		/*! Gets the value of the variable 'for' that is defined in the default interface scope. */
+		sc_boolean get_for() const;
+		
+		/*! Sets the value of the variable 'for' that is defined in the default interface scope. */
+		void set_for(sc_boolean value);
+		
+		/*! Gets the value of the variable 'goto' that is defined in the default interface scope. */
+		sc_boolean get_goto() const;
+		
+		/*! Sets the value of the variable 'goto' that is defined in the default interface scope. */
+		void set_goto(sc_boolean value);
+		
+		/*! Gets the value of the variable 'if' that is defined in the default interface scope. */
+		sc_boolean get_if() const;
+		
+		/*! Sets the value of the variable 'if' that is defined in the default interface scope. */
+		void set_if(sc_boolean value);
+		
+		/*! Gets the value of the variable 'int' that is defined in the default interface scope. */
+		sc_boolean get_int() const;
+		
+		/*! Sets the value of the variable 'int' that is defined in the default interface scope. */
+		void set_int(sc_boolean value);
+		
+		/*! Gets the value of the variable 'long' that is defined in the default interface scope. */
+		sc_boolean get_long() const;
+		
+		/*! Sets the value of the variable 'long' that is defined in the default interface scope. */
+		void set_long(sc_boolean value);
+		
+		/*! Gets the value of the variable 'register' that is defined in the default interface scope. */
+		sc_boolean get_register() const;
+		
+		/*! Sets the value of the variable 'register' that is defined in the default interface scope. */
+		void set_register(sc_boolean value);
+		
+		/*! Gets the value of the variable 'return' that is defined in the default interface scope. */
+		sc_boolean get_return() const;
+		
+		/*! Sets the value of the variable 'return' that is defined in the default interface scope. */
+		void set_return(sc_boolean value);
+		
+		/*! Gets the value of the variable 'short' that is defined in the default interface scope. */
+		sc_boolean get_short() const;
+		
+		/*! Sets the value of the variable 'short' that is defined in the default interface scope. */
+		void set_short(sc_boolean value);
+		
+		/*! Gets the value of the variable 'signed' that is defined in the default interface scope. */
+		sc_boolean get_signed() const;
+		
+		/*! Sets the value of the variable 'signed' that is defined in the default interface scope. */
+		void set_signed(sc_boolean value);
+		
+		/*! Gets the value of the variable 'sizeof' that is defined in the default interface scope. */
+		sc_boolean get_sizeof() const;
+		
+		/*! Sets the value of the variable 'sizeof' that is defined in the default interface scope. */
+		void set_sizeof(sc_boolean value);
+		
+		/*! Gets the value of the variable 'static' that is defined in the default interface scope. */
+		sc_boolean get_static() const;
+		
+		/*! Sets the value of the variable 'static' that is defined in the default interface scope. */
+		void set_static(sc_boolean value);
+		
+		/*! Gets the value of the variable 'struct' that is defined in the default interface scope. */
+		sc_boolean get_struct() const;
+		
+		/*! Sets the value of the variable 'struct' that is defined in the default interface scope. */
+		void set_struct(sc_boolean value);
+		
+		/*! Gets the value of the variable 'switch' that is defined in the default interface scope. */
+		sc_boolean get_switch() const;
+		
+		/*! Sets the value of the variable 'switch' that is defined in the default interface scope. */
+		void set_switch(sc_boolean value);
+		
+		/*! Gets the value of the variable 'typedef' that is defined in the default interface scope. */
+		sc_boolean get_typedef() const;
+		
+		/*! Sets the value of the variable 'typedef' that is defined in the default interface scope. */
+		void set_typedef(sc_boolean value);
+		
+		/*! Gets the value of the variable 'union' that is defined in the default interface scope. */
+		sc_boolean get_union() const;
+		
+		/*! Sets the value of the variable 'union' that is defined in the default interface scope. */
+		void set_union(sc_boolean value);
+		
+		/*! Gets the value of the variable 'unsigned' that is defined in the default interface scope. */
+		sc_boolean get_unsigned() const;
+		
+		/*! Sets the value of the variable 'unsigned' that is defined in the default interface scope. */
+		void set_unsigned(sc_boolean value);
+		
+		/*! Gets the value of the variable 'void' that is defined in the default interface scope. */
+		sc_boolean get_void() const;
+		
+		/*! Sets the value of the variable 'void' that is defined in the default interface scope. */
+		void set_void(sc_boolean value);
+		
+		/*! Gets the value of the variable 'volatile' that is defined in the default interface scope. */
+		sc_boolean get_volatile() const;
+		
+		/*! Sets the value of the variable 'volatile' that is defined in the default interface scope. */
+		void set_volatile(sc_boolean value);
+		
+		/*! Gets the value of the variable 'while' that is defined in the default interface scope. */
+		sc_boolean get_while() const;
+		
+		/*! Sets the value of the variable 'while' that is defined in the default interface scope. */
+		void set_while(sc_boolean value);
+		
+		
+		/*
+		 * Functions inherited from StatemachineInterface
+		 */
+		virtual void init();
+		
+		virtual void enter();
+		
+		virtual void exit();
+		
+		virtual void runCycle();
+		
+		/*!
+		* Checks if the state machine is active (until 2.4.1 this method was used for states).
+		* A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+		*/
+		virtual sc_boolean isActive() const;
+		
+		
+		/*!
+		* Checks if all active states are final. 
+		* If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+		*/
+		virtual sc_boolean isFinal() const;
+		
+		
+		/*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
+		sc_boolean isStateActive(CKeywordsStates state) const;
+	
+	private:
+	
+	
+		//! the maximum number of orthogonal states defines the dimension of the state configuration vector.
+		static const sc_integer maxOrthogonalStates = 1;
+		//! dimension of the state configuration vector for history states
+		static const sc_integer maxHistoryStates = 2;
+		
+		
+		CKeywordsStates stateConfVector[maxOrthogonalStates];
+		
+		CKeywordsStates historyVector[maxHistoryStates];
+		sc_ushort stateConfVectorPosition;
+		
+		DefaultSCI iface;
+		
+		// prototypes of all internal functions
+		
+		sc_boolean check_auto_char_tr0_tr0();
+		void effect_auto_char_tr0();
+		void enact_auto_char();
+		void enact_auto_loop_switch_case_enum_asm();
+		void enseq_auto_char_default();
+		void enseq_auto_loop_default();
+		void enseq_auto_loop_switch_case_default();
+		void enseq_auto_loop_switch_case_enum_asm_default();
+		void enseq_auto_default();
+		void enseq_auto_loop_switch_default();
+		void shenseq_auto_loop_switch();
+		void enseq_auto_loop_switch_case_enum_default();
+		void dhenseq_auto_loop_switch_case_enum();
+		void exseq_auto_char();
+		void exseq_auto_loop_switch_case_enum_asm();
+		void exseq_auto();
+		void exseq_auto_loop_switch();
+		void exseq_auto_loop_switch_case_enum();
+		void react_auto_char();
+		void react_auto_loop_switch_case_enum_asm();
+		void react_auto__entry_Default();
+		void react_auto_loop_switch__entry_Default();
+		void react_auto_loop_switch_case_enum__entry_Default();
+		void clearInEvents();
+		void clearOutEvents();
+		
+};
+#endif /* CKEYWORDS_H_ */

+ 24 - 5
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CKeywordsTest/CKeywordsTest.cc

@@ -1,5 +1,5 @@
 /**
-* Copyright (c) 2016 committers of YAKINDU and others.
+* Copyright (c) 2017 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
@@ -11,16 +11,35 @@
 #include <string>
 #include "gtest/gtest.h"
 #include "CKeywords.h"
+#include "sc_types.h"
+CKeywords* statechart;
 
-TEST(StatemachineTest, CKeywordsTest) {
-	CKeywords* statechart = new CKeywords();
-	statechart->init();
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		statechart = new CKeywords();
+		statechart->init();
+	}
+	virtual void TearDown() {
+		delete statechart;
+	}
+};
+
+TEST_F(StatemachineTest, CKeywordsTest) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->isStateActive(CKeywords::auto_char));
+	
 	statechart->raise_auto();
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(CKeywords::auto_loop));
+	
 	EXPECT_TRUE(statechart->isStateActive(CKeywords::auto_loop_switch_case));
+	
 	EXPECT_TRUE(statechart->isStateActive(CKeywords::auto_loop_switch_case_enum_asm));
-	delete statechart;
+	
 }

+ 42 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CKeywordsTest/StatemachineInterface.h

@@ -0,0 +1,42 @@
+
+#ifndef STATEMACHINEINTERFACE_H_
+#define STATEMACHINEINTERFACE_H_
+
+/*! \file Basic interface for state machines.
+ */
+class StatemachineInterface
+{
+	public:
+	
+		virtual ~StatemachineInterface() = 0;
+		
+		/*! Initializes the state machine. Used to initialize internal variables etc.
+		*/
+		virtual void init() = 0;
+	
+		/*! Enters the state machine. Sets the state machine into a defined state.
+		*/
+		virtual void enter() = 0;
+	
+		/*! Exits the state machine. Leaves the state machine with a defined state.
+		*/
+		virtual void exit() = 0;
+	
+		/*! Start a run-to-completion cycle.
+		*/
+		virtual void runCycle() = 0;
+		
+		/*! Checks whether the state machine is active. 
+	 	    A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+	 	*/	
+		virtual	sc_boolean isActive() const = 0;
+		
+		/*! Checks if all active states are final. 
+	 		If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+	 	*/
+		virtual sc_boolean isFinal() const = 0;
+};
+
+inline StatemachineInterface::~StatemachineInterface() {}
+
+#endif /* STATEMACHINEINTERFACE_H_ */

+ 24 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CKeywordsTest/sc_types.h

@@ -0,0 +1,24 @@
+
+#ifndef SC_TYPES_H_
+#define SC_TYPES_H_
+
+/* As <cstdint> is not available on all platforms we choose to include <stdint.h>. You can switch to <cstdint> by commenting and uncommenting the lines below.*/
+// #include <cstdint>
+#include <stdint.h>
+
+
+#define sc_string      char*
+
+typedef int_fast16_t   sc_short;
+typedef uint_fast16_t  sc_ushort;
+typedef int32_t        sc_integer;
+typedef double         sc_real;
+typedef bool           sc_boolean;
+
+typedef intptr_t       sc_eventid;
+
+#ifndef null
+	#define null 0
+#endif
+
+#endif /* SC_TYPES_H_ */

+ 319 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CastExpressionsTest/CastExpressions.cpp

@@ -0,0 +1,319 @@
+
+#include "CastExpressions.h"
+#include <string.h>
+
+/*! \file Implementation of the state machine 'CastExpressions'
+*/
+
+CastExpressions::CastExpressions()
+{
+	
+	
+	stateConfVectorPosition = 0;
+	
+}
+
+CastExpressions::~CastExpressions()
+{
+}
+
+
+void CastExpressions::init()
+{
+	for (int i = 0; i < maxOrthogonalStates; ++i)
+		stateConfVector[i] = CastExpressions_last_state;
+	
+	stateConfVectorPosition = 0;
+
+	clearInEvents();
+	clearOutEvents();
+	
+	/* Default init sequence for statechart CastExpressions */
+	iface.realValue = (((sc_real) 5));
+	iface.intValue = (((sc_integer) 5.5));
+}
+
+void CastExpressions::enter()
+{
+	/* Default enter sequence for statechart CastExpressions */
+	enseq_main_region_default();
+}
+
+void CastExpressions::exit()
+{
+	/* Default exit sequence for statechart CastExpressions */
+	exseq_main_region();
+}
+
+sc_boolean CastExpressions::isActive() const
+{
+	return stateConfVector[0] != CastExpressions_last_state;
+}
+
+/* 
+ * Always returns 'false' since this state machine can never become final.
+ */
+sc_boolean CastExpressions::isFinal() const
+{
+   return false;}
+
+void CastExpressions::runCycle()
+{
+	
+	clearOutEvents();
+	
+	for (stateConfVectorPosition = 0;
+		stateConfVectorPosition < maxOrthogonalStates;
+		stateConfVectorPosition++)
+		{
+			
+		switch (stateConfVector[stateConfVectorPosition])
+		{
+		case main_region_A :
+		{
+			react_main_region_A();
+			break;
+		}
+		case main_region_B :
+		{
+			react_main_region_B();
+			break;
+		}
+		case main_region_C :
+		{
+			react_main_region_C();
+			break;
+		}
+		default:
+			break;
+		}
+	}
+	
+	clearInEvents();
+}
+
+void CastExpressions::clearInEvents()
+{
+}
+
+void CastExpressions::clearOutEvents()
+{
+}
+
+
+sc_boolean CastExpressions::isStateActive(CastExpressionsStates state) const
+{
+	switch (state)
+	{
+		case main_region_A : 
+			return (sc_boolean) (stateConfVector[0] == main_region_A
+			);
+		case main_region_B : 
+			return (sc_boolean) (stateConfVector[0] == main_region_B
+			);
+		case main_region_C : 
+			return (sc_boolean) (stateConfVector[0] == main_region_C
+			);
+		default: return false;
+	}
+}
+
+CastExpressions::DefaultSCI* CastExpressions::getDefaultSCI()
+{
+	return &iface;
+}
+
+
+sc_real CastExpressions::DefaultSCI::get_realValue() const
+{
+	return realValue;
+}
+
+sc_real CastExpressions::get_realValue() const
+{
+	return iface.realValue;
+}
+
+void CastExpressions::DefaultSCI::set_realValue(sc_real value)
+{
+	realValue = value;
+}
+
+void CastExpressions::set_realValue(sc_real value)
+{
+	iface.realValue = value;
+}
+
+sc_integer CastExpressions::DefaultSCI::get_intValue() const
+{
+	return intValue;
+}
+
+sc_integer CastExpressions::get_intValue() const
+{
+	return iface.intValue;
+}
+
+void CastExpressions::DefaultSCI::set_intValue(sc_integer value)
+{
+	intValue = value;
+}
+
+void CastExpressions::set_intValue(sc_integer value)
+{
+	iface.intValue = value;
+}
+
+
+// implementations of all internal functions
+
+sc_boolean CastExpressions::check_main_region_A_tr0_tr0()
+{
+	return true;
+}
+
+sc_boolean CastExpressions::check_main_region_B_tr0_tr0()
+{
+	return (true) && (((sc_real) (iface.realValue * 0.1)) > ((sc_integer) 1.4) && ((sc_integer) (iface.realValue * iface.intValue)) < ((sc_real) 100));
+}
+
+void CastExpressions::effect_main_region_A_tr0()
+{
+	exseq_main_region_A();
+	enseq_main_region_B_default();
+}
+
+void CastExpressions::effect_main_region_B_tr0()
+{
+	exseq_main_region_B();
+	enseq_main_region_C_default();
+}
+
+/* Entry action for state 'B'. */
+void CastExpressions::enact_main_region_B()
+{
+	/* Entry action for state 'B'. */
+	iface.realValue = 3 * ((sc_integer) 5.5);
+}
+
+/* Entry action for state 'C'. */
+void CastExpressions::enact_main_region_C()
+{
+	/* Entry action for state 'C'. */
+	iface.realValue = ((sc_integer) (iface.realValue * iface.intValue * 10.1));
+}
+
+/* 'default' enter sequence for state A */
+void CastExpressions::enseq_main_region_A_default()
+{
+	/* 'default' enter sequence for state A */
+	stateConfVector[0] = main_region_A;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for state B */
+void CastExpressions::enseq_main_region_B_default()
+{
+	/* 'default' enter sequence for state B */
+	enact_main_region_B();
+	stateConfVector[0] = main_region_B;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for state C */
+void CastExpressions::enseq_main_region_C_default()
+{
+	/* 'default' enter sequence for state C */
+	enact_main_region_C();
+	stateConfVector[0] = main_region_C;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for region main region */
+void CastExpressions::enseq_main_region_default()
+{
+	/* 'default' enter sequence for region main region */
+	react_main_region__entry_Default();
+}
+
+/* Default exit sequence for state A */
+void CastExpressions::exseq_main_region_A()
+{
+	/* Default exit sequence for state A */
+	stateConfVector[0] = CastExpressions_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for state B */
+void CastExpressions::exseq_main_region_B()
+{
+	/* Default exit sequence for state B */
+	stateConfVector[0] = CastExpressions_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for state C */
+void CastExpressions::exseq_main_region_C()
+{
+	/* Default exit sequence for state C */
+	stateConfVector[0] = CastExpressions_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for region main region */
+void CastExpressions::exseq_main_region()
+{
+	/* Default exit sequence for region main region */
+	/* Handle exit of all possible states (of CastExpressions.main_region) at position 0... */
+	switch(stateConfVector[ 0 ])
+	{
+		case main_region_A :
+		{
+			exseq_main_region_A();
+			break;
+		}
+		case main_region_B :
+		{
+			exseq_main_region_B();
+			break;
+		}
+		case main_region_C :
+		{
+			exseq_main_region_C();
+			break;
+		}
+		default: break;
+	}
+}
+
+/* The reactions of state A. */
+void CastExpressions::react_main_region_A()
+{
+	/* The reactions of state A. */
+	effect_main_region_A_tr0();
+}
+
+/* The reactions of state B. */
+void CastExpressions::react_main_region_B()
+{
+	/* The reactions of state B. */
+	if (check_main_region_B_tr0_tr0())
+	{ 
+		effect_main_region_B_tr0();
+	} 
+}
+
+/* The reactions of state C. */
+void CastExpressions::react_main_region_C()
+{
+	/* The reactions of state C. */
+}
+
+/* Default react sequence for initial entry  */
+void CastExpressions::react_main_region__entry_Default()
+{
+	/* Default react sequence for initial entry  */
+	enseq_main_region_A_default();
+}
+
+

+ 135 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CastExpressionsTest/CastExpressions.h

@@ -0,0 +1,135 @@
+
+#ifndef CASTEXPRESSIONS_H_
+#define CASTEXPRESSIONS_H_
+
+#include "sc_types.h"
+#include "StatemachineInterface.h"
+
+/*! \file Header of the state machine 'CastExpressions'.
+*/
+
+class CastExpressions : public StatemachineInterface
+{
+	
+	public:
+		
+		CastExpressions();
+		
+		~CastExpressions();
+		
+		/*! Enumeration of all states */ 
+		typedef enum
+		{
+			main_region_A,
+			main_region_B,
+			main_region_C,
+			CastExpressions_last_state
+		} CastExpressionsStates;
+		
+		//! Inner class for default interface scope.
+		class DefaultSCI
+		{
+			
+			public:
+				/*! Gets the value of the variable 'realValue' that is defined in the default interface scope. */
+				sc_real get_realValue() const;
+				
+				/*! Sets the value of the variable 'realValue' that is defined in the default interface scope. */
+				void set_realValue(sc_real value);
+				
+				/*! Gets the value of the variable 'intValue' that is defined in the default interface scope. */
+				sc_integer get_intValue() const;
+				
+				/*! Sets the value of the variable 'intValue' that is defined in the default interface scope. */
+				void set_intValue(sc_integer value);
+				
+				
+			private:
+				friend class CastExpressions;
+				sc_real realValue;
+				sc_integer intValue;
+		};
+				
+		
+		/*! Returns an instance of the interface class 'DefaultSCI'. */
+		DefaultSCI* getDefaultSCI();
+		
+		/*! Gets the value of the variable 'realValue' that is defined in the default interface scope. */
+		sc_real get_realValue() const;
+		
+		/*! Sets the value of the variable 'realValue' that is defined in the default interface scope. */
+		void set_realValue(sc_real value);
+		
+		/*! Gets the value of the variable 'intValue' that is defined in the default interface scope. */
+		sc_integer get_intValue() const;
+		
+		/*! Sets the value of the variable 'intValue' that is defined in the default interface scope. */
+		void set_intValue(sc_integer value);
+		
+		
+		/*
+		 * Functions inherited from StatemachineInterface
+		 */
+		virtual void init();
+		
+		virtual void enter();
+		
+		virtual void exit();
+		
+		virtual void runCycle();
+		
+		/*!
+		* Checks if the state machine is active (until 2.4.1 this method was used for states).
+		* A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+		*/
+		virtual sc_boolean isActive() const;
+		
+		
+		/*!
+		* Checks if all active states are final. 
+		* If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+		*/
+		virtual sc_boolean isFinal() const;
+		
+		
+		/*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
+		sc_boolean isStateActive(CastExpressionsStates state) const;
+	
+	private:
+	
+	
+		//! the maximum number of orthogonal states defines the dimension of the state configuration vector.
+		static const sc_integer maxOrthogonalStates = 1;
+		
+		
+		CastExpressionsStates stateConfVector[maxOrthogonalStates];
+		
+		sc_ushort stateConfVectorPosition;
+		
+		DefaultSCI iface;
+		
+		// prototypes of all internal functions
+		
+		sc_boolean check_main_region_A_tr0_tr0();
+		sc_boolean check_main_region_B_tr0_tr0();
+		void effect_main_region_A_tr0();
+		void effect_main_region_B_tr0();
+		void enact_main_region_B();
+		void enact_main_region_C();
+		void enseq_main_region_A_default();
+		void enseq_main_region_B_default();
+		void enseq_main_region_C_default();
+		void enseq_main_region_default();
+		void exseq_main_region_A();
+		void exseq_main_region_B();
+		void exseq_main_region_C();
+		void exseq_main_region();
+		void react_main_region_A();
+		void react_main_region_B();
+		void react_main_region_C();
+		void react_main_region__entry_Default();
+		void clearInEvents();
+		void clearOutEvents();
+		
+};
+#endif /* CASTEXPRESSIONS_H_ */

+ 25 - 5
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CastExpressionsTest/CastExpressionsTest.cc

@@ -1,5 +1,5 @@
 /**
-* Copyright (c) 2016 committers of YAKINDU and others.
+* Copyright (c) 2017 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
@@ -11,17 +11,37 @@
 #include <string>
 #include "gtest/gtest.h"
 #include "CastExpressions.h"
+#include "sc_types.h"
+CastExpressions* statechart;
 
-TEST(StatemachineTest, CastExpressionTest) {
-	CastExpressions* statechart = new CastExpressions();
-	statechart->init();
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		statechart = new CastExpressions();
+		statechart->init();
+	}
+	virtual void TearDown() {
+		delete statechart;
+	}
+};
+
+TEST_F(StatemachineTest, CastExpressionTest) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_realValue()== 5l);
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_intValue()== 5l);
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_realValue()== 15l);
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(CastExpressions::main_region_C));
+	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_realValue()== 757l);
-	delete statechart;
+	
 }

+ 42 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CastExpressionsTest/StatemachineInterface.h

@@ -0,0 +1,42 @@
+
+#ifndef STATEMACHINEINTERFACE_H_
+#define STATEMACHINEINTERFACE_H_
+
+/*! \file Basic interface for state machines.
+ */
+class StatemachineInterface
+{
+	public:
+	
+		virtual ~StatemachineInterface() = 0;
+		
+		/*! Initializes the state machine. Used to initialize internal variables etc.
+		*/
+		virtual void init() = 0;
+	
+		/*! Enters the state machine. Sets the state machine into a defined state.
+		*/
+		virtual void enter() = 0;
+	
+		/*! Exits the state machine. Leaves the state machine with a defined state.
+		*/
+		virtual void exit() = 0;
+	
+		/*! Start a run-to-completion cycle.
+		*/
+		virtual void runCycle() = 0;
+		
+		/*! Checks whether the state machine is active. 
+	 	    A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+	 	*/	
+		virtual	sc_boolean isActive() const = 0;
+		
+		/*! Checks if all active states are final. 
+	 		If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+	 	*/
+		virtual sc_boolean isFinal() const = 0;
+};
+
+inline StatemachineInterface::~StatemachineInterface() {}
+
+#endif /* STATEMACHINEINTERFACE_H_ */

+ 24 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CastExpressionsTest/sc_types.h

@@ -0,0 +1,24 @@
+
+#ifndef SC_TYPES_H_
+#define SC_TYPES_H_
+
+/* As <cstdint> is not available on all platforms we choose to include <stdint.h>. You can switch to <cstdint> by commenting and uncommenting the lines below.*/
+// #include <cstdint>
+#include <stdint.h>
+
+
+#define sc_string      char*
+
+typedef int_fast16_t   sc_short;
+typedef uint_fast16_t  sc_ushort;
+typedef int32_t        sc_integer;
+typedef double         sc_real;
+typedef bool           sc_boolean;
+
+typedef intptr_t       sc_eventid;
+
+#ifndef null
+	#define null 0
+#endif
+
+#endif /* SC_TYPES_H_ */

+ 521 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ChoiceTest/Choice.cpp

@@ -0,0 +1,521 @@
+
+#include "Choice.h"
+#include <string.h>
+
+/*! \file Implementation of the state machine 'Choice'
+*/
+
+Choice::Choice()
+{
+	
+	
+	stateConfVectorPosition = 0;
+	
+}
+
+Choice::~Choice()
+{
+}
+
+
+void Choice::init()
+{
+	for (int i = 0; i < maxOrthogonalStates; ++i)
+		stateConfVector[i] = Choice_last_state;
+	
+	stateConfVectorPosition = 0;
+
+	clearInEvents();
+	clearOutEvents();
+	
+	/* Default init sequence for statechart Choice */
+	iface.c = false;
+}
+
+void Choice::enter()
+{
+	/* Default enter sequence for statechart Choice */
+	enseq_main_region_default();
+}
+
+void Choice::exit()
+{
+	/* Default exit sequence for statechart Choice */
+	exseq_main_region();
+}
+
+sc_boolean Choice::isActive() const
+{
+	return stateConfVector[0] != Choice_last_state;
+}
+
+/* 
+ * Always returns 'false' since this state machine can never become final.
+ */
+sc_boolean Choice::isFinal() const
+{
+   return false;}
+
+void Choice::runCycle()
+{
+	
+	clearOutEvents();
+	
+	for (stateConfVectorPosition = 0;
+		stateConfVectorPosition < maxOrthogonalStates;
+		stateConfVectorPosition++)
+		{
+			
+		switch (stateConfVector[stateConfVectorPosition])
+		{
+		case main_region_A :
+		{
+			react_main_region_A();
+			break;
+		}
+		case main_region_B :
+		{
+			react_main_region_B();
+			break;
+		}
+		case main_region_C :
+		{
+			react_main_region_C();
+			break;
+		}
+		default:
+			break;
+		}
+	}
+	
+	clearInEvents();
+}
+
+void Choice::clearInEvents()
+{
+	iface.e_raised = false;
+	iface.f_raised = false;
+	iface.g_raised = false;
+	iface.h_raised = false;
+}
+
+void Choice::clearOutEvents()
+{
+}
+
+
+sc_boolean Choice::isStateActive(ChoiceStates state) const
+{
+	switch (state)
+	{
+		case main_region_A : 
+			return (sc_boolean) (stateConfVector[0] == main_region_A
+			);
+		case main_region_B : 
+			return (sc_boolean) (stateConfVector[0] == main_region_B
+			);
+		case main_region_C : 
+			return (sc_boolean) (stateConfVector[0] == main_region_C
+			);
+		default: return false;
+	}
+}
+
+Choice::DefaultSCI* Choice::getDefaultSCI()
+{
+	return &iface;
+}
+
+void Choice::DefaultSCI::raise_e()
+{
+	e_raised = true;
+}
+
+void Choice::raise_e()
+{
+	iface.raise_e();
+}
+
+void Choice::DefaultSCI::raise_f()
+{
+	f_raised = true;
+}
+
+void Choice::raise_f()
+{
+	iface.raise_f();
+}
+
+void Choice::DefaultSCI::raise_g()
+{
+	g_raised = true;
+}
+
+void Choice::raise_g()
+{
+	iface.raise_g();
+}
+
+void Choice::DefaultSCI::raise_h()
+{
+	h_raised = true;
+}
+
+void Choice::raise_h()
+{
+	iface.raise_h();
+}
+
+
+sc_boolean Choice::DefaultSCI::get_c() const
+{
+	return c;
+}
+
+sc_boolean Choice::get_c() const
+{
+	return iface.c;
+}
+
+void Choice::DefaultSCI::set_c(sc_boolean value)
+{
+	c = value;
+}
+
+void Choice::set_c(sc_boolean value)
+{
+	iface.c = value;
+}
+
+
+// implementations of all internal functions
+
+sc_boolean Choice::check_main_region_A_tr0_tr0()
+{
+	return iface.e_raised;
+}
+
+sc_boolean Choice::check_main_region_A_tr1_tr1()
+{
+	return iface.f_raised;
+}
+
+sc_boolean Choice::check_main_region_A_tr2_tr2()
+{
+	return iface.g_raised;
+}
+
+sc_boolean Choice::check_main_region_A_tr3_tr3()
+{
+	return iface.h_raised;
+}
+
+sc_boolean Choice::check_main_region_B_tr0_tr0()
+{
+	return true;
+}
+
+sc_boolean Choice::check_main_region_C_tr0_tr0()
+{
+	return true;
+}
+
+sc_boolean Choice::check_main_region__choice_0_tr1_tr1()
+{
+	return iface.c;
+}
+
+sc_boolean Choice::check_main_region__choice_0_tr0_tr0()
+{
+	return true;
+}
+
+sc_boolean Choice::check_main_region__choice_1_tr0_tr0()
+{
+	return iface.c;
+}
+
+sc_boolean Choice::check_main_region__choice_1_tr1_tr1()
+{
+	return true;
+}
+
+sc_boolean Choice::check_main_region__choice_2_tr1_tr1()
+{
+	return iface.c;
+}
+
+sc_boolean Choice::check_main_region__choice_2_tr0()
+{
+	return true;
+}
+
+sc_boolean Choice::check_main_region__choice_3_tr1_tr1()
+{
+	return iface.c;
+}
+
+sc_boolean Choice::check_main_region__choice_3_tr0_tr0()
+{
+	return true;
+}
+
+void Choice::effect_main_region_A_tr0()
+{
+	exseq_main_region_A();
+	react_main_region__choice_0();
+}
+
+void Choice::effect_main_region_A_tr1()
+{
+	exseq_main_region_A();
+	react_main_region__choice_2();
+}
+
+void Choice::effect_main_region_A_tr2()
+{
+	exseq_main_region_A();
+	react_main_region__choice_1();
+}
+
+void Choice::effect_main_region_A_tr3()
+{
+	exseq_main_region_A();
+	react_main_region__choice_3();
+}
+
+void Choice::effect_main_region_B_tr0()
+{
+	exseq_main_region_B();
+	enseq_main_region_A_default();
+}
+
+void Choice::effect_main_region_C_tr0()
+{
+	exseq_main_region_C();
+	enseq_main_region_A_default();
+}
+
+void Choice::effect_main_region__choice_0_tr1()
+{
+	enseq_main_region_C_default();
+}
+
+void Choice::effect_main_region__choice_0_tr0()
+{
+	enseq_main_region_B_default();
+}
+
+void Choice::effect_main_region__choice_1_tr0()
+{
+	enseq_main_region_C_default();
+}
+
+void Choice::effect_main_region__choice_1_tr1()
+{
+	enseq_main_region_B_default();
+}
+
+void Choice::effect_main_region__choice_2_tr1()
+{
+	enseq_main_region_C_default();
+}
+
+void Choice::effect_main_region__choice_2_tr0()
+{
+	enseq_main_region_B_default();
+}
+
+void Choice::effect_main_region__choice_3_tr1()
+{
+	enseq_main_region_C_default();
+}
+
+void Choice::effect_main_region__choice_3_tr0()
+{
+	enseq_main_region_B_default();
+}
+
+/* 'default' enter sequence for state A */
+void Choice::enseq_main_region_A_default()
+{
+	/* 'default' enter sequence for state A */
+	stateConfVector[0] = main_region_A;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for state B */
+void Choice::enseq_main_region_B_default()
+{
+	/* 'default' enter sequence for state B */
+	stateConfVector[0] = main_region_B;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for state C */
+void Choice::enseq_main_region_C_default()
+{
+	/* 'default' enter sequence for state C */
+	stateConfVector[0] = main_region_C;
+	stateConfVectorPosition = 0;
+}
+
+/* 'default' enter sequence for region main region */
+void Choice::enseq_main_region_default()
+{
+	/* 'default' enter sequence for region main region */
+	react_main_region__entry_Default();
+}
+
+/* Default exit sequence for state A */
+void Choice::exseq_main_region_A()
+{
+	/* Default exit sequence for state A */
+	stateConfVector[0] = Choice_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for state B */
+void Choice::exseq_main_region_B()
+{
+	/* Default exit sequence for state B */
+	stateConfVector[0] = Choice_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for state C */
+void Choice::exseq_main_region_C()
+{
+	/* Default exit sequence for state C */
+	stateConfVector[0] = Choice_last_state;
+	stateConfVectorPosition = 0;
+}
+
+/* Default exit sequence for region main region */
+void Choice::exseq_main_region()
+{
+	/* Default exit sequence for region main region */
+	/* Handle exit of all possible states (of Choice.main_region) at position 0... */
+	switch(stateConfVector[ 0 ])
+	{
+		case main_region_A :
+		{
+			exseq_main_region_A();
+			break;
+		}
+		case main_region_B :
+		{
+			exseq_main_region_B();
+			break;
+		}
+		case main_region_C :
+		{
+			exseq_main_region_C();
+			break;
+		}
+		default: break;
+	}
+}
+
+/* The reactions of state A. */
+void Choice::react_main_region_A()
+{
+	/* The reactions of state A. */
+	if (check_main_region_A_tr0_tr0())
+	{ 
+		effect_main_region_A_tr0();
+	}  else
+	{
+		if (check_main_region_A_tr1_tr1())
+		{ 
+			effect_main_region_A_tr1();
+		}  else
+		{
+			if (check_main_region_A_tr2_tr2())
+			{ 
+				effect_main_region_A_tr2();
+			}  else
+			{
+				if (check_main_region_A_tr3_tr3())
+				{ 
+					effect_main_region_A_tr3();
+				} 
+			}
+		}
+	}
+}
+
+/* The reactions of state B. */
+void Choice::react_main_region_B()
+{
+	/* The reactions of state B. */
+	effect_main_region_B_tr0();
+}
+
+/* The reactions of state C. */
+void Choice::react_main_region_C()
+{
+	/* The reactions of state C. */
+	effect_main_region_C_tr0();
+}
+
+/* The reactions of state null. */
+void Choice::react_main_region__choice_0()
+{
+	/* The reactions of state null. */
+	if (check_main_region__choice_0_tr1_tr1())
+	{ 
+		effect_main_region__choice_0_tr1();
+	}  else
+	{
+		effect_main_region__choice_0_tr0();
+	}
+}
+
+/* The reactions of state null. */
+void Choice::react_main_region__choice_1()
+{
+	/* The reactions of state null. */
+	if (check_main_region__choice_1_tr0_tr0())
+	{ 
+		effect_main_region__choice_1_tr0();
+	}  else
+	{
+		effect_main_region__choice_1_tr1();
+	}
+}
+
+/* The reactions of state null. */
+void Choice::react_main_region__choice_2()
+{
+	/* The reactions of state null. */
+	if (check_main_region__choice_2_tr1_tr1())
+	{ 
+		effect_main_region__choice_2_tr1();
+	}  else
+	{
+		effect_main_region__choice_2_tr0();
+	}
+}
+
+/* The reactions of state null. */
+void Choice::react_main_region__choice_3()
+{
+	/* The reactions of state null. */
+	if (check_main_region__choice_3_tr1_tr1())
+	{ 
+		effect_main_region__choice_3_tr1();
+	}  else
+	{
+		effect_main_region__choice_3_tr0();
+	}
+}
+
+/* Default react sequence for initial entry  */
+void Choice::react_main_region__entry_Default()
+{
+	/* Default react sequence for initial entry  */
+	enseq_main_region_A_default();
+}
+
+

+ 176 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ChoiceTest/Choice.h

@@ -0,0 +1,176 @@
+
+#ifndef CHOICE_H_
+#define CHOICE_H_
+
+#include "sc_types.h"
+#include "StatemachineInterface.h"
+
+/*! \file Header of the state machine 'Choice'.
+*/
+
+class Choice : public StatemachineInterface
+{
+	
+	public:
+		
+		Choice();
+		
+		~Choice();
+		
+		/*! Enumeration of all states */ 
+		typedef enum
+		{
+			main_region_A,
+			main_region_B,
+			main_region_C,
+			Choice_last_state
+		} ChoiceStates;
+		
+		//! Inner class for default interface scope.
+		class DefaultSCI
+		{
+			
+			public:
+				/*! Raises the in event 'e' that is defined in the default interface scope. */
+				void raise_e();
+				
+				/*! Raises the in event 'f' that is defined in the default interface scope. */
+				void raise_f();
+				
+				/*! Raises the in event 'g' that is defined in the default interface scope. */
+				void raise_g();
+				
+				/*! Raises the in event 'h' that is defined in the default interface scope. */
+				void raise_h();
+				
+				/*! Gets the value of the variable 'c' that is defined in the default interface scope. */
+				sc_boolean get_c() const;
+				
+				/*! Sets the value of the variable 'c' that is defined in the default interface scope. */
+				void set_c(sc_boolean value);
+				
+				
+			private:
+				friend class Choice;
+				sc_boolean e_raised;
+				sc_boolean f_raised;
+				sc_boolean g_raised;
+				sc_boolean h_raised;
+				sc_boolean c;
+		};
+				
+		
+		/*! Returns an instance of the interface class 'DefaultSCI'. */
+		DefaultSCI* getDefaultSCI();
+		
+		/*! Raises the in event 'e' that is defined in the default interface scope. */
+		void raise_e();
+		
+		/*! Raises the in event 'f' that is defined in the default interface scope. */
+		void raise_f();
+		
+		/*! Raises the in event 'g' that is defined in the default interface scope. */
+		void raise_g();
+		
+		/*! Raises the in event 'h' that is defined in the default interface scope. */
+		void raise_h();
+		
+		/*! Gets the value of the variable 'c' that is defined in the default interface scope. */
+		sc_boolean get_c() const;
+		
+		/*! Sets the value of the variable 'c' that is defined in the default interface scope. */
+		void set_c(sc_boolean value);
+		
+		
+		/*
+		 * Functions inherited from StatemachineInterface
+		 */
+		virtual void init();
+		
+		virtual void enter();
+		
+		virtual void exit();
+		
+		virtual void runCycle();
+		
+		/*!
+		* Checks if the state machine is active (until 2.4.1 this method was used for states).
+		* A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
+		*/
+		virtual sc_boolean isActive() const;
+		
+		
+		/*!
+		* Checks if all active states are final. 
+		* If there are no active states then the state machine is considered being inactive. In this case this method returns false.
+		*/
+		virtual sc_boolean isFinal() const;
+		
+		
+		/*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
+		sc_boolean isStateActive(ChoiceStates state) const;
+	
+	private:
+	
+	
+		//! the maximum number of orthogonal states defines the dimension of the state configuration vector.
+		static const sc_integer maxOrthogonalStates = 1;
+		
+		
+		ChoiceStates stateConfVector[maxOrthogonalStates];
+		
+		sc_ushort stateConfVectorPosition;
+		
+		DefaultSCI iface;
+		
+		// prototypes of all internal functions
+		
+		sc_boolean check_main_region_A_tr0_tr0();
+		sc_boolean check_main_region_A_tr1_tr1();
+		sc_boolean check_main_region_A_tr2_tr2();
+		sc_boolean check_main_region_A_tr3_tr3();
+		sc_boolean check_main_region_B_tr0_tr0();
+		sc_boolean check_main_region_C_tr0_tr0();
+		sc_boolean check_main_region__choice_0_tr1_tr1();
+		sc_boolean check_main_region__choice_0_tr0_tr0();
+		sc_boolean check_main_region__choice_1_tr0_tr0();
+		sc_boolean check_main_region__choice_1_tr1_tr1();
+		sc_boolean check_main_region__choice_2_tr1_tr1();
+		sc_boolean check_main_region__choice_2_tr0();
+		sc_boolean check_main_region__choice_3_tr1_tr1();
+		sc_boolean check_main_region__choice_3_tr0_tr0();
+		void effect_main_region_A_tr0();
+		void effect_main_region_A_tr1();
+		void effect_main_region_A_tr2();
+		void effect_main_region_A_tr3();
+		void effect_main_region_B_tr0();
+		void effect_main_region_C_tr0();
+		void effect_main_region__choice_0_tr1();
+		void effect_main_region__choice_0_tr0();
+		void effect_main_region__choice_1_tr0();
+		void effect_main_region__choice_1_tr1();
+		void effect_main_region__choice_2_tr1();
+		void effect_main_region__choice_2_tr0();
+		void effect_main_region__choice_3_tr1();
+		void effect_main_region__choice_3_tr0();
+		void enseq_main_region_A_default();
+		void enseq_main_region_B_default();
+		void enseq_main_region_C_default();
+		void enseq_main_region_default();
+		void exseq_main_region_A();
+		void exseq_main_region_B();
+		void exseq_main_region_C();
+		void exseq_main_region();
+		void react_main_region_A();
+		void react_main_region_B();
+		void react_main_region_C();
+		void react_main_region__choice_0();
+		void react_main_region__choice_1();
+		void react_main_region__choice_2();
+		void react_main_region__choice_3();
+		void react_main_region__entry_Default();
+		void clearInEvents();
+		void clearOutEvents();
+		
+};
+#endif /* CHOICE_H_ */

+ 77 - 29
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ChoiceTest/ChoiceTest.cc

@@ -1,5 +1,5 @@
 /**
-* Copyright (c) 2016 committers of YAKINDU and others.
+* Copyright (c) 2017 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
@@ -11,81 +11,129 @@
 #include <string>
 #include "gtest/gtest.h"
 #include "Choice.h"
+#include "sc_types.h"
+Choice* statechart;
 
-TEST(StatemachineTest, elseChoiceUsingNonDefaultTransition) {
-	Choice* statechart = new Choice();
-	statechart->init();
+class StatemachineTest : public ::testing::Test{
+	protected:
+	virtual void SetUp() {
+		statechart = new Choice();
+		statechart->init();
+	}
+	virtual void TearDown() {
+		delete statechart;
+	}
+};
+
+TEST_F(StatemachineTest, elseChoiceUsingNonDefaultTransition) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
+	
 	statechart->getDefaultSCI()->set_c(true);
+	
 	statechart->raise_e();
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_C));
-	delete statechart;
+	
 }
-TEST(StatemachineTest, elseChoiceUsingDefaultTransition) {
-	Choice* statechart = new Choice();
-	statechart->init();
+TEST_F(StatemachineTest, elseChoiceUsingDefaultTransition) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
+	
 	statechart->getDefaultSCI()->set_c(false);
+	
 	statechart->raise_e();
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_B));
-	delete statechart;
+	
 }
-TEST(StatemachineTest, defaultChoiceUsingNonDefaultTransition) {
-	Choice* statechart = new Choice();
-	statechart->init();
+TEST_F(StatemachineTest, defaultChoiceUsingNonDefaultTransition) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
+	
 	statechart->getDefaultSCI()->set_c(true);
+	
 	statechart->raise_g();
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_C));
-	delete statechart;
+	
 }
-TEST(StatemachineTest, defaultChoiceUsingDefaultTransition) {
-	Choice* statechart = new Choice();
-	statechart->init();
+TEST_F(StatemachineTest, defaultChoiceUsingDefaultTransition) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
+	
 	statechart->getDefaultSCI()->set_c(false);
+	
 	statechart->raise_g();
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_B));
-	delete statechart;
+	
 }
-TEST(StatemachineTest, uncheckedChoiceUsingNonDefaultTransition) {
-	Choice* statechart = new Choice();
-	statechart->init();
+TEST_F(StatemachineTest, uncheckedChoiceUsingNonDefaultTransition) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
+	
 	statechart->getDefaultSCI()->set_c(true);
+	
 	statechart->raise_f();
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_C));
-	delete statechart;
+	
 }
-TEST(StatemachineTest, uncheckedChoiceUsingDefaultTransition) {
-	Choice* statechart = new Choice();
-	statechart->init();
+TEST_F(StatemachineTest, uncheckedChoiceUsingDefaultTransition) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
+	
 	statechart->getDefaultSCI()->set_c(false);
+	
 	statechart->raise_f();
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_B));
-	delete statechart;
+	
 }
-TEST(StatemachineTest, alwaysTrueTransitionInChoice) {
-	Choice* statechart = new Choice();
-	statechart->init();
+TEST_F(StatemachineTest, alwaysTrueTransitionInChoice) {
+	
+	
 	statechart->enter();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
+	
 	statechart->getDefaultSCI()->set_c(true);
+	
 	statechart->raise_h();
+	
 	statechart->runCycle();
+	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_C));
-	delete statechart;
+	
 }

+ 0 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ChoiceTest/StatemachineInterface.h


Some files were not shown because too many files changed in this diff