StateIsActiveTest.cc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * Copyright (c) 2017 committers of YAKINDU and others.
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * http://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors:
  9. * committers of YAKINDU - initial API and implementation
  10. */
  11. #include "gtest/gtest.h"
  12. #include "StateIsActive.h"
  13. static StateIsActive statechart;
  14. class StatemachineTest : public ::testing::Test{
  15. protected:
  16. virtual void SetUp() {
  17. stateIsActive_init(&statechart);
  18. }
  19. };
  20. TEST_F(StatemachineTest, stateIsActive) {
  21. stateIsActive_enter(&statechart);
  22. EXPECT_TRUE(stateIsActive_isStateActive(&statechart, StateIsActive_R1_R1A));
  23. EXPECT_TRUE(stateIsActive_isStateActive(&statechart, StateIsActive_R2_R2A));
  24. stateIsActiveIface_raise_event1(&statechart);
  25. stateIsActive_runCycle(&statechart);
  26. stateIsActive_runCycle(&statechart);
  27. EXPECT_TRUE(stateIsActive_isStateActive(&statechart, StateIsActive_R1_R1B));
  28. EXPECT_TRUE(stateIsActive_isStateActive(&statechart, StateIsActive_R2_R2B));
  29. }