summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/kit_test/test.c5
-rw-r--r--source/kit_test/test.h7
2 files changed, 4 insertions, 8 deletions
diff --git a/source/kit_test/test.c b/source/kit_test/test.c
index db3c68c..07c8871 100644
--- a/source/kit_test/test.c
+++ b/source/kit_test/test.c
@@ -1,6 +1,7 @@
#include "test.h"
#include <stdio.h>
+#include <string.h>
#include <time.h>
kit_tests_list_t kit_tests_list = { 0 };
@@ -42,8 +43,8 @@ static void color_code(int term_color, int c) {
void kit_test_register(char const *name, kit_test_run_fn fn) {
int n = kit_tests_list.size++;
if (n < KIT_TESTS_SIZE_LIMIT) {
- kit_tests_list.tests[n].test_fn = fn;
- strcpy(kit_tests_list.tests[n].test_name, name);
+ kit_tests_list.tests[n].test_fn = fn;
+ kit_tests_list.tests[n].test_name = name;
kit_tests_list.tests[n].assertions = 0;
}
}
diff --git a/source/kit_test/test.h b/source/kit_test/test.h
index 9c2fea9..f8e79dc 100644
--- a/source/kit_test/test.h
+++ b/source/kit_test/test.h
@@ -6,7 +6,6 @@ extern "C" {
#endif
#include <stddef.h>
-#include <string.h>
#ifndef KIT_TEST_FILE
# define KIT_TEST_FILE kit_test
@@ -20,17 +19,13 @@ extern "C" {
# define KIT_TEST_ASSERTIONS_LIMIT 0x50
#endif
-#ifndef KIT_TEST_STRING_SIZE
-# define KIT_TEST_STRING_SIZE 0x100
-#endif
-
typedef void (*kit_test_report_fn)(int test_index, char const *file,
int line, int ok);
typedef void (*kit_test_run_fn)(
int kit_test_index_, kit_test_report_fn kit_test_report_fn_);
typedef struct {
- char test_name[KIT_TEST_STRING_SIZE];
+ char const *test_name;
kit_test_run_fn test_fn;
int assertions;
char const *file[KIT_TEST_ASSERTIONS_LIMIT];