Created a helper function for the ADC storage testing

This commit is contained in:
jakeg00dwin 2024-07-27 09:23:36 -07:00
parent 7deea50e91
commit 4ab57eb948
1 changed files with 11 additions and 0 deletions

View File

@ -37,9 +37,20 @@ TEST(test_ADC, FirstTest)
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)
{
ADCStoresPortState();
//Check for setting the direction to input.
mock().expectOneCall("RegEdit_SetBit")
.withPointerParameter("reg", (void *) &PORTA.DIRCLR)