ExitOnSelfTransition.cc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * Copyright (c) 2015 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 "ExitOnSelfTransition.h"
  14. ExitOnSelfTransition handle;
  15. TEST(StatemachineTest, ExitOnSelfTransitionTest) {
  16. exitOnSelfTransition_init(&handle);
  17. exitOnSelfTransition_enter(&handle);
  18. EXPECT_TRUE(exitOnSelfTransition_isActive(&handle, ExitOnSelfTransition_main_region_A));
  19. EXPECT_TRUE(exitOnSelfTransitionIface_get_entryCount(&handle) == 1l);
  20. EXPECT_TRUE(exitOnSelfTransitionIface_get_exitCount(&handle) == 0l);
  21. exitOnSelfTransitionIface_raise_e(&handle);
  22. exitOnSelfTransition_runCycle(&handle);
  23. EXPECT_TRUE(exitOnSelfTransitionIface_get_entryCount(&handle) == 2l);
  24. EXPECT_TRUE(exitOnSelfTransitionIface_get_exitCount(&handle) == 1l);
  25. exitOnSelfTransitionIface_raise_f(&handle);
  26. exitOnSelfTransition_runCycle(&handle);
  27. EXPECT_TRUE(exitOnSelfTransitionIface_get_entryCount(&handle) == 2l);
  28. EXPECT_TRUE(exitOnSelfTransitionIface_get_exitCount(&handle) == 2l);
  29. }