summaryrefslogtreecommitdiff
path: root/source/kit_test
diff options
context:
space:
mode:
Diffstat (limited to 'source/kit_test')
-rw-r--r--source/kit_test/run_tests.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/kit_test/run_tests.c b/source/kit_test/run_tests.c
index a4ebd12..c08f946 100644
--- a/source/kit_test/run_tests.c
+++ b/source/kit_test/run_tests.c
@@ -6,8 +6,20 @@
struct kit_tests_list kit_tests_list = { 0 };
static void report(int i, char const *file, int line, int ok) {
+ if (i >= KIT_TESTS_SIZE_LIMIT) {
+ printf("Kit Test error: Too many tests!");
+ return;
+ }
+
int const n = kit_tests_list.tests[i].assertions++;
+ if (n >= KIT_TEST_ASSERTIONS_LIMIT) {
+ printf(
+ "Kit Test error: Too many test assertions for test \"%s\"!",
+ kit_tests_list.tests[i].test_name);
+ return;
+ }
+
kit_tests_list.tests[i].file[n] = file;
kit_tests_list.tests[i].line[n] = line;
kit_tests_list.tests[i].status[n] = ok;