From 4ab57eb9482ea2d95e62a9f4b592a4b836cf7337 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Sat, 27 Jul 2024 09:23:36 -0700 Subject: [PATCH] Created a helper function for the ADC storage testing --- tests/ADC/test_ADC.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/ADC/test_ADC.cpp b/tests/ADC/test_ADC.cpp index 06fd84c..cee3d26 100644 --- a/tests/ADC/test_ADC.cpp +++ b/tests/ADC/test_ADC.cpp @@ -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)