From 23dbf4876cf25b383eac78bddbc44e1d0b1069d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20P=C3=ADsa=C5=99?= Date: Mon, 28 Dec 2015 14:59:50 +0100 Subject: [PATCH] test: Move global variables into test.c This allows to include test.h multiple times in the expense of linking test units to test.o. --- test/test.c | 3 +++ test/test.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test.c b/test/test.c index 3b71a6f..00e2ddb 100644 --- a/test/test.c +++ b/test/test.c @@ -16,6 +16,9 @@ #include #include +/* Global variables for each test unit */ +char *reason = NULL; +void (*test_destructor_function)(void *) = NULL; /* Print formated string into automtically reallocated @uffer. * @buffer automatically reallocated buffer. Must be &NULL or preallocated diff --git a/test/test.h b/test/test.h index e04ce4b..f526986 100644 --- a/test/test.h +++ b/test/test.h @@ -14,9 +14,9 @@ #include "test-tools.h" -char *unit_name, *reason = NULL; +char *unit_name, *reason; unsigned int passed, failed; -void (*test_destructor_function)(void *) = NULL; +void (*test_destructor_function)(void *); void *test_destructor_argument; #define INIT_TEST(name) { \ -- 2.11.4.GIT