BooleanExpressionsTest.cc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 "gtest/gtest.h"
  12. #include "BooleanExpressions.h"
  13. BooleanExpressions handle;
  14. class StatemachineTest : public ::testing::Test{
  15. protected:
  16. virtual void SetUp() {
  17. booleanExpressions_init(&handle);
  18. }
  19. };
  20. TEST_F(StatemachineTest, booleanExpressions) {
  21. booleanExpressions_enter(&handle);
  22. EXPECT_TRUE(booleanExpressions_isStateActive(&handle, BooleanExpressions_main_region_StateA));
  23. EXPECT_TRUE(booleanExpressionsIface_get_myBool1(&handle)== true);
  24. EXPECT_TRUE(booleanExpressionsIface_get_myBool2(&handle)== false);
  25. booleanExpressionsIface_raise_e1(&handle);
  26. booleanExpressions_runCycle(&handle);
  27. EXPECT_TRUE(booleanExpressions_isStateActive(&handle, BooleanExpressions_main_region_StateB));
  28. EXPECT_TRUE(booleanExpressionsIface_get_and(&handle)== false);
  29. EXPECT_TRUE(booleanExpressionsIface_get_or(&handle)== true);
  30. EXPECT_TRUE(booleanExpressionsIface_get_not(&handle)== false);
  31. EXPECT_TRUE(booleanExpressionsIface_get_equal(&handle)== false);
  32. EXPECT_TRUE(booleanExpressionsIface_get_notequal(&handle)== true);
  33. }