123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- /* Generated by YAKINDU Statechart Tools code generator. */
- #include "gtest/gtest.h"
- #include "StatechartLocalReactions.h"
- #include "sc_timer_service.h"
- //! The timers are managed by a timer service. */
- static sc_unit_timer_service_t timer_service;
- static StatechartLocalReactions statechart;
- class StatechartLocalReactionsTest : public ::testing::Test{
- protected:
- virtual void SetUp() {
- statechartLocalReactions_init(&statechart);
- sc_timer_service_init(
- &timer_service,
- 0,
- (sc_run_cycle_fp) &statechartLocalReactions_runCycle,
- false,
- 200,
- &statechart
- );
- }
- };
- TEST_F(StatechartLocalReactionsTest, statechartLocalReactionsTest) {
- statechartLocalReactions_enter(&statechart);
- EXPECT_TRUE(statechartLocalReactions_isStateActive(&statechart, StatechartLocalReactions_main_region_S1));
- EXPECT_TRUE(statechartLocalReactions_isStateActive(&statechart, StatechartLocalReactions_region2_a));
- while (statechartLocalReactionsIface_get_myInt(&statechart)< 10l) {
- EXPECT_TRUE(statechartLocalReactions_isStateActive(&statechart, StatechartLocalReactions_region2_a));
- if (statechartLocalReactionsIface_get_myInt(&statechart)%2l== 0l) {
- EXPECT_TRUE(statechartLocalReactions_isStateActive(&statechart, StatechartLocalReactions_main_region_S1));
- }
- else {
- EXPECT_TRUE(statechartLocalReactions_isStateActive(&statechart, StatechartLocalReactions_main_region_S2));
- }
- sc_timer_service_proceed_cycles(&timer_service, 1);
- }
- }
|