Created a helper function for the ADC storage testing
This commit is contained in:
parent
7deea50e91
commit
4ab57eb948
|
@ -37,9 +37,20 @@ TEST(test_ADC, FirstTest)
|
||||||
CHECK(true);
|
CHECK(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ADCStoresPortState(void){
|
||||||
|
mock().expectOneCall("RegEdit_ReadReg")
|
||||||
|
.withPointerParameter("reg", (void *) &PORTA.OUT)
|
||||||
|
.andReturnValue(0xFF);
|
||||||
|
|
||||||
|
mock().expectOneCall("RegEdit_ReadReg")
|
||||||
|
.withPointerParameter("reg", (void *) &PORTA.DIR)
|
||||||
|
.andReturnValue(0xFF);
|
||||||
|
}
|
||||||
|
|
||||||
TEST(test_ADC, ADC_InitPortAPin7UsesCorrectRegisters)
|
TEST(test_ADC, ADC_InitPortAPin7UsesCorrectRegisters)
|
||||||
{
|
{
|
||||||
|
ADCStoresPortState();
|
||||||
|
|
||||||
//Check for setting the direction to input.
|
//Check for setting the direction to input.
|
||||||
mock().expectOneCall("RegEdit_SetBit")
|
mock().expectOneCall("RegEdit_SetBit")
|
||||||
.withPointerParameter("reg", (void *) &PORTA.DIRCLR)
|
.withPointerParameter("reg", (void *) &PORTA.DIRCLR)
|
||||||
|
|
Loading…
Reference in New Issue