TimedTransitionsTest.cc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 "TimedTransitions.h"
  13. #include "TimedTransitionsRequired.h"
  14. TimedTransitions handle;
  15. class StatemachineTest : public ::testing::Test{
  16. protected:
  17. virtual void SetUp() {
  18. timedTransitions_init(&handle);
  19. }
  20. };
  21. TEST_F(StatemachineTest, Timer01) {
  22. timedTransitions_enter(&handle);
  23. EXPECT_TRUE(timedTransitions_isStateActive(&handle, TimedTransitions_main_region_Start));
  24. // here should be waited 2030 Seconds
  25. timedTransitions_runCycle(&handle);
  26. EXPECT_TRUE(timedTransitions_isStateActive(&handle, TimedTransitions_main_region_End));
  27. }
  28. void timedTransitions_setTimer(TimedTransitions* handle, const sc_eventid evid, const sc_integer time_ms, const sc_boolean periodic){
  29. // Mockup
  30. timedTransitions_raiseTimeEvent(handle, evid);
  31. }
  32. void timedTransitions_unsetTimer(TimedTransitions* handle, const sc_eventid evid){
  33. // Mockup
  34. }