Added the missing test dir for SuperLoop

This commit is contained in:
Jake Goodwin 2025-02-16 10:30:39 -08:00
parent 3f2eb09427
commit 39ce0af7fb
2 changed files with 46 additions and 0 deletions

View File

@ -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
)

View File

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