ConstOnlyDefaultScopeTest.cc 1.1 KB

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