blob: 14be01c4b783485f6be0656a2b2c1d6f2dedf1e6 [file] [log] [blame]
Brian Silverman65e49702014-04-30 17:36:40 -07001#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
8namespace aos {
9namespace 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.
16class 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_