ConstOnlyInternalScopeTest.cc 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * Copyright (c) 2017 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 "ConstOnlyInternalScope.h"
  14. ConstOnlyInternalScope handle;
  15. TEST(StatemachineTest, statechartEntry) {
  16. constOnlyInternalScope_init(&handle);
  17. constOnlyInternalScope_enter(&handle);
  18. EXPECT_TRUE(constOnlyInternalScope_isStateActive(&handle, ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_A));
  19. }
  20. TEST(StatemachineTest, stateTransition) {
  21. constOnlyInternalScope_init(&handle);
  22. constOnlyInternalScope_enter(&handle);
  23. constOnlyInternalScopeIface_raise_e(&handle, 1l);
  24. constOnlyInternalScope_runCycle(&handle);
  25. EXPECT_TRUE(constOnlyInternalScope_isStateActive(&handle, ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_B));
  26. }