123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- /* Generated by YAKINDU Statechart Tools code generator. */
- #include "gtest/gtest.h"
- #include "LocalEvents.h"
- #include "sc_timer_service.h"
- //! The timers are managed by a timer service. */
- static sc_unit_timer_service_t timer_service;
- static LocalEvents statechart;
- class LocalEventsTest : public ::testing::Test{
- protected:
- virtual void SetUp() {
- localEvents_init(&statechart);
- sc_timer_service_init(
- &timer_service,
- 0,
- (sc_run_cycle_fp) &localEvents_runCycle,
- true,
- 200,
- &statechart
- );
- }
- };
- TEST_F(LocalEventsTest, test) {
- localEvents_enter(&statechart);
- EXPECT_TRUE(localEvents_isStateActive(&statechart, LocalEvents_localEvents_r1_Comp1_r_A1));
- EXPECT_TRUE(localEvents_isStateActive(&statechart, LocalEvents_localEvents_r2_Comp2_r_A2));
- localEventsIface_raise_e(&statechart);
- EXPECT_TRUE(localEvents_isStateActive(&statechart, LocalEvents_localEvents_r1_Comp1_r_D1));
- EXPECT_TRUE(localEvents_isStateActive(&statechart, LocalEvents_localEvents_r2_Comp2_r_D2));
- EXPECT_TRUE(localEventsIface_get_cycleCountSm(&statechart)== 5l);
- EXPECT_TRUE(localEventsIface_get_cycleCount1(&statechart)== 5l);
- EXPECT_TRUE(localEventsIface_get_cycleCount2(&statechart)== 5l);
- EXPECT_TRUE(localEventsIface_get_checksum(&statechart)== 3l);
- localEvents_exit(&statechart);
- }
|