RaiseEventTest.cc 972 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * Copyright (c) 2013 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 "RaiseEvent.hpp"
  14. TEST(StatemachineTest, raiseEvent) {
  15. RaiseEvent* statechart = new RaiseEvent();
  16. statechart->init();
  17. statechart->enter();
  18. EXPECT_TRUE(statechart->isActive(RaiseEvent_second_region_SateA));
  19. EXPECT_TRUE(statechart->isActive(RaiseEvent_main_region_StateA));
  20. statechart->raise_e2();
  21. statechart->runCycle();
  22. statechart->runCycle();
  23. EXPECT_TRUE(statechart->isActive(RaiseEvent_second_region_StateB));
  24. EXPECT_TRUE(statechart->isActive(RaiseEvent_main_region_StateB));
  25. delete statechart;
  26. }