From 6696a45a8008688fc283bb1d28947d846022403c Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Mon, 23 Sep 2024 12:08:54 -0700 Subject: [PATCH] Added missing test for the PORTB load handler function. --- tests/load/test_load.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/load/test_load.cpp b/tests/load/test_load.cpp index c87ce54..c3589ba 100644 --- a/tests/load/test_load.cpp +++ b/tests/load/test_load.cpp @@ -55,6 +55,22 @@ TEST(test_load, PortAHandlerSuccess) 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) { bool result = is_valid_load(HIGHTHRESH);