From: Mike Bland Date: Thu, 17 Jul 2014 23:08:04 +0000 (-0400) Subject: Check the test registry size during add_test() X-Git-Tag: master-post-reformat~570 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b2e50bcd0e07af1afa31caff049ae636f45be69b;p=oweals%2Fopenssl.git Check the test registry size during add_test() Reviewed-by: Tim Hudson --- diff --git a/test/testutil.c b/test/testutil.c index 792d38228d..89e814193c 100644 --- a/test/testutil.c +++ b/test/testutil.c @@ -58,6 +58,7 @@ #include "testutil.h" +#include #include #include @@ -74,6 +75,7 @@ static int num_tests = 0; void add_test(const char* test_case_name, int (*test_fn)()) { + assert(num_tests != (sizeof(all_tests) / sizeof(all_tests)[0])); all_tests[num_tests].test_case_name = test_case_name; all_tests[num_tests].test_fn = test_fn; ++num_tests;