123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- /* Generated by YAKINDU Statechart Tools code generator. */
- #include "gtest/gtest.h"
- #include "NoLocalEvents.h"
- #include "sc_timer_service.h"
- //! The timers are managed by a timer service. */
- static sc_unit_timer_service_t timer_service;
- static NoLocalEvents statechart;
- class NoLocalEventsTest : public ::testing::Test{
- protected:
- virtual void SetUp() {
- noLocalEvents_init(&statechart);
- sc_timer_service_init(
- &timer_service,
- 0,
- (sc_run_cycle_fp) &noLocalEvents_runCycle,
- true,
- 200,
- &statechart
- );
- }
- };
- TEST_F(NoLocalEventsTest, test) {
- noLocalEvents_enter(&statechart);
- EXPECT_TRUE(noLocalEvents_isStateActive(&statechart, NoLocalEvents_main_region_StateA));
- noLocalEventsIface_raise_e(&statechart);
- EXPECT_TRUE(noLocalEvents_isStateActive(&statechart, NoLocalEvents_main_region_StateB));
- noLocalEventsIface_raise_e(&statechart);
- EXPECT_TRUE(noLocalEvents_isStateActive(&statechart, NoLocalEvents_main_region_StateA));
- EXPECT_TRUE((noLocalEventsIface_get_x(&statechart)== 0l));
- noLocalEventsIface_raise_i(&statechart, 42l);
- EXPECT_TRUE(noLocalEvents_isStateActive(&statechart, NoLocalEvents_main_region_StateB));
- EXPECT_TRUE((noLocalEventsIface_get_x(&statechart)== 42l));
- noLocalEvents_exit(&statechart);
- }
|