123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /* Generated by YAKINDU Statechart Tools code generator. */
- #include <string>
- #include "gtest/gtest.h"
- #include "StatechartLocalReactions.h"
- #include "sc_runner.h"
- #include "sc_types.h"
- namespace {
- //! The timers are managed by a timer service. */
- static SctUnitRunner * runner;
- class StatechartLocalReactionsTest : public ::testing::Test{
- protected:
-
- StatechartLocalReactions* statechart;
-
- virtual void SetUp() {
- statechart = new StatechartLocalReactions();
- statechart->init();
- runner = new SctUnitRunner(
- statechart,
- false,
- 200
- );
- }
- virtual void TearDown() {
- delete statechart;
- delete runner;
- }
-
-
- };
- TEST_F(StatechartLocalReactionsTest, statechartLocalReactionsTest) {
-
- statechart->enter();
-
- EXPECT_TRUE(statechart->isStateActive(StatechartLocalReactions::main_region_S1));
-
- EXPECT_TRUE(statechart->isStateActive(StatechartLocalReactions::region2_a));
-
- while (statechart->getDefaultSCI()->get_myInt()< 10l) {
- EXPECT_TRUE(statechart->isStateActive(StatechartLocalReactions::region2_a));
- if (statechart->getDefaultSCI()->get_myInt()%2l== 0l) {
- EXPECT_TRUE(statechart->isStateActive(StatechartLocalReactions::main_region_S1));
- }
- else {
- EXPECT_TRUE(statechart->isStateActive(StatechartLocalReactions::main_region_S2));
- }
- runner->proceed_cycles(1);
- }
-
-
- }
- }
|