浏览代码

Added enter/exit and changed init/destruct calls in testcases

jos.itemis@gmail.com 13 年之前
父节点
当前提交
db08bcaca0

+ 10 - 0
TestScenarios/test-c/InterfaceTest/main.c

@@ -22,12 +22,22 @@ void setupStatemachine(InterfaceTestStatemachine* machine, Timer* dummyTimer, Ev
 	/* initialize state machine */
 	interfaceTestStatemachine_init(machine, dummyTimer, eventPool);
 
+	/* call all necessary enter functions */
+	interfaceTestStatemachine_enter(machine);
 }
 
 void teardownStatemachine(InterfaceTestStatemachine* machine, Timer* dummyTimer, EventPool* eventPool)
 {
+	/* call all exit actions for this state machine */
 	interfaceTestStatemachine_exit(machine);
+
+	/* free all internal memory for this state machine */
+	interfaceTestStatemachine_destruct(machine);
+
+	/* free the timer */
 	timer_exit(dummyTimer);
+
+	/* free all events in the event pool */
 	eventPool_exit(eventPool);
 
 }

+ 11 - 0
TestScenarios/test-c/Test_Expression/main.c

@@ -24,12 +24,23 @@ void setupStatemachine(Test_ExpressionStatemachine* machine, Timer* dummyTimer,
 	/* initialize state machine */
 	test_ExpressionStatemachine_init(machine, dummyTimer, eventPool);
 
+	/* call all necessary enter functions */
+	test_ExpressionStatemachine_enter(machine);
+
 }
 
 void teardownStatemachine(Test_ExpressionStatemachine* machine, Timer* dummyTimer, EventPool* eventPool)
 {
+	/* call all exit actions for this state machine */
 	test_ExpressionStatemachine_exit(machine);
+
+	/* free all internal memory for this state machine */
+	test_ExpressionStatemachine_destruct(machine);
+
+	/* free the timer */
 	timer_exit(dummyTimer);
+
+	/* free all events in the event pool */
 	eventPool_exit(eventPool);
 
 }

+ 11 - 0
TestScenarios/test-c/Test_Hierarchy/main.c

@@ -40,12 +40,23 @@ void setupStatemachine(Test_HierarchyStatemachine* machine, Timer* dummyTimer, E
 	/* initialize state machine */
 	test_HierarchyStatemachine_init(machine, dummyTimer, eventPool);
 
+	/* call all necessary enter functions */
+	test_HierarchyStatemachine_enter(machine);
+
 }
 
 void teardownStatemachine(Test_HierarchyStatemachine* machine, Timer* dummyTimer, EventPool* eventPool)
 {
+	/* call all exit actions for this state machine */
 	test_HierarchyStatemachine_exit(machine);
+
+	/* free all internal memory for this state machine */
+	test_HierarchyStatemachine_destruct(machine);
+
+	/* free the timer */
 	timer_exit(dummyTimer);
+
+	/* free all events in the event pool */
 	eventPool_exit(eventPool);
 
 }

+ 11 - 0
TestScenarios/test-c/Test_LocalActions/main.c

@@ -30,12 +30,23 @@ void setupStatemachine(Test_LocalActionsStatemachine* machine, Timer* dummyTimer
 	/* initialize state machine */
 	test_LocalActionsStatemachine_init(machine, dummyTimer, eventPool);
 
+	/* call all necessary enter functions */
+	test_LocalActionsStatemachine_enter(machine);
+
 }
 
 void teardownStatemachine(Test_LocalActionsStatemachine* machine, Timer* dummyTimer, EventPool* eventPool)
 {
+	/* call all exit actions for this state machine */
 	test_LocalActionsStatemachine_exit(machine);
+
+	/* free all internal memory for this state machine */
+	test_LocalActionsStatemachine_destruct(machine);
+
+	/* free the timer */
 	timer_exit(dummyTimer);
+
+	/* free all events in the event pool */
 	eventPool_exit(eventPool);
 
 }

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

@@ -30,12 +30,23 @@ void setupStatemachine(Test_ParallelRegionsStatemachine* machine, Timer* dummyTi
 	/* initialize state machine */
 	test_ParallelRegionsStatemachine_init(machine, dummyTimer, eventPool);
 
+	/* call all necessary enter functions */
+	test_ParallelRegionsStatemachine_enter(machine);
+
 }
 
 void teardownStatemachine(Test_ParallelRegionsStatemachine* machine, Timer* dummyTimer, EventPool* eventPool)
 {
+	/* call all exit actions for this state machine */
 	test_ParallelRegionsStatemachine_exit(machine);
+
+	/* free all internal memory for this state machine */
+	test_ParallelRegionsStatemachine_destruct(machine);
+
+	/* free the timer */
 	timer_exit(dummyTimer);
+
+	/* free all events in the event pool */
 	eventPool_exit(eventPool);
 
 }

+ 11 - 0
TestScenarios/test-c/Test_ShallowHistory/main.c

@@ -30,12 +30,23 @@ void setupStatemachine(Test_ShallowHistoryStatemachine* machine, Timer* dummyTim
 	/* initialize state machine */
 	test_ShallowHistoryStatemachine_init(machine, dummyTimer, eventPool);
 
+	/* call all necessary enter functions */
+	test_ShallowHistoryStatemachine_enter(machine);
+
 }
 
 void teardownStatemachine(Test_ShallowHistoryStatemachine* machine, Timer* dummyTimer, EventPool* eventPool)
 {
+	/* call all exit actions for this state machine */
 	test_ShallowHistoryStatemachine_exit(machine);
+
+	/* free all internal memory for this state machine */
+	test_ShallowHistoryStatemachine_destruct(machine);
+
+	/* free the timer */
 	timer_exit(dummyTimer);
+
+	/* free all events in the event pool */
 	eventPool_exit(eventPool);
 
 }

+ 11 - 0
TestScenarios/test-c/Test_Transition/main.c

@@ -30,12 +30,23 @@ void setupStatemachine(Test_TransitionStatemachine* machine, Timer* dummyTimer,
 	/* initialize state machine */
 	test_TransitionStatemachine_init(machine, dummyTimer, eventPool);
 
+	/* call all necessary enter functions */
+	test_TransitionStatemachine_enter(machine);
+
 }
 
 void teardownStatemachine(Test_TransitionStatemachine* machine, Timer* dummyTimer, EventPool* eventPool)
 {
+	/* call all exit actions for this state machine */
 	test_TransitionStatemachine_exit(machine);
+
+	/* free all internal memory for this state machine */
+	test_TransitionStatemachine_destruct(machine);
+
+	/* free the timer */
 	timer_exit(dummyTimer);
+
+	/* free all events in the event pool */
 	eventPool_exit(eventPool);
 
 }