From 39ce0af7fba3368da730ae719a29230f8573b06d Mon Sep 17 00:00:00 2001 From: jake Date: Sun, 16 Feb 2025 10:30:39 -0800 Subject: [PATCH] Added the missing test dir for SuperLoop --- tests/SuperLoop/CMakeLists.txt | 10 +++++++++ tests/SuperLoop/test_SuperLoop.cpp | 36 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 tests/SuperLoop/CMakeLists.txt create mode 100644 tests/SuperLoop/test_SuperLoop.cpp diff --git a/tests/SuperLoop/CMakeLists.txt b/tests/SuperLoop/CMakeLists.txt new file mode 100644 index 0000000..30a7c5e --- /dev/null +++ b/tests/SuperLoop/CMakeLists.txt @@ -0,0 +1,10 @@ +# TEST_RUNNER +add_library(test_SuperLoop + test_SuperLoop.cpp +) + +target_link_libraries(test_SuperLoop + ${CPPUTEST_LIBRARIES}/libCppUTest.a + ${CPPUTEST_LIBRARIES}/libCppUTestExt.a + SuperLoop +) diff --git a/tests/SuperLoop/test_SuperLoop.cpp b/tests/SuperLoop/test_SuperLoop.cpp new file mode 100644 index 0000000..6955c0f --- /dev/null +++ b/tests/SuperLoop/test_SuperLoop.cpp @@ -0,0 +1,36 @@ +/* + * Author: Jake G + * Date: 2024-09-01 + * filename: test_SuperLoop.c + * description: module_purpose + */ + +#include "CppUTest/CommandLineTestRunner.h" + +extern "C" +{ +#include "SuperLoop.h" +} + +TEST_GROUP(test_SuperLoop) +{ + void setup() + { + + } + void teardown() + { + + } +}; + + +TEST(test_SuperLoop, LoopIterationsFiniteWork){ + for(uint8_t i = 1; i < 255; i++){ + SuperLoop_SetIterations(i); + uint8_t num_iterations = SuperLoop_Run(); + CHECK_EQUAL(i, num_iterations); + } +} + +