LogicalAndTests.cc 819 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Generated by YAKINDU Statechart Tools code generator. */
  2. #include "gtest/gtest.h"
  3. #include "LogicalAnd.h"
  4. #include "sc_timer_service.h"
  5. //! The timers are managed by a timer service. */
  6. static sc_unit_timer_service_t timer_service;
  7. static LogicalAnd statechart;
  8. class LogicalAndTests : public ::testing::Test{
  9. protected:
  10. virtual void SetUp() {
  11. logicalAnd_init(&statechart);
  12. sc_timer_service_init(
  13. &timer_service,
  14. 0,
  15. (sc_run_cycle_fp) &logicalAnd_runCycle,
  16. false,
  17. 200,
  18. &statechart
  19. );
  20. }
  21. };
  22. TEST_F(LogicalAndTests, operandEvaluationOrder) {
  23. logicalAnd_enter(&statechart);
  24. sc_timer_service_proceed_cycles(&timer_service, 1);
  25. EXPECT_TRUE(logicalAndIface_get_x(&statechart)== 4l && logicalAndIface_get_b(&statechart)) << "logical and expression was executed in wrong order..." ;
  26. }