candelbrot/test/registry.c

20 lines
404 B
C
Raw Normal View History

2024-10-04 16:24:47 +00:00
#include "unity/unity_internals.h"
#include "registry.h"
#define TESTS_MAX 128
static Test tests[TESTS_MAX];
static int test_count = 0;
void register_test(Test t) {
if (test_count < TESTS_MAX) {
tests[test_count] = t;
test_count++;
} else
printf("Maximum number of tests (%d) exceeded.\n", TESTS_MAX);
}
void run_all_tests() {
for (int i = 0; i < test_count; i++) tests[i]();
}