FinalStateTest.cc 712 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* Generated by YAKINDU Statechart Tools code generator. */
  2. #include <string>
  3. #include "gtest/gtest.h"
  4. #include "FinalState.h"
  5. #include "sc_runner.h"
  6. #include "sc_types.h"
  7. static FinalState* statechart;
  8. //! The timers are managed by a timer service. */
  9. static SctUnitRunner * runner;
  10. class FinalStateTest : public ::testing::Test{
  11. protected:
  12. virtual void SetUp() {
  13. statechart = new FinalState();
  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(FinalStateTest, StatechartNameTest) {
  27. statechart->enter();
  28. runner->proceed_cycles(1);
  29. EXPECT_TRUE(statechart->isFinal());
  30. }