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); + } +} + +