diff options
Diffstat (limited to 'test/test_guard.cc')
-rw-r--r-- | test/test_guard.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/test_guard.cc b/test/test_guard.cc index 5f8521d..1ad5a2f 100644 --- a/test/test_guard.cc +++ b/test/test_guard.cc @@ -1,4 +1,5 @@ #include <stdio.h> +#include "test.h" static int static_count; struct static_struct @@ -6,7 +7,6 @@ struct static_struct int i; static_struct() { - fprintf(stderr, "Initialized static\n"); static_count++; i = 12; }; @@ -23,4 +23,7 @@ int init_static(void) void test_guards(void) { init_static(); + int i = init_static(); + TEST(i == 12, "Static initialized"); + TEST(static_count == 2, "Each static only initialized once"); } |