CastExpressions.cc 1012 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Copyright (c) 2015 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 "CastExpressions.h"
  14. CastExpressions handle;
  15. TEST(StatemachineTest, CastExpressionTest) {
  16. castExpressions_init(&handle);
  17. castExpressions_enter(&handle);
  18. EXPECT_TRUE(castExpressionsIface_get_realValue(&handle) == 5l);
  19. EXPECT_TRUE(castExpressionsIface_get_intValue(&handle) == 5l);
  20. castExpressions_runCycle(&handle);
  21. EXPECT_TRUE(castExpressionsIface_get_realValue(&handle) == 15l);
  22. castExpressions_runCycle(&handle);
  23. EXPECT_TRUE(castExpressions_isActive(&handle, CastExpressions_main_region_C));
  24. EXPECT_TRUE(castExpressionsIface_get_realValue(&handle) == 757l);
  25. }