BooleanExpressions.cc 1.3 KB

12345678910111213141516171819202122232425262728293031
  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 "BooleanExpressions.h"
  14. TEST(StatemachineTest, booleanExpressions) {
  15. BooleanExpressions handle;
  16. booleanExpressions_init(&handle);
  17. booleanExpressions_enter(&handle);
  18. EXPECT_TRUE(booleanExpressions_isActive(&handle, BooleanExpressions_main_region_StateA));
  19. EXPECT_TRUE(booleanExpressionsIface_get_myBool1(&handle) == true);
  20. EXPECT_TRUE(booleanExpressionsIface_get_myBool2(&handle) == false);
  21. booleanExpressionsIface_raise_e1(&handle);
  22. booleanExpressions_runCycle(&handle);
  23. EXPECT_TRUE(booleanExpressions_isActive(&handle, BooleanExpressions_main_region_StateB));
  24. EXPECT_TRUE(booleanExpressionsIface_get_and(&handle) == false);
  25. EXPECT_TRUE(booleanExpressionsIface_get_or(&handle) == true);
  26. EXPECT_TRUE(booleanExpressionsIface_get_not(&handle) == false);
  27. EXPECT_TRUE(booleanExpressionsIface_get_equal(&handle) == false);
  28. EXPECT_TRUE(booleanExpressionsIface_get_notequal(&handle) == true);
  29. }