Added missing test for the PORTB load handler function.

This commit is contained in:
jakeg00dwin 2024-09-23 12:08:54 -07:00
parent 6990d2183e
commit 6696a45a80
1 changed files with 16 additions and 0 deletions

View File

@ -55,6 +55,22 @@ TEST(test_load, PortAHandlerSuccess)
Load_HandleLoadPortA(4, 7); Load_HandleLoadPortA(4, 7);
} }
TEST(test_load, PortBHandlerSuccess)
{
mock().expectOneCall("ADC_Init")
.withUnsignedIntParameter("pin_num", 4);
mock().expectOneCall("ADC_Enable");
mock().expectOneCall("ADC_ReadValue_Impl")
.withUnsignedIntParameter("pin_num", 4);
mock().expectOneCall("ADC_Disable");
mock().expectOneCall("RegEdit_ClearBit")
.withPointerParameter("reg", (void *) &PORTB.OUT)
.withUnsignedIntParameter("bit_num", 7);
Load_HandleLoadPortB(4, 7);
}
TEST(test_load, HighThreshValid) TEST(test_load, HighThreshValid)
{ {
bool result = is_valid_load(HIGHTHRESH); bool result = is_valid_load(HIGHTHRESH);