Check the test registry size during add_test()
Reviewed-by: Tim Hudson <tjh@openssl.org>
This commit is contained in:
parent
50bba6852d
commit
b2e50bcd0e
@ -58,6 +58,7 @@
|
|||||||
|
|
||||||
#include "testutil.h"
|
#include "testutil.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@ -74,6 +75,7 @@ static int num_tests = 0;
|
|||||||
|
|
||||||
void add_test(const char* test_case_name, int (*test_fn)())
|
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_case_name = test_case_name;
|
||||||
all_tests[num_tests].test_fn = test_fn;
|
all_tests[num_tests].test_fn = test_fn;
|
||||||
++num_tests;
|
++num_tests;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user