123456789101112131415161718192021222324252627282930313233 |
- #include <string>
- #include "gtest/gtest.h"
- #include "StatechartLocalReactions.h"
- TEST(StatemachineTest, statechartLocalReactionsTest) {
- StatechartLocalReactions* statechart = new StatechartLocalReactions();
- statechart->init();
- statechart->enter();
- EXPECT_TRUE(statechart->isActive(StatechartLocalReactions::S1));
- EXPECT_TRUE(statechart->isActive(StatechartLocalReactions::a));
- while (statechart->getSCInterface()->get_myInt()< 10) {
- EXPECT_TRUE(statechart->isActive(StatechartLocalReactions::a));
- if (statechart->getSCInterface()->get_myInt()%2== 0) {
- EXPECT_TRUE(statechart->isActive(StatechartLocalReactions::S1));
- }
- else {
- EXPECT_TRUE(statechart->isActive(StatechartLocalReactions::S2));;
- }
- statechart->runCycle();
- }
- delete statechart;
- }
|