Re-added the fake microseconds function for testing to pass.
This commit is contained in:
parent
8eb5600499
commit
d60e4d0586
|
@ -12,6 +12,11 @@
|
|||
#include "TriacOut.h"
|
||||
#include "RegEdit.h"
|
||||
|
||||
|
||||
void Delay_MicroSeconds_impl(double us);
|
||||
|
||||
void (*Delay_MicroSeconds)(double us) = &Delay_MicroSeconds_impl;
|
||||
|
||||
void TriacOut_InitTimerA(void)
|
||||
{
|
||||
|
||||
|
@ -42,3 +47,7 @@ void TriacOut_PulsePins(uint16_t pulse_time)
|
|||
RegEdit_ClearBit((void *) &PORTB.OUT, G2);
|
||||
RegEdit_ClearBit((void *) &PORTB.OUT, G3);
|
||||
}
|
||||
|
||||
void Delay_MicroSeconds_impl(double us){
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -18,11 +18,17 @@ extern "C"
|
|||
#include "MockRegEdit.h"
|
||||
}
|
||||
|
||||
|
||||
void FakeDelay(double us)
|
||||
{
|
||||
//do Nothing.
|
||||
}
|
||||
|
||||
TEST_GROUP(test_TriacOut)
|
||||
{
|
||||
void setup()
|
||||
{
|
||||
|
||||
UT_PTR_SET(Delay_MicroSeconds, FakeDelay);
|
||||
}
|
||||
void teardown()
|
||||
{
|
||||
|
@ -78,18 +84,8 @@ TEST(test_TriacOut, TriacOut_SetAllHigh)
|
|||
TriacOut_SetAllHigh();
|
||||
}
|
||||
|
||||
|
||||
void FakeDelay(double us)
|
||||
{
|
||||
//do Nothing.
|
||||
}
|
||||
|
||||
|
||||
|
||||
TEST(test_TriacOut, TriacOut_PulsePins)
|
||||
{
|
||||
UT_PTR_SET(Delay_MicroSeconds, FakeDelay);
|
||||
|
||||
|
||||
//Expect that pin PA1 is set to output
|
||||
mock().expectOneCall("RegEdit_ClearBit")
|
||||
|
|
Loading…
Reference in New Issue