summaryrefslogtreecommitdiff
path: root/FreeRTOS-Plus/Test/CMock/examples/temp_sensor/test/TestTimerConductor.c
blob: 8064a8c5115c3f852a87062f0c50f62552989f5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "unity.h"
#include "Types.h"
#include "TimerConductor.h"
#include "MockTimerHardware.h"
#include "MockTimerModel.h"
#include "MockTimerInterruptHandler.h"

void setUp(void)
{
}

void tearDown(void)
{
}

void testInitShouldCallHardwareInit(void)
{
  TimerHardware_Init_Expect();

  TimerConductor_Init();
}

void testRunShouldGetSystemTimeAndPassOnToModelForEventScheduling(void)
{
  Timer_GetSystemTime_ExpectAndReturn(1230);
  TimerModel_UpdateTime_Expect(1230);
  TimerConductor_Run();

  Timer_GetSystemTime_ExpectAndReturn(837460);
  TimerModel_UpdateTime_Expect(837460);
  TimerConductor_Run();
}