From b884517586da23c4d0951cbbc8ac1edf049ca287 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Fri, 20 Sep 2024 18:42:35 -0700 Subject: [PATCH] Added tests for the `valid_load` function --- tests/load/test_load.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/load/test_load.cpp b/tests/load/test_load.cpp index 72fd3a9..9e7ef7b 100644 --- a/tests/load/test_load.cpp +++ b/tests/load/test_load.cpp @@ -54,3 +54,23 @@ TEST(test_load, PortAHandlerSuccess) Load_HandleLoadPortA(4, 7); } + +TEST(test_load, HighThreshValid) +{ + bool result = valid_load(HIGHTHRESH); + CHECK_TRUE(!result); + + result = valid_load(HIGHTHRESH - 1); + CHECK_TRUE(result); +} + + +TEST(test_load, LowThreshValid) +{ + bool result = valid_load(LOWTHRESH); + CHECK_TRUE(!result); + + result = valid_load(LOWTHRESH + 1); + CHECK_TRUE(result); +} +