SameNameDifferentRegionTest.cc 1.1 KB

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Copyright (c) 2014 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 <string>
  12. #include "gtest/gtest.h"
  13. #include "SameNameDifferentRegion.h"
  14. TEST(StatemachineTest, sameNameDifferenRegionTest) {
  15. SameNameDifferentRegion* statechart = new SameNameDifferentRegion();
  16. statechart->init();
  17. statechart->enter();
  18. EXPECT_TRUE(statechart->isActive(SameNameDifferentRegion::StateA));
  19. statechart->raise_e1();
  20. statechart->runCycle();
  21. EXPECT_TRUE(statechart->isActive(SameNameDifferentRegion::StateB));
  22. EXPECT_TRUE(statechart->isActive(SameNameDifferentRegion::r1_StateA));
  23. statechart->raise_e1();
  24. statechart->runCycle();
  25. EXPECT_TRUE(statechart->isActive(SameNameDifferentRegion::StateB));
  26. EXPECT_TRUE(statechart->isActive(SameNameDifferentRegion::r1_StateB));
  27. delete statechart;
  28. }