ConstOnlyDefaultScopeTest.cc 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Copyright (c) 2016 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 "ConstOnlyDefaultScope.h"
  14. TEST(StatemachineTest, statechartEntry) {
  15. ConstOnlyDefaultScope* statechart = new ConstOnlyDefaultScope();
  16. statechart->init();
  17. statechart->enter();
  18. EXPECT_TRUE(statechart->isStateActive(ConstOnlyDefaultScope::ConstOnlyDefaultScope_main_region_A));
  19. delete statechart;
  20. }
  21. TEST(StatemachineTest, stateTransition) {
  22. ConstOnlyDefaultScope* statechart = new ConstOnlyDefaultScope();
  23. statechart->init();
  24. statechart->enter();
  25. statechart->getSCI_A()->raise_e(1l);
  26. statechart->runCycle();
  27. EXPECT_TRUE(statechart->isStateActive(ConstOnlyDefaultScope::ConstOnlyDefaultScope_main_region_B));
  28. delete statechart;
  29. }