BooleanExpressionsTest.cc 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Copyright (c) 2014 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* statechart = new BooleanExpressions();
  16. statechart->init();
  17. statechart->enter();
  18. EXPECT_TRUE(statechart->isActive(BooleanExpressions::StateA));
  19. EXPECT_TRUE(statechart->getSCInterface()->get_myBool1()== true);
  20. EXPECT_TRUE(statechart->getSCInterface()->get_myBool2()== false);
  21. statechart->raise_e1();
  22. statechart->runCycle();
  23. EXPECT_TRUE(statechart->isActive(BooleanExpressions::StateB));
  24. EXPECT_TRUE(statechart->getSCInterface()->get_and()== false);
  25. EXPECT_TRUE(statechart->getSCInterface()->get_or()== true);
  26. EXPECT_TRUE(statechart->getSCInterface()->get_not()== false);
  27. EXPECT_TRUE(statechart->getSCInterface()->get_equal()== false);
  28. EXPECT_TRUE(statechart->getSCInterface()->get_notequal()== true);
  29. delete statechart;
  30. }