From 029b96aade154b8ce63ec51fde03240108889b50 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Fri, 26 Jul 2024 18:19:05 -0700 Subject: [PATCH] Added two mock calls for the restore of the port state. --- tests/ADC/test_ADC.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/ADC/test_ADC.cpp b/tests/ADC/test_ADC.cpp index 3c6052f..115cfba 100644 --- a/tests/ADC/test_ADC.cpp +++ b/tests/ADC/test_ADC.cpp @@ -128,6 +128,7 @@ TEST(test_ADC, ADC_EnableSuccessOnPin7) TEST(test_ADC, ADC_EnableNothingOnHighPinNumbers) { + mock().expectNoCall("RegEdit_SetBit"); ADC_Enable(8); } @@ -141,7 +142,14 @@ TEST(test_ADC, ADC_DisablePasses) mock().expectOneCall("RegEdit_ClearBit") .withPointerParameter("reg", (void *) &ADC0.CTRLA) .withUnsignedIntParameter("bit_num", 0); + + mock().expectOneCall("RegEdit_SetNum") + .withPointerParameter("reg", (void*) &PORTA.OUT) + .ignoreOtherParameters(); + mock().expectOneCall("RegEdit_SetNum") + .withPointerParameter("reg", (void*) &PORTA.DIR) + .ignoreOtherParameters(); ADC_Disable(); }