123456789101112131415161718192021222324252627282930313233343536373839 |
- /**
- * Copyright (c) 2017 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * committers of YAKINDU - initial API and implementation
- */
- #include "gtest/gtest.h"
- #include "BooleanExpressions.h"
- BooleanExpressions handle;
- class StatemachineTest : public ::testing::Test{
- protected:
- virtual void SetUp() {
- booleanExpressions_init(&handle);
- }
- };
- TEST_F(StatemachineTest, booleanExpressions) {
- booleanExpressions_enter(&handle);
- EXPECT_TRUE(booleanExpressions_isStateActive(&handle, BooleanExpressions_main_region_StateA));
- EXPECT_TRUE(booleanExpressionsIface_get_myBool1(&handle)== true);
- EXPECT_TRUE(booleanExpressionsIface_get_myBool2(&handle)== false);
- booleanExpressionsIface_raise_e1(&handle);
- booleanExpressions_runCycle(&handle);
- EXPECT_TRUE(booleanExpressions_isStateActive(&handle, BooleanExpressions_main_region_StateB));
- EXPECT_TRUE(booleanExpressionsIface_get_and(&handle)== false);
- EXPECT_TRUE(booleanExpressionsIface_get_or(&handle)== true);
- EXPECT_TRUE(booleanExpressionsIface_get_not(&handle)== false);
- EXPECT_TRUE(booleanExpressionsIface_get_equal(&handle)== false);
- EXPECT_TRUE(booleanExpressionsIface_get_notequal(&handle)== true);
- }
|