Brian Silverman | 65e4970 | 2014-04-30 17:36:40 -0700 | [diff] [blame^] | 1 | #ifndef AOS_COMMON_CONTROLS_CONTROL_LOOP_TEST_H_ |
| 2 | #define AOS_COMMON_CONTROLS_CONTROL_LOOP_TEST_H_ |
| 3 | |
| 4 | #include "gtest/gtest.h" |
| 5 | |
| 6 | #include "aos/common/queue_testutils.h" |
| 7 | |
| 8 | namespace aos { |
| 9 | namespace testing { |
| 10 | |
| 11 | // Handles setting up the environment that all control loops need to actually |
| 12 | // run. |
| 13 | // This includes sending the queue messages and Clear()ing the queues when |
| 14 | // appropriate. |
| 15 | // It also includes dealing with ::aos::time. |
| 16 | class ControlLoopTest : public ::testing::Test { |
| 17 | public: |
| 18 | ControlLoopTest(); |
| 19 | |
| 20 | virtual ~ControlLoopTest(); |
| 21 | |
| 22 | // Simulates everything that happens during 1 time step. |
| 23 | void SimulateTimestep(bool enabled); |
| 24 | |
| 25 | private: |
| 26 | bool sent_robot_state_last_time_ = false; |
| 27 | |
| 28 | ::aos::common::testing::GlobalCoreInstance my_core; |
| 29 | }; |
| 30 | |
| 31 | } // namespace testing |
| 32 | } // namespace aos |
| 33 | |
| 34 | #endif // AOS_COMMON_CONTROLS_CONTROL_LOOP_TEST_H_ |