CKeywordsTest.cc 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Generated by YAKINDU Statechart Tools code generator. */
  2. #include <string>
  3. #include "gtest/gtest.h"
  4. #include "CKeywords.h"
  5. #include "sc_runner.h"
  6. #include "sc_types.h"
  7. namespace {
  8. //! The timers are managed by a timer service. */
  9. static SctUnitRunner * runner;
  10. class CKeywordsTest : public ::testing::Test{
  11. protected:
  12. CKeywords* statechart;
  13. virtual void SetUp() {
  14. statechart = new CKeywords();
  15. statechart->init();
  16. runner = new SctUnitRunner(
  17. statechart,
  18. false,
  19. 200
  20. );
  21. }
  22. virtual void TearDown() {
  23. delete statechart;
  24. delete runner;
  25. }
  26. };
  27. TEST_F(CKeywordsTest, CKeywordsTest) {
  28. statechart->enter();
  29. EXPECT_TRUE(statechart->isStateActive(CKeywords::auto_char));
  30. statechart->getDefaultSCI()->raise_auto();
  31. runner->proceed_cycles(1);
  32. EXPECT_TRUE(statechart->isStateActive(CKeywords::auto_loop));
  33. EXPECT_TRUE(statechart->isStateActive(CKeywords::auto_loop_switch_case));
  34. EXPECT_TRUE(statechart->isStateActive(CKeywords::auto_loop_switch_case_enum_asm));
  35. }
  36. }