diff options
author | Emilia Kasper <emilia@openssl.org> | 2016-08-09 17:03:23 +0200 |
---|---|---|
committer | Emilia Kasper <emilia@openssl.org> | 2016-08-10 14:41:21 +0200 |
commit | d61f00780a232659161ac08847cd787af8672845 (patch) | |
tree | ac4c3feba589d309b0ad0650c21e3fb17c8749a6 /test/ssl_test_ctx.c | |
parent | da085d273c6f2a82f3e13dc6482e0f00e0daab5b (diff) |
Add TEST_check
Like OPENSSL_assert, but also prints the error stack before exiting.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/ssl_test_ctx.c')
-rw-r--r-- | test/ssl_test_ctx.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test/ssl_test_ctx.c b/test/ssl_test_ctx.c index e95c1f2f66..3913e9f923 100644 --- a/test/ssl_test_ctx.c +++ b/test/ssl_test_ctx.c @@ -14,6 +14,7 @@ #include "e_os.h" #include "ssl_test_ctx.h" +#include "testutil.h" /* True enums and other test configuration values that map to an int. */ typedef struct { @@ -286,7 +287,7 @@ const char *ssl_test_method_name(ssl_test_method_t method) { \ OPENSSL_free(ctx->field); \ ctx->field = OPENSSL_strdup(value); \ - OPENSSL_assert(ctx->field != NULL); \ + TEST_check(ctx->field != NULL); \ return 1; \ } @@ -430,14 +431,14 @@ static const ssl_test_server_option ssl_test_server_options[] = { }; /* - * Since these methods are used to create tests, we use OPENSSL_assert liberally + * Since these methods are used to create tests, we use TEST_check liberally * for malloc failures and other internal errors. */ SSL_TEST_CTX *SSL_TEST_CTX_new() { SSL_TEST_CTX *ret; ret = OPENSSL_zalloc(sizeof(*ret)); - OPENSSL_assert(ret != NULL); + TEST_check(ret != NULL); return ret; } @@ -473,7 +474,7 @@ static int parse_client_options(SSL_TEST_CLIENT_CONF *client, const CONF *conf, size_t j; sk_conf = NCONF_get_section(conf, client_section); - OPENSSL_assert(sk_conf != NULL); + TEST_check(sk_conf != NULL); for (i = 0; i < sk_CONF_VALUE_num(sk_conf); i++) { int found = 0; @@ -506,7 +507,7 @@ static int parse_server_options(SSL_TEST_SERVER_CONF *server, const CONF *conf, size_t j; sk_conf = NCONF_get_section(conf, server_section); - OPENSSL_assert(sk_conf != NULL); + TEST_check(sk_conf != NULL); for (i = 0; i < sk_CONF_VALUE_num(sk_conf); i++) { int found = 0; @@ -539,10 +540,10 @@ SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section) size_t j; sk_conf = NCONF_get_section(conf, test_section); - OPENSSL_assert(sk_conf != NULL); + TEST_check(sk_conf != NULL); ctx = SSL_TEST_CTX_new(); - OPENSSL_assert(ctx != NULL); + TEST_check(ctx != NULL); for (i = 0; i < sk_CONF_VALUE_num(sk_conf); i++) { int found = 0; |