Explorar el Código

Refactored the SCTUnit tests with the new features and generated Tests (#1330)

jthoene hace 8 años
padre
commit
9fa713bb5f
Se han modificado 100 ficheros con 269 adiciones y 302 borrados
  1. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/AlwaysOncycleTest/AlwaysOncycleTest.cc
  2. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/AssignmentAsExpressionTest/AssignmentAsExpressionTest.cc
  3. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/BitExpressionsTest/BitExpressionsTest.cc
  4. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/BooleanExpressionsTest/BooleanExpressionsTest.cc
  5. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/CKeywordsTest/CKeywordsTest.cc
  6. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/CastExpressionsTest/CastExpressionsTest.cc
  7. 29 28
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ChoiceTest/ChoiceTest.cc
  8. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ConditionalExpression/ConditionalExpression.cc
  9. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstOnlyDefaultScopeTest/ConstOnlyDefaultScopeTest.cc
  10. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstOnlyInternalScopeTest/ConstOnlyInternalScopeTest.cc
  11. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstOnlyNamedScopeTest/ConstOnlyNamedScopeTest.cc
  12. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstantsTests/ConstantsTests.cc
  13. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/DeclarationsTest/DeclarationsTest.cc
  14. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/DeepEntryTest/DeepEntryTest.cc
  15. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/DeepHistoryTest/DeepHistoryTest.cc
  16. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/DynamicChoiceTest/DynamicChoiceTest.cc
  17. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/EmptyTransitionTest/EmptyTransitionTest.cc
  18. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/EnterStateTest/EnterStateTest.cc
  19. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/EntryChoiceTest/EntryChoiceTest.cc
  20. 6 5
      test-plugins/org.yakindu.sct.generator.c.test/gtests/EntryExitSelfTransitionTest/EntryExitSelfTransitionTest.cc
  21. 13 17
      test-plugins/org.yakindu.sct.generator.c.test/gtests/EntryReactionActionTest/EntryReactionActionTest.cc
  22. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ExitOnSelfTransitionTest/ExitOnSelfTransitionTest.cc
  23. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ExitStateTest/ExitStateTest.cc
  24. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/FeatureCallsTest/FeatureCallsTest.cc
  25. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/FinalStateTest/FinalStateTest.cc
  26. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/GuardTest/GuardTest.cc
  27. 15 20
      test-plugins/org.yakindu.sct.generator.c.test/gtests/GuardedEntryTest/GuardedEntryTest.cc
  28. 9 8
      test-plugins/org.yakindu.sct.generator.c.test/gtests/GuardedExitTest/GuardedExitTest.cc
  29. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/HistoryWithExitPointTest/HistoryWithExitPointTest.cc
  30. 7 9
      test-plugins/org.yakindu.sct.generator.c.test/gtests/HistoryWithoutInitialStepTest/HistoryWithoutInitialStepTest.cc
  31. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/InEventLifeCycleTest/InEventLifeCycleTest.cc
  32. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/IntegerExpressionsTest/IntegerExpressionsTest.cc
  33. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/InternalEventLifeCycleTest/InternalEventLifeCycleTest.cc
  34. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/LocalReactionsTest/LocalReactionsTest.cc
  35. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/LogicalAndTests/LogicalAndTests.cc
  36. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/LogicalOrTests/LogicalOrTests.cc
  37. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/NamedInterfaceAccessTest/NamedInterfaceAccessTest.cc
  38. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/NullCheckTest/NullCheckTest.cc
  39. 3 22
      test-plugins/org.yakindu.sct.generator.c.test/gtests/OperationsTest/OperationsTest.cc
  40. 12 11
      test-plugins/org.yakindu.sct.generator.c.test/gtests/OutEventLifeCycleTest/OutEventLifeCycleTest.cc
  41. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ParenthesisTest/ParenthesisTest.cc
  42. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/PriorityValuesTest/PriorityValuesTest.cc
  43. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/RaiseEventTest/RaiseEventTest.cc
  44. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ReadOnlyVariableTest/ReadOnlyVariableTest.cc
  45. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/STextKeywordsInStatesAndRegionsTest/STextKeywordsInStatesAndRegionsTest.cc
  46. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/SameNameDifferentRegionTest/SameNameDifferentRegionTest.cc
  47. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ShallowHistoryTest/ShallowHistoryTest.cc
  48. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ShallowHistoryWithDeepEntryTest/ShallowHistoryWithDeepEntryTest.cc
  49. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/SimpleEventTest/SimpleEventTest.cc
  50. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/SimpleHierachyTest/SimpleHierachyTest.cc
  51. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StateIsActiveTest/StateIsActiveTest.cc
  52. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StatechartActiveTest/StatechartActiveTest.cc
  53. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StatechartLocalReactionsTest/StatechartLocalReactionsTest.cc
  54. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StatemachineKeywords/StatemachineKeywords.cc
  55. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StaticChoiceTest/StaticChoiceTest.cc
  56. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StringExpressionsTest/StringExpressionsTest.cc
  57. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/SyncForkTest/SyncForkTest.cc
  58. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/SyncJoinTest/SyncJoinTest.cc
  59. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/TimedTransitionsTest/TimedTransitionsTest.cc
  60. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/TransitionWithoutConditionTest/TransitionWithoutConditionTest.cc
  61. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/TriggerExpressionPrecedenceTest/TriggerExpressionPrecedenceTest.cc
  62. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/TriggerGuardExpressionsTest/TriggerGuardExpressionsTest.cc
  63. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/TypeAliasTest/TypeAliasTest.cc
  64. 1 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/ValuedEventsTest/ValuedEventsTest.cc
  65. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AlwaysOncycleTest/AlwaysOncycleTest.cc
  66. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AssignmentAsExpressionTest/AssignmentAsExpressionTest.cc
  67. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BitExpressionsTest/BitExpressionsTest.cc
  68. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BooleanExpressionsTest/BooleanExpressionsTest.cc
  69. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CKeywordsTest/CKeywordsTest.cc
  70. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CastExpressionsTest/CastExpressionsTest.cc
  71. 35 62
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ChoiceTest/ChoiceTest.cc
  72. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ConditionalExpressionTest/ConditionalExpressionTest.cc
  73. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ConstOnlyDefaultScopeTest/ConstOnlyDefaultScopeTest.cc
  74. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ConstOnlyInternalScopeTest/ConstOnlyInternalScopeTest.cc
  75. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ConstOnlyNamedScopeTest/ConstOnlyNamedScopeTest.cc
  76. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ConstantsTestsTest/ConstantsTestsTest.cc
  77. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/DeclarationsTest/DeclarationsTest.cc
  78. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/DeepEntryTest/DeepEntryTest.cc
  79. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/DeepHistoryTest/DeepHistoryTest.cc
  80. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/DynamicChoiceTest/DynamicChoiceTest.cc
  81. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/EmptyTransitionTest/EmptyTransitionTest.cc
  82. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/EnterStateTest/EnterStateTest.cc
  83. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/EntryChoiceTest/EntryChoiceTest.cc
  84. 8 14
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/EntryExitSelfTransitionTest/EntryExitSelfTransitionTest.cc
  85. 14 34
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/EntryReactionActionTest/EntryReactionActionTest.cc
  86. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ExitOnSelfTransitionTest/ExitOnSelfTransitionTest.cc
  87. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ExitStateTest/ExitStateTest.cc
  88. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/FeatureCallsTest/FeatureCallsTest.cc
  89. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/FinalStateTest/FinalStateTest.cc
  90. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/GuardTest/GuardTest.cc
  91. 15 38
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/GuardedEntryTest/GuardedEntryTest.cc
  92. 9 14
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/GuardedExitTest/GuardedExitTest.cc
  93. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/HistoryWithExitPointTest/HistoryWithExitPointTest.cc
  94. 9 20
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/HistoryWithoutInitialStepTest/HistoryWithoutInitialStepTest.cc
  95. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/InEventLifeCycleTest/InEventLifeCycleTest.cc
  96. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/IntegerExpressionsTest/IntegerExpressionsTest.cc
  97. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/InternalEventLifeCycleTest/InternalEventLifeCycleTest.cc
  98. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/LocalReactionsTest/LocalReactionsTest.cc
  99. 1 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/LogicalAndTestsTest/LogicalAndTestsTest.cc
  100. 0 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/LogicalOrTestsTest/LogicalOrTestsTest.cc

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/AlwaysOncycleTest/AlwaysOncycleTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, alwaysOncycleTest) {					
 	alwaysOncycle_enter(&handle);
 	EXPECT_TRUE(alwaysOncycle_isStateActive(&handle, AlwaysOncycle_main_region_StateA));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/AssignmentAsExpressionTest/AssignmentAsExpressionTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, simpleAssignment) {					
 	assignmentAsExpression_enter(&handle);
 	EXPECT_TRUE(assignmentAsExpression_isStateActive(&handle, AssignmentAsExpression_main_region_Add));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/BitExpressionsTest/BitExpressionsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, BitExpressions) {					
 	bitExpressions_enter(&handle);
 	EXPECT_TRUE(bitExpressions_isStateActive(&handle, BitExpressions_main_region_StateA));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/BooleanExpressionsTest/BooleanExpressionsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, booleanExpressions) {					
 	booleanExpressions_enter(&handle);
 	EXPECT_TRUE(booleanExpressions_isStateActive(&handle, BooleanExpressions_main_region_StateA));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/CKeywordsTest/CKeywordsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, CKeywordsTest) {					
 	cKeywords_enter(&handle);
 	EXPECT_TRUE(cKeywords_isStateActive(&handle, CKeywords_auto_char));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/CastExpressionsTest/CastExpressionsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, CastExpressionTest) {					
 	castExpressions_enter(&handle);
 	EXPECT_TRUE(castExpressionsIface_get_realValue(&handle)== 5l);

+ 29 - 28
test-plugins/org.yakindu.sct.generator.c.test/gtests/ChoiceTest/ChoiceTest.cc

@@ -20,60 +20,61 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
-TEST_F(StatemachineTest, elseChoiceUsingNonDefaultTransition) {					
+void initForEventE(bool valueForC){
 	choice_enter(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
-	choiceIface_set_c(&handle,true);
+	choiceIface_set_c(&handle,valueForC);
 	choiceIface_raise_e(&handle);
 	choice_runCycle(&handle);
-	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_C));
 }
-TEST_F(StatemachineTest, elseChoiceUsingDefaultTransition) {					
+void initForEventF(bool valueForC){
 	choice_enter(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
-	choiceIface_set_c(&handle,false);
-	choiceIface_raise_e(&handle);
+	choiceIface_set_c(&handle,valueForC);
+	choiceIface_raise_f(&handle);
 	choice_runCycle(&handle);
-	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_B));
 }
-TEST_F(StatemachineTest, defaultChoiceUsingNonDefaultTransition) {					
+void initForEventG(bool valueForC){
 	choice_enter(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
-	choiceIface_set_c(&handle,true);
+	choiceIface_set_c(&handle,valueForC);
 	choiceIface_raise_g(&handle);
 	choice_runCycle(&handle);
-	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_C));
 }
-TEST_F(StatemachineTest, defaultChoiceUsingDefaultTransition) {					
+void initForEventH(bool valueForC){
 	choice_enter(&handle);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
-	choiceIface_set_c(&handle,false);
-	choiceIface_raise_g(&handle);
+	choiceIface_set_c(&handle,valueForC);
+	choiceIface_raise_h(&handle);
 	choice_runCycle(&handle);
+}
+
+TEST_F(StatemachineTest, elseChoiceUsingNonDefaultTransition) {					
+	initForEventE(true);
+	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_C));
+}
+TEST_F(StatemachineTest, elseChoiceUsingDefaultTransition) {					
+	initForEventE(false);
+	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_B));
+}
+TEST_F(StatemachineTest, defaultChoiceUsingNonDefaultTransition) {					
+	initForEventG(true);
+	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_C));
+}
+TEST_F(StatemachineTest, defaultChoiceUsingDefaultTransition) {					
+	initForEventG(false);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_B));
 }
 TEST_F(StatemachineTest, uncheckedChoiceUsingNonDefaultTransition) {					
-	choice_enter(&handle);
-	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
-	choiceIface_set_c(&handle,true);
-	choiceIface_raise_f(&handle);
-	choice_runCycle(&handle);
+	initForEventF(true);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_C));
 }
 TEST_F(StatemachineTest, uncheckedChoiceUsingDefaultTransition) {					
-	choice_enter(&handle);
-	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
-	choiceIface_set_c(&handle,false);
-	choiceIface_raise_f(&handle);
-	choice_runCycle(&handle);
+	initForEventF(false);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_B));
 }
 TEST_F(StatemachineTest, alwaysTrueTransitionInChoice) {					
-	choice_enter(&handle);
-	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_A));
-	choiceIface_set_c(&handle,true);
-	choiceIface_raise_h(&handle);
-	choice_runCycle(&handle);
+	initForEventH(true);
 	EXPECT_TRUE(choice_isStateActive(&handle, Choice_main_region_C));
 }
 

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/ConditionalExpression/ConditionalExpression.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, ConditionalExpressionTest) {					
 	conditionalExpressions_enter(&handle);
 	EXPECT_TRUE(conditionalExpressions_isStateActive(&handle, ConditionalExpressions_main_region_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstOnlyDefaultScopeTest/ConstOnlyDefaultScopeTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, statechartEntry) {					
 	constOnlyDefaultScope_enter(&handle);
 	EXPECT_TRUE(constOnlyDefaultScope_isStateActive(&handle, ConstOnlyDefaultScope_ConstOnlyDefaultScope_main_region_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstOnlyInternalScopeTest/ConstOnlyInternalScopeTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, statechartEntry) {					
 	constOnlyInternalScope_enter(&handle);
 	EXPECT_TRUE(constOnlyInternalScope_isStateActive(&handle, ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstOnlyNamedScopeTest/ConstOnlyNamedScopeTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, statechartEntry) {					
 	constOnlyNamedScope_enter(&handle);
 	EXPECT_TRUE(constOnlyNamedScope_isStateActive(&handle, ConstOnlyNamedScope_ConstOnlyNamedScope_main_region_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/ConstantsTests/ConstantsTests.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, constantDefinition) {					
 	constants_enter(&handle);
 	EXPECT_TRUE(constants_isStateActive(&handle, Constants_main_region_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/DeclarationsTest/DeclarationsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, declarationsTest) {					
 	declarations_enter(&handle);
 }

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/DeepEntryTest/DeepEntryTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, enterToSubstate) {					
 	EXPECT_TRUE(deepEntryIface_get_x(&handle)== 0l);
 	EXPECT_TRUE(deepEntryIface_get_y(&handle)== 0l);

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/DeepHistoryTest/DeepHistoryTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, deepHistoryTest) {					
 	deepHistory_enter(&handle);
 	deepHistoryIface_raise_event1(&handle);

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/DynamicChoiceTest/DynamicChoiceTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, DynamicChoiceTest) {					
 	dynamicChoice_enter(&handle);
 	EXPECT_TRUE(dynamicChoice_isStateActive(&handle, DynamicChoice_main_region_Start));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/EmptyTransitionTest/EmptyTransitionTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, EmptyTransitionTest) {					
 	emptyTransition_enter(&handle);
 	emptyTransition_runCycle(&handle);

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

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, defaultEntry) {					
 	enterState_enter(&handle);
 	EXPECT_TRUE(enterState_isStateActive(&handle, EnterState_r_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/EntryChoiceTest/EntryChoiceTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, EntryChoiceTest) {					
 	entryChoice_enter(&handle);
 	entryChoice_runCycle(&handle);

+ 6 - 5
test-plugins/org.yakindu.sct.generator.c.test/gtests/EntryExitSelfTransitionTest/EntryExitSelfTransitionTest.cc

@@ -20,12 +20,16 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
-TEST_F(StatemachineTest, SelfTransitionToChildState) {					
+void init(){
 	entryExitSelfTransition_enter(&handle);
 	entryExitSelfTransition_runCycle(&handle);
 	EXPECT_TRUE(entryExitSelfTransitionIface_get_entries(&handle)== 1l);
 	EXPECT_TRUE(entryExitSelfTransition_isStateActive(&handle, EntryExitSelfTransition_main_region_A__region0_B));
 	entryExitSelfTransitionIface_set_entries(&handle,0l);
+}
+
+TEST_F(StatemachineTest, SelfTransitionToChildState) {					
+	init();
 	entryExitSelfTransitionIface_raise_e(&handle);
 	entryExitSelfTransition_runCycle(&handle);
 	EXPECT_TRUE(entryExitSelfTransitionIface_get_entries(&handle)== 1l);
@@ -33,10 +37,7 @@ TEST_F(StatemachineTest, SelfTransitionToChildState) {
 	EXPECT_TRUE(entryExitSelfTransition_isStateActive(&handle, EntryExitSelfTransition_main_region_A__region0_C));
 }
 TEST_F(StatemachineTest, SelfTransitionFromChildState) {					
-	entryExitSelfTransition_enter(&handle);
-	entryExitSelfTransition_runCycle(&handle);
-	EXPECT_TRUE(entryExitSelfTransitionIface_get_entries(&handle)== 1l);
-	entryExitSelfTransitionIface_set_entries(&handle,0l);
+	init();
 	entryExitSelfTransitionIface_raise_e1(&handle);
 	entryExitSelfTransition_runCycle(&handle);
 	EXPECT_TRUE(entryExitSelfTransitionIface_get_entries(&handle)== 0l);

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

@@ -20,14 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
-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_F(StatemachineTest, entryOnRTS) {					
+void init(){
 	entryReactionAction_enter(&handle);
 	entryReactionActionIface_raise_b(&handle);
 	entryReactionAction_runCycle(&handle);
@@ -37,6 +30,17 @@ TEST_F(StatemachineTest, entryOnRTS) {
 	entryReactionActionIface_set_enteredR2(&handle,false);
 	entryReactionActionIface_set_enteredBdefault(&handle,false);
 	entryReactionActionIface_set_enteredBother(&handle,false);
+}
+
+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_F(StatemachineTest, entryOnRTS) {					
+	init();
 	entryReactionActionIface_raise_b(&handle);
 	entryReactionAction_runCycle(&handle);
 	EXPECT_TRUE(!entryReactionActionIface_get_enteredR1(&handle));
@@ -45,15 +49,7 @@ TEST_F(StatemachineTest, entryOnRTS) {
 	EXPECT_TRUE(entryReactionActionIface_get_enteredBother(&handle));
 }
 TEST_F(StatemachineTest, noEntryTransitionActionOnHistory) {					
-	entryReactionAction_enter(&handle);
-	entryReactionActionIface_raise_b(&handle);
-	entryReactionAction_runCycle(&handle);
-	entryReactionActionIface_raise_d(&handle);
-	entryReactionAction_runCycle(&handle);
-	entryReactionActionIface_set_enteredR1(&handle,false);
-	entryReactionActionIface_set_enteredR2(&handle,false);
-	entryReactionActionIface_set_enteredBdefault(&handle,false);
-	entryReactionActionIface_set_enteredBother(&handle,false);
+	init();
 	entryReactionActionIface_raise_d(&handle);
 	entryReactionAction_runCycle(&handle);
 	EXPECT_TRUE(!entryReactionActionIface_get_enteredR1(&handle));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/ExitOnSelfTransitionTest/ExitOnSelfTransitionTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, ExitOnSelfTransitionTest) {					
 	exitOnSelfTransition_enter(&handle);
 	EXPECT_TRUE(exitOnSelfTransition_isStateActive(&handle, ExitOnSelfTransition_main_region_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/ExitStateTest/ExitStateTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, defaultExit) {					
 	exitState_enter(&handle);
 	EXPECT_TRUE(exitState_isStateActive(&handle, ExitState_r_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/FeatureCallsTest/FeatureCallsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, FeatureCalls) {					
 	featureCalls_enter(&handle);
 	EXPECT_TRUE(featureCalls_isStateActive(&handle, FeatureCalls_main_region_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/FinalStateTest/FinalStateTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, StatechartNameTest) {					
 	finalState_enter(&handle);
 	finalState_runCycle(&handle);

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/GuardTest/GuardTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, guardTest) {					
 	guard_enter(&handle);
 	EXPECT_TRUE(guard_isStateActive(&handle, Guard_main_region_A));

+ 15 - 20
test-plugins/org.yakindu.sct.generator.c.test/gtests/GuardedEntryTest/GuardedEntryTest.cc

@@ -20,6 +20,19 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+void initEntryInTransition(bool guardVar, bool doneVar){
+	guardedEntry_enter(&handle);
+	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_A));
+	guardedEntryIface_raise_e(&handle);
+	guardedEntry_runCycle(&handle);
+	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_B));
+	guardedEntryIface_set_guard(&handle,guardVar);
+	guardedEntryIface_set_done(&handle,doneVar);
+	guardedEntryIface_raise_e(&handle);
+	guardedEntry_runCycle(&handle);
+	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_A));
+}
+
 TEST_F(StatemachineTest, EntryNotTakenOnStatechartEnter) {					
 	EXPECT_TRUE(guardedEntryIface_get_guard(&handle)== false);
 	guardedEntry_enter(&handle);
@@ -33,29 +46,11 @@ TEST_F(StatemachineTest, EntryTakenOnStatechartEnter) {
 	EXPECT_TRUE(guardedEntryIface_get_done(&handle)== true);
 }
 TEST_F(StatemachineTest, EntryTakenInTransition) {					
-	guardedEntry_enter(&handle);
-	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_A));
-	guardedEntryIface_raise_e(&handle);
-	guardedEntry_runCycle(&handle);
-	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_B));
-	guardedEntryIface_set_guard(&handle,true);
-	guardedEntryIface_set_done(&handle,false);
-	guardedEntryIface_raise_e(&handle);
-	guardedEntry_runCycle(&handle);
-	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_A));
+	initEntryInTransition(true,false);
 	EXPECT_TRUE(guardedEntryIface_get_done(&handle));
 }
 TEST_F(StatemachineTest, EntryNotTakenInTransition) {					
-	guardedEntry_enter(&handle);
-	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_A));
-	guardedEntryIface_raise_e(&handle);
-	guardedEntry_runCycle(&handle);
-	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_B));
-	guardedEntryIface_set_guard(&handle,false);
-	guardedEntryIface_set_done(&handle,false);
-	guardedEntryIface_raise_e(&handle);
-	guardedEntry_runCycle(&handle);
-	EXPECT_TRUE(guardedEntry_isStateActive(&handle, GuardedEntry_main_region_A));
+	initEntryInTransition(false,false);
 	EXPECT_TRUE(!guardedEntryIface_get_done(&handle));
 }
 

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

@@ -20,23 +20,24 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+void checkDone(bool shouldBeDone){
+	guardedExitIface_raise_e(&handle);
+	guardedExit_runCycle(&handle);
+	EXPECT_TRUE(guardedExit_isStateActive(&handle, GuardedExit_main_region_B));
+	EXPECT_TRUE(shouldBeDone ? guardedExitIface_get_done(&handle)  : !guardedExitIface_get_done(&handle));
+}
+
 TEST_F(StatemachineTest, ExitTaken) {					
 	guardedExit_enter(&handle);
 	EXPECT_TRUE(guardedExit_isStateActive(&handle, GuardedExit_main_region_A));
 	EXPECT_TRUE(!guardedExitIface_get_guard(&handle));
-	guardedExitIface_raise_e(&handle);
-	guardedExit_runCycle(&handle);
-	EXPECT_TRUE(guardedExit_isStateActive(&handle, GuardedExit_main_region_B));
-	EXPECT_TRUE(!guardedExitIface_get_done(&handle));
+	checkDone(false);
 }
 TEST_F(StatemachineTest, ExitNotTaken) {					
 	guardedExit_enter(&handle);
 	EXPECT_TRUE(guardedExit_isStateActive(&handle, GuardedExit_main_region_A));
 	guardedExitIface_set_guard(&handle,true);
-	guardedExitIface_raise_e(&handle);
-	guardedExit_runCycle(&handle);
-	EXPECT_TRUE(guardedExit_isStateActive(&handle, GuardedExit_main_region_B));
-	EXPECT_TRUE(guardedExitIface_get_done(&handle));
+	checkDone(true);
 }
 
 

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/HistoryWithExitPointTest/HistoryWithExitPointTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, historyEntryAfterExit) {					
 	historyWithExitPoint_enter(&handle);
 	EXPECT_TRUE(historyWithExitPoint_isStateActive(&handle, HistoryWithExitPoint_mr_A_r_X1));

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

@@ -20,21 +20,22 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
-TEST_F(StatemachineTest, enterThroughInitialEntry) {					
+void init(){
 	historyWithoutInitialStep_enter(&handle);
 	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_A));
 	historyWithoutInitialStepIface_raise_toB(&handle);
 	historyWithoutInitialStep_runCycle(&handle);
+}
+
+TEST_F(StatemachineTest, enterThroughInitialEntry) {					
+	init();
 	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_B_r1_C));
 	historyWithoutInitialStepIface_raise_next(&handle);
 	historyWithoutInitialStep_runCycle(&handle);
 	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_B_r1_D));
 }
 TEST_F(StatemachineTest, enterCThroughHistory) {					
-	historyWithoutInitialStep_enter(&handle);
-	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_A));
-	historyWithoutInitialStepIface_raise_toB(&handle);
-	historyWithoutInitialStep_runCycle(&handle);
+	init();
 	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_B_r1_C));
 	historyWithoutInitialStepIface_raise_toA(&handle);
 	historyWithoutInitialStep_runCycle(&handle);
@@ -44,10 +45,7 @@ TEST_F(StatemachineTest, enterCThroughHistory) {
 	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_B_r1_C));
 }
 TEST_F(StatemachineTest, enterDThroughHistory) {					
-	historyWithoutInitialStep_enter(&handle);
-	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_A));
-	historyWithoutInitialStepIface_raise_toB(&handle);
-	historyWithoutInitialStep_runCycle(&handle);
+	init();
 	historyWithoutInitialStepIface_raise_next(&handle);
 	historyWithoutInitialStep_runCycle(&handle);
 	EXPECT_TRUE(historyWithoutInitialStep_isStateActive(&handle, HistoryWithoutInitialStep_main_region_B_r1_D));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/InEventLifeCycleTest/InEventLifeCycleTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, eventLifeCycle) {					
 	inEventLifeCycle_enter(&handle);
 	inEventLifeCycleIface_raise_e(&handle);

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/IntegerExpressionsTest/IntegerExpressionsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, integerExpressions) {					
 	integerExpressions_enter(&handle);
 	EXPECT_TRUE(integerExpressions_isStateActive(&handle, IntegerExpressions_main_region_StateA));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/InternalEventLifeCycleTest/InternalEventLifeCycleTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, InternalEventLifeCycleTest) {					
 	internalEventLifeCycle_enter(&handle);
 	EXPECT_TRUE(internalEventLifeCycle_isStateActive(&handle, InternalEventLifeCycle_r1_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/LocalReactionsTest/LocalReactionsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, LocalReactionsTest) {					
 	localReactions_enter(&handle);
 	EXPECT_TRUE(localReactions_isStateActive(&handle, LocalReactions_main_region_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/LogicalAndTests/LogicalAndTests.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, operandEvaluationOrder) {					
 	logicalAnd_enter(&handle);
 	logicalAnd_runCycle(&handle);

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/LogicalOrTests/LogicalOrTests.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, operandEvaluationOrder) {					
 	logicalOr_enter(&handle);
 	logicalOr_runCycle(&handle);

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/NamedInterfaceAccessTest/NamedInterfaceAccessTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, SafeOpenSuccess) {					
 	namedInterfaceAccess_enter(&handle);
 	namedInterfaceAccess_runCycle(&handle);

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/NullCheckTest/NullCheckTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, SimpleNullCheckTest) {					
 	nullCheck_enter(&handle);
 	EXPECT_TRUE(nullCheck_isStateActive(&handle, NullCheck_main_region_A));

+ 3 - 22
test-plugins/org.yakindu.sct.generator.c.test/gtests/OperationsTest/OperationsTest.cc

@@ -11,18 +11,6 @@
 #include "gtest/gtest.h"
 #include "Operations.h"
 #include "OperationsRequired.h"
-class InternalOperation3aMock{
-	public:
-	sc_real (InternalOperation3aMock::*internalOperation3aBehavior)(sc_real);
-	sc_real internalOperation3a1(const sc_real param1){
-		return (param1+1.0);
-	}
-	void setInternalOperation3aBehavior(sc_real (InternalOperation3aMock::*func)(sc_real)){
-		internalOperation3aBehavior = func;
-	}
-};
-static InternalOperation3aMock* internalOperation3aMock;
-
 class AlwaysTrueMock{
 	public:
 	sc_boolean (AlwaysTrueMock::*alwaysTrueBehavior)();
@@ -153,11 +141,10 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, operationsCalled) {					
 	alwaysTrueMock = new AlwaysTrueMock();
-	internalOperation3aMock = new InternalOperation3aMock();
 	alwaysTrueMock->setAlwaysTrueBehavior(&AlwaysTrueMock::alwaysTrue1);
-	internalOperation3aMock->setInternalOperation3aBehavior(&InternalOperation3aMock::internalOperation3a1);
 	operations_enter(&handle);
 	EXPECT_TRUE(operations_isStateActive(&handle, Operations_main_region_A));
 	operations_runCycle(&handle);
@@ -167,14 +154,12 @@ TEST_F(StatemachineTest, operationsCalled) {
 	EXPECT_TRUE(internalOperation2.param1 == 4l);
 	EXPECT_TRUE(internalOperation3.called);
 	EXPECT_TRUE(internalOperation3a.called);
+	EXPECT_TRUE(internalOperation3a.param1 == 1.0);
 	EXPECT_TRUE(internalOperation4.called);
 	EXPECT_TRUE(internalOperation4a.called);
 	EXPECT_TRUE(internalOperation4a.param1 == 5l);
 	EXPECT_TRUE(internalOperation5.called);
 	EXPECT_TRUE(internalOperation5a.called);
-	EXPECT_TRUE(strcmp(internalOperation5a.param1, "") == 0);
-	EXPECT_TRUE(internalOperation2.called);
-	EXPECT_TRUE(internalOperation2.param1 == 4l);
 	operationsIface_raise_ev(&handle);
 	operations_runCycle(&handle);
 	EXPECT_TRUE(operations_isStateActive(&handle, Operations_main_region_C));
@@ -189,7 +174,6 @@ TEST_F(StatemachineTest, operationsCalled) {
 	EXPECT_TRUE(interface1InterfaceOperation4a.param1 == 5l);
 	EXPECT_TRUE(interface1InterfaceOperation5.called);
 	EXPECT_TRUE(interface1InterfaceOperation5a.called);
-	EXPECT_TRUE(strcmp(interface1InterfaceOperation5a.param1, "") == 0);
 	operationsIface_raise_ev(&handle);
 	operations_runCycle(&handle);
 	EXPECT_TRUE(operations_isStateActive(&handle, Operations_main_region_D));
@@ -204,7 +188,6 @@ TEST_F(StatemachineTest, operationsCalled) {
 	EXPECT_TRUE(unnamedOperation4a.param1 == 5l);
 	EXPECT_TRUE(unnamedOperation5.called);
 	EXPECT_TRUE(unnamedOperation5a.called);
-	EXPECT_TRUE(strcmp(unnamedOperation5a.param1, "") == 0);
 }
 
 
@@ -223,9 +206,7 @@ return 0.0d;
 sc_real operationsInternal_internalOperation3a(const Operations* handle, const sc_real param1){
 internalOperation3a.called = true;
 internalOperation3a.param1 = param1;
-sc_real (InternalOperation3aMock::*func)(sc_real) = internalOperation3aMock->internalOperation3aBehavior;
-return (internalOperation3aMock->*func)(param1);
-
+return 0.0d;
 }
 sc_integer operationsInternal_internalOperation4(const Operations* handle){
 internalOperation4.called = true;

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

@@ -20,30 +20,31 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
-TEST_F(StatemachineTest, availableAfterCycle) {					
+void init(bool sndCycle){
 	outEventLifeCycle_enter(&handle);
 	outEventLifeCycleIface_raise_e(&handle);
 	outEventLifeCycle_runCycle(&handle);
-	EXPECT_TRUE(outEventLifeCycleIface_israised_f(&handle));
+	if (sndCycle) {
+		outEventLifeCycle_runCycle(&handle);
+	}
 }
-TEST_F(StatemachineTest, availableWithinCycle) {					
+
+TEST_F(StatemachineTest, availableAfterCycle) {					
 	outEventLifeCycle_enter(&handle);
 	outEventLifeCycleIface_raise_e(&handle);
 	outEventLifeCycle_runCycle(&handle);
+	EXPECT_TRUE(outEventLifeCycleIface_israised_f(&handle));
+}
+TEST_F(StatemachineTest, availableWithinCycle) {					
+	init(false);
 	EXPECT_TRUE(outEventLifeCycleIface_get_f_available_in_cycle(&handle));
 }
 TEST_F(StatemachineTest, unvailableWithin2ndCycle) {					
-	outEventLifeCycle_enter(&handle);
-	outEventLifeCycleIface_raise_e(&handle);
-	outEventLifeCycle_runCycle(&handle);
-	outEventLifeCycle_runCycle(&handle);
+	init(true);
 	EXPECT_TRUE(!outEventLifeCycleIface_get_f_available_in_next_cycle(&handle));
 }
 TEST_F(StatemachineTest, unvailableAfter2ndCycle) {					
-	outEventLifeCycle_enter(&handle);
-	outEventLifeCycleIface_raise_e(&handle);
-	outEventLifeCycle_runCycle(&handle);
-	outEventLifeCycle_runCycle(&handle);
+	init(true);
 	EXPECT_TRUE(!outEventLifeCycleIface_israised_f(&handle));
 }
 

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/ParenthesisTest/ParenthesisTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, simple) {					
 	parenthesis_enter(&handle);
 	EXPECT_TRUE(parenthesis_isStateActive(&handle, Parenthesis_mainRegion_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/PriorityValuesTest/PriorityValuesTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, transitionPriority) {					
 	priorityValues_enter(&handle);
 	EXPECT_TRUE(priorityValues_isStateActive(&handle, PriorityValues_main_region_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/RaiseEventTest/RaiseEventTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, raiseEvent) {					
 	raiseEvent_enter(&handle);
 	EXPECT_TRUE(raiseEvent_isStateActive(&handle, RaiseEvent_second_region_SateA));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/ReadOnlyVariableTest/ReadOnlyVariableTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, ReadOnlyVariableTest) {					
 	readOnlyVariable_enter(&handle);
 	EXPECT_TRUE(readOnlyVariable_isStateActive(&handle, ReadOnlyVariable_main_region_StateA));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/STextKeywordsInStatesAndRegionsTest/STextKeywordsInStatesAndRegionsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, activeCheckWithSTextNamedStates) {					
 	sTextKeywordsInStatesAndRegions_enter(&handle);
 	EXPECT_TRUE(sTextKeywordsInStatesAndRegions_isStateActive(&handle, STextKeywordsInStatesAndRegions_default_namespace));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/SameNameDifferentRegionTest/SameNameDifferentRegionTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, sameNameDifferenRegionTest) {					
 	sameNameDifferentRegion_enter(&handle);
 	EXPECT_TRUE(sameNameDifferentRegion_isStateActive(&handle, SameNameDifferentRegion_main_region_StateA));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/ShallowHistoryTest/ShallowHistoryTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, shallowHistoryTest) {					
 	shallowHistory_enter(&handle);
 	shallowHistoryIface_raise_event1(&handle);

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

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, noDeepEntryWithinHistory) {					
 	shallowHistoryWithDeepEntry_enter(&handle);
 	EXPECT_TRUE(shallowHistoryWithDeepEntry_isStateActive(&handle, ShallowHistoryWithDeepEntry_main_region_Y));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/SimpleEventTest/SimpleEventTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, simpleEventTest) {					
 	simpleEvent_enter(&handle);
 	EXPECT_TRUE(simpleEvent_isStateActive(&handle, SimpleEvent_main_region_A)) << "Expected A to be active" ;

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/SimpleHierachyTest/SimpleHierachyTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, simpleHierachyTest) {					
 	simpleHierachy_enter(&handle);
 	EXPECT_TRUE(simpleHierachy_isStateActive(&handle, SimpleHierachy_main_region_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/StateIsActiveTest/StateIsActiveTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, stateIsActive) {					
 	stateIsActive_enter(&handle);
 	EXPECT_TRUE(stateIsActive_isStateActive(&handle, StateIsActive_R1_R1A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/StatechartActiveTest/StatechartActiveTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, inactiveBeforeEnter) {					
 	EXPECT_TRUE(!statechartActive_isActive(&handle));
 }

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/StatechartLocalReactionsTest/StatechartLocalReactionsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, statechartLocalReactionsTest) {					
 	statechartLocalReactions_enter(&handle);
 	EXPECT_TRUE(statechartLocalReactions_isStateActive(&handle, StatechartLocalReactions_main_region_S1));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/StatemachineKeywords/StatemachineKeywords.cc

@@ -21,6 +21,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, statemachineKeywords) {					
 	statechartKeywords_enter(&handle);
 	EXPECT_TRUE(statechartKeywords_isStateActive(&handle, StatechartKeywords_main_region_Timer));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/StaticChoiceTest/StaticChoiceTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, StaticChoiceTest) {					
 	staticChoice_enter(&handle);
 	EXPECT_TRUE(staticChoice_isStateActive(&handle, StaticChoice_main_region_Start));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/StringExpressionsTest/StringExpressionsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, StringExpressionsTest) {					
 	EXPECT_TRUE(strcmp(stringExpressionsIface_get_quotedStringX(&handle), "\"X\"") == 0);
 	EXPECT_TRUE(strcmp(stringExpressionsIface_get_quotedStringY(&handle), "\"Y\"") == 0);

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/SyncForkTest/SyncForkTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, syncForkTest) {					
 	syncFork_enter(&handle);
 	EXPECT_TRUE(syncFork_isStateActive(&handle, SyncFork_main_region_A));

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

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, syncJoin_C2_Waits) {					
 	syncJoin_enter(&handle);
 	EXPECT_TRUE(syncJoin_isStateActive(&handle, SyncJoin_main_region_B));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/TimedTransitionsTest/TimedTransitionsTest.cc

@@ -21,6 +21,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, Timer01) {					
 	timedTransitions_enter(&handle);
 	EXPECT_TRUE(timedTransitions_isStateActive(&handle, TimedTransitions_main_region_Start));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/TransitionWithoutConditionTest/TransitionWithoutConditionTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, TransitionWithoutConditionTest) {					
 	transitionWithoutCondition_enter(&handle);
 	EXPECT_TRUE(transitionWithoutCondition_isStateActive(&handle, TransitionWithoutCondition_main_region_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/TriggerExpressionPrecedenceTest/TriggerExpressionPrecedenceTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, unsatisfiedTriggerAndFGuardFalseOrFalse) {					
 	triggerExpressionPrecedence_enter(&handle);
 	triggerExpressionPrecedenceIface_set_c1(&handle,false);

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/TriggerGuardExpressionsTest/TriggerGuardExpressionsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, trueGuard) {					
 	triggerGuardExpressions_enter(&handle);
 	EXPECT_TRUE(triggerGuardExpressions_isStateActive(&handle, TriggerGuardExpressions_main_region_A));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/TypeAliasTest/TypeAliasTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, TypeAliasTest) {					
 	typeAlias_enter(&handle);
 	EXPECT_TRUE(typeAlias_isStateActive(&handle, TypeAlias_main_region_Start));

+ 1 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/ValuedEventsTest/ValuedEventsTest.cc

@@ -20,6 +20,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, valuedEventsTest) {					
 	valuedEvents_enter(&handle);
 	valuedEvents_runCycle(&handle);

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AlwaysOncycleTest/AlwaysOncycleTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, alwaysOncycleTest) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/AssignmentAsExpressionTest/AssignmentAsExpressionTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, simpleAssignment) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BitExpressionsTest/BitExpressionsTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, BitExpressions) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/BooleanExpressionsTest/BooleanExpressionsTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, booleanExpressions) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CKeywordsTest/CKeywordsTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, CKeywordsTest) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/CastExpressionsTest/CastExpressionsTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, CastExpressionTest) {
 	
 	

+ 35 - 62
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ChoiceTest/ChoiceTest.cc

@@ -25,114 +25,87 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
-TEST_F(StatemachineTest, elseChoiceUsingNonDefaultTransition) {
-	
-	
+void initForEventE(bool valueForC){
 	statechart->enter();
-	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
-	
-	statechart->getDefaultSCI()->set_c(true);
-	
+	statechart->getDefaultSCI()->set_c(valueForC);
 	statechart->raise_e();
-	
 	statechart->runCycle();
-	
-	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_C));
-	
 }
-TEST_F(StatemachineTest, elseChoiceUsingDefaultTransition) {
-	
-	
+void initForEventF(bool valueForC){
 	statechart->enter();
-	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
-	
-	statechart->getDefaultSCI()->set_c(false);
-	
-	statechart->raise_e();
-	
+	statechart->getDefaultSCI()->set_c(valueForC);
+	statechart->raise_f();
 	statechart->runCycle();
-	
-	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_B));
-	
 }
-TEST_F(StatemachineTest, defaultChoiceUsingNonDefaultTransition) {
-	
-	
+void initForEventG(bool valueForC){
 	statechart->enter();
-	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
-	
-	statechart->getDefaultSCI()->set_c(true);
-	
+	statechart->getDefaultSCI()->set_c(valueForC);
 	statechart->raise_g();
-	
 	statechart->runCycle();
-	
-	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_C));
-	
 }
-TEST_F(StatemachineTest, defaultChoiceUsingDefaultTransition) {
-	
-	
+void initForEventH(bool valueForC){
 	statechart->enter();
-	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
+	statechart->getDefaultSCI()->set_c(valueForC);
+	statechart->raise_h();
+	statechart->runCycle();
+}
+
+TEST_F(StatemachineTest, elseChoiceUsingNonDefaultTransition) {
 	
-	statechart->getDefaultSCI()->set_c(false);
-	
-	statechart->raise_g();
 	
-	statechart->runCycle();
+	initForEventE(true);
 	
-	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_B));
+	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_C));
 	
 }
-TEST_F(StatemachineTest, uncheckedChoiceUsingNonDefaultTransition) {
+TEST_F(StatemachineTest, elseChoiceUsingDefaultTransition) {
 	
 	
-	statechart->enter();
+	initForEventE(false);
 	
-	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
+	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_B));
 	
-	statechart->getDefaultSCI()->set_c(true);
+}
+TEST_F(StatemachineTest, defaultChoiceUsingNonDefaultTransition) {
 	
-	statechart->raise_f();
 	
-	statechart->runCycle();
+	initForEventG(true);
 	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_C));
 	
 }
-TEST_F(StatemachineTest, uncheckedChoiceUsingDefaultTransition) {
+TEST_F(StatemachineTest, defaultChoiceUsingDefaultTransition) {
 	
 	
-	statechart->enter();
+	initForEventG(false);
 	
-	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
+	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_B));
 	
-	statechart->getDefaultSCI()->set_c(false);
+}
+TEST_F(StatemachineTest, uncheckedChoiceUsingNonDefaultTransition) {
 	
-	statechart->raise_f();
 	
-	statechart->runCycle();
+	initForEventF(true);
 	
-	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_B));
+	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_C));
 	
 }
-TEST_F(StatemachineTest, alwaysTrueTransitionInChoice) {
+TEST_F(StatemachineTest, uncheckedChoiceUsingDefaultTransition) {
 	
 	
-	statechart->enter();
+	initForEventF(false);
 	
-	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_A));
+	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_B));
 	
-	statechart->getDefaultSCI()->set_c(true);
+}
+TEST_F(StatemachineTest, alwaysTrueTransitionInChoice) {
 	
-	statechart->raise_h();
 	
-	statechart->runCycle();
+	initForEventH(true);
 	
 	EXPECT_TRUE(statechart->isStateActive(Choice::main_region_C));
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ConditionalExpressionTest/ConditionalExpressionTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, ConditionalExpressionTest) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ConstOnlyDefaultScopeTest/ConstOnlyDefaultScopeTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, statechartEntry) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ConstOnlyInternalScopeTest/ConstOnlyInternalScopeTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, statechartEntry) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ConstOnlyNamedScopeTest/ConstOnlyNamedScopeTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, statechartEntry) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ConstantsTestsTest/ConstantsTestsTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, constantDefinition) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/DeclarationsTest/DeclarationsTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, declarationsTest) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/DeepEntryTest/DeepEntryTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, enterToSubstate) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/DeepHistoryTest/DeepHistoryTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, deepHistoryTest) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/DynamicChoiceTest/DynamicChoiceTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, DynamicChoiceTest) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/EmptyTransitionTest/EmptyTransitionTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, EmptyTransitionTest) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/EnterStateTest/EnterStateTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, defaultEntry) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/EntryChoiceTest/EntryChoiceTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, EntryChoiceTest) {
 	
 	

+ 8 - 14
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/EntryExitSelfTransitionTest/EntryExitSelfTransitionTest.cc

@@ -25,18 +25,18 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
-TEST_F(StatemachineTest, SelfTransitionToChildState) {
-	
-	
+void init(){
 	statechart->enter();
-	
 	statechart->runCycle();
-	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_entries()== 1l);
-	
 	EXPECT_TRUE(statechart->isStateActive(EntryExitSelfTransition::main_region_A__region0_B));
-	
 	statechart->getDefaultSCI()->set_entries(0l);
+}
+
+TEST_F(StatemachineTest, SelfTransitionToChildState) {
+	
+	
+	init();
 	
 	statechart->raise_e();
 	
@@ -52,13 +52,7 @@ TEST_F(StatemachineTest, SelfTransitionToChildState) {
 TEST_F(StatemachineTest, SelfTransitionFromChildState) {
 	
 	
-	statechart->enter();
-	
-	statechart->runCycle();
-	
-	EXPECT_TRUE(statechart->getDefaultSCI()->get_entries()== 1l);
-	
-	statechart->getDefaultSCI()->set_entries(0l);
+	init();
 	
 	statechart->raise_e1();
 	

+ 14 - 34
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/EntryReactionActionTest/EntryReactionActionTest.cc

@@ -25,6 +25,18 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+void init(){
+	statechart->enter();
+	statechart->raise_b();
+	statechart->runCycle();
+	statechart->raise_d();
+	statechart->runCycle();
+	statechart->getDefaultSCI()->set_enteredR1(false);
+	statechart->getDefaultSCI()->set_enteredR2(false);
+	statechart->getDefaultSCI()->set_enteredBdefault(false);
+	statechart->getDefaultSCI()->set_enteredBother(false);
+}
+
 TEST_F(StatemachineTest, entryTransitionActionOnStatechartEnter) {
 	
 	
@@ -42,23 +54,7 @@ TEST_F(StatemachineTest, entryTransitionActionOnStatechartEnter) {
 TEST_F(StatemachineTest, entryOnRTS) {
 	
 	
-	statechart->enter();
-	
-	statechart->raise_b();
-	
-	statechart->runCycle();
-	
-	statechart->raise_d();
-	
-	statechart->runCycle();
-	
-	statechart->getDefaultSCI()->set_enteredR1(false);
-	
-	statechart->getDefaultSCI()->set_enteredR2(false);
-	
-	statechart->getDefaultSCI()->set_enteredBdefault(false);
-	
-	statechart->getDefaultSCI()->set_enteredBother(false);
+	init();
 	
 	statechart->raise_b();
 	
@@ -76,23 +72,7 @@ TEST_F(StatemachineTest, entryOnRTS) {
 TEST_F(StatemachineTest, noEntryTransitionActionOnHistory) {
 	
 	
-	statechart->enter();
-	
-	statechart->raise_b();
-	
-	statechart->runCycle();
-	
-	statechart->raise_d();
-	
-	statechart->runCycle();
-	
-	statechart->getDefaultSCI()->set_enteredR1(false);
-	
-	statechart->getDefaultSCI()->set_enteredR2(false);
-	
-	statechart->getDefaultSCI()->set_enteredBdefault(false);
-	
-	statechart->getDefaultSCI()->set_enteredBother(false);
+	init();
 	
 	statechart->raise_d();
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ExitOnSelfTransitionTest/ExitOnSelfTransitionTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, ExitOnSelfTransitionTest) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/ExitStateTest/ExitStateTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, defaultExit) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/FeatureCallsTest/FeatureCallsTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, FeatureCalls) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/FinalStateTest/FinalStateTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, StatechartNameTest) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/GuardTest/GuardTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, guardTest) {
 	
 	

+ 15 - 38
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/GuardedEntryTest/GuardedEntryTest.cc

@@ -25,6 +25,19 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+void initEntryInTransition(bool guardVar, bool doneVar){
+	statechart->enter();
+	EXPECT_TRUE(statechart->isStateActive(GuardedEntry::main_region_A));
+	statechart->raise_e();
+	statechart->runCycle();
+	EXPECT_TRUE(statechart->isStateActive(GuardedEntry::main_region_B));
+	statechart->getDefaultSCI()->set_guard(guardVar);
+	statechart->getDefaultSCI()->set_done(doneVar);
+	statechart->raise_e();
+	statechart->runCycle();
+	EXPECT_TRUE(statechart->isStateActive(GuardedEntry::main_region_A));
+}
+
 TEST_F(StatemachineTest, EntryNotTakenOnStatechartEnter) {
 	
 	
@@ -52,25 +65,7 @@ TEST_F(StatemachineTest, EntryTakenOnStatechartEnter) {
 TEST_F(StatemachineTest, EntryTakenInTransition) {
 	
 	
-	statechart->enter();
-	
-	EXPECT_TRUE(statechart->isStateActive(GuardedEntry::main_region_A));
-	
-	statechart->raise_e();
-	
-	statechart->runCycle();
-	
-	EXPECT_TRUE(statechart->isStateActive(GuardedEntry::main_region_B));
-	
-	statechart->getDefaultSCI()->set_guard(true);
-	
-	statechart->getDefaultSCI()->set_done(false);
-	
-	statechart->raise_e();
-	
-	statechart->runCycle();
-	
-	EXPECT_TRUE(statechart->isStateActive(GuardedEntry::main_region_A));
+	initEntryInTransition(true,false);
 	
 	EXPECT_TRUE(statechart->getDefaultSCI()->get_done());
 	
@@ -78,25 +73,7 @@ TEST_F(StatemachineTest, EntryTakenInTransition) {
 TEST_F(StatemachineTest, EntryNotTakenInTransition) {
 	
 	
-	statechart->enter();
-	
-	EXPECT_TRUE(statechart->isStateActive(GuardedEntry::main_region_A));
-	
-	statechart->raise_e();
-	
-	statechart->runCycle();
-	
-	EXPECT_TRUE(statechart->isStateActive(GuardedEntry::main_region_B));
-	
-	statechart->getDefaultSCI()->set_guard(false);
-	
-	statechart->getDefaultSCI()->set_done(false);
-	
-	statechart->raise_e();
-	
-	statechart->runCycle();
-	
-	EXPECT_TRUE(statechart->isStateActive(GuardedEntry::main_region_A));
+	initEntryInTransition(false,false);
 	
 	EXPECT_TRUE(!statechart->getDefaultSCI()->get_done());
 	

+ 9 - 14
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/GuardedExitTest/GuardedExitTest.cc

@@ -25,6 +25,13 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+void checkDone(bool shouldBeDone){
+	statechart->raise_e();
+	statechart->runCycle();
+	EXPECT_TRUE(statechart->isStateActive(GuardedExit::main_region_B));
+	EXPECT_TRUE(shouldBeDone ? statechart->getDefaultSCI()->get_done()  : !statechart->getDefaultSCI()->get_done());
+}
+
 TEST_F(StatemachineTest, ExitTaken) {
 	
 	
@@ -34,13 +41,7 @@ TEST_F(StatemachineTest, ExitTaken) {
 	
 	EXPECT_TRUE(!statechart->getDefaultSCI()->get_guard());
 	
-	statechart->raise_e();
-	
-	statechart->runCycle();
-	
-	EXPECT_TRUE(statechart->isStateActive(GuardedExit::main_region_B));
-	
-	EXPECT_TRUE(!statechart->getDefaultSCI()->get_done());
+	checkDone(false);
 	
 }
 TEST_F(StatemachineTest, ExitNotTaken) {
@@ -52,12 +53,6 @@ TEST_F(StatemachineTest, ExitNotTaken) {
 	
 	statechart->getDefaultSCI()->set_guard(true);
 	
-	statechart->raise_e();
-	
-	statechart->runCycle();
-	
-	EXPECT_TRUE(statechart->isStateActive(GuardedExit::main_region_B));
-	
-	EXPECT_TRUE(statechart->getDefaultSCI()->get_done());
+	checkDone(true);
 	
 }

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/HistoryWithExitPointTest/HistoryWithExitPointTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, historyEntryAfterExit) {
 	
 	

+ 9 - 20
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/HistoryWithoutInitialStepTest/HistoryWithoutInitialStepTest.cc

@@ -25,16 +25,17 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
-TEST_F(StatemachineTest, enterThroughInitialEntry) {
-	
-	
+void init(){
 	statechart->enter();
-	
 	EXPECT_TRUE(statechart->isStateActive(HistoryWithoutInitialStep::main_region_A));
-	
 	statechart->raise_toB();
-	
 	statechart->runCycle();
+}
+
+TEST_F(StatemachineTest, enterThroughInitialEntry) {
+	
+	
+	init();
 	
 	EXPECT_TRUE(statechart->isStateActive(HistoryWithoutInitialStep::main_region_B_r1_C));
 	
@@ -48,13 +49,7 @@ TEST_F(StatemachineTest, enterThroughInitialEntry) {
 TEST_F(StatemachineTest, enterCThroughHistory) {
 	
 	
-	statechart->enter();
-	
-	EXPECT_TRUE(statechart->isStateActive(HistoryWithoutInitialStep::main_region_A));
-	
-	statechart->raise_toB();
-	
-	statechart->runCycle();
+	init();
 	
 	EXPECT_TRUE(statechart->isStateActive(HistoryWithoutInitialStep::main_region_B_r1_C));
 	
@@ -74,13 +69,7 @@ TEST_F(StatemachineTest, enterCThroughHistory) {
 TEST_F(StatemachineTest, enterDThroughHistory) {
 	
 	
-	statechart->enter();
-	
-	EXPECT_TRUE(statechart->isStateActive(HistoryWithoutInitialStep::main_region_A));
-	
-	statechart->raise_toB();
-	
-	statechart->runCycle();
+	init();
 	
 	statechart->raise_next();
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/InEventLifeCycleTest/InEventLifeCycleTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, eventLifeCycle) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/IntegerExpressionsTest/IntegerExpressionsTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, integerExpressions) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/InternalEventLifeCycleTest/InternalEventLifeCycleTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, InternalEventLifeCycleTest) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/LocalReactionsTest/LocalReactionsTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, LocalReactionsTest) {
 	
 	

+ 1 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/LogicalAndTestsTest/LogicalAndTestsTest.cc

@@ -25,6 +25,7 @@ class StatemachineTest : public ::testing::Test{
 	}
 };
 
+
 TEST_F(StatemachineTest, operandEvaluationOrder) {
 	
 	

+ 0 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/LogicalOrTestsTest/LogicalOrTestsTest.cc


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio