HistoryWithExitPoint.cc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 "HistoryWithExitPoint.h"
  14. HistoryWithExitPoint handle;
  15. TEST(StatemachineTest, historyEntryAfterExit) {
  16. historyWithExitPoint_init(&handle);
  17. historyWithExitPoint_enter(&handle);
  18. EXPECT_TRUE(historyWithExitPoint_isStateActive(&handle, HistoryWithExitPoint_mr_A_r_X1));
  19. historyWithExitPointIface_raise_push(&handle);
  20. historyWithExitPoint_runCycle(&handle);
  21. EXPECT_TRUE(historyWithExitPoint_isStateActive(&handle, HistoryWithExitPoint_mr_B));
  22. historyWithExitPointIface_raise_back(&handle);
  23. historyWithExitPoint_runCycle(&handle);
  24. EXPECT_TRUE(historyWithExitPoint_isStateActive(&handle, HistoryWithExitPoint_mr_A_r_X1));
  25. historyWithExitPointIface_raise_next(&handle);
  26. historyWithExitPoint_runCycle(&handle);
  27. EXPECT_TRUE(historyWithExitPoint_isStateActive(&handle, HistoryWithExitPoint_mr_A_r_X2));
  28. historyWithExitPointIface_raise_push(&handle);
  29. historyWithExitPoint_runCycle(&handle);
  30. EXPECT_TRUE(historyWithExitPoint_isStateActive(&handle, HistoryWithExitPoint_mr_B));
  31. historyWithExitPointIface_raise_back(&handle);
  32. historyWithExitPoint_runCycle(&handle);
  33. EXPECT_TRUE(historyWithExitPoint_isStateActive(&handle, HistoryWithExitPoint_mr_A_r_X2));
  34. }