Robobo
RoboboTests.h
1 #include "Arduino.h"
2 #include "gmock/gmock.h"
3 #include "Robobo.h"
4 #include "DCMotor.h"
5 #include "ArduinoMock.h"
6 #include "FreeRTOSMock.h"
7 #include "PIDMock.h"
8 #include <iostream>
9 
10 using namespace std;
11 
12 class RoboboTests : public ::testing::Test, public Robobo
13 {
14  public:
15  static ArduinoMock *arduino;
16  static FreeRTOSMock *rtos;
17  static ArduinoSerialMock Serial;
18  static PIDMock *pid1;
19  static PIDMock *pid2;
20 
21  DCMotor *dcm1;
22  DCMotor *dcm2;
23 
24  RoboboTests()
25  {
26  arduino = new::testing::NiceMock<ArduinoMock>();
27  rtos = new::testing::NiceMock<FreeRTOSMock>();
28  pid1 = new::testing::NiceMock<PIDMock>();
29  pid2 = new::testing::NiceMock<PIDMock>();
30 
31  // We need to configure parent class object
32  dcm1 = new DCMotor(1,2,3,4,5,pid1);
33  dcm2 = new DCMotor(11,12,13,14,15,pid2);
34  dc1 = dcm1;
35  dc2 = dcm2;
36  }
37 
38  virtual void SetUp()
39  {
40  arduino = new::testing::NiceMock<ArduinoMock>();
41  rtos = new::testing::NiceMock<FreeRTOSMock>();
42  pid1 = new::testing::NiceMock<PIDMock>();
43  pid2 = new::testing::NiceMock<PIDMock>();
44  dcm1->reset();
45  dcm2->reset();
46  }
47 
48  virtual void TearDown()
49  {
50  delete arduino;
51  delete rtos;
52  delete pid1;
53  delete pid2;
54 
55  }
56 
57 };
58 
59 
Definition: Robobo.h:16
Definition: PIDMock.h:6
void reset()
Definition: DCMotor.cpp:61
Definition: FreeRTOSMock.h:9
Definition: ArduinoMock.h:17
Definition: RoboboTests.h:12
Definition: DCMotor.h:17
Definition: ArduinoMock.h:7