summaryrefslogtreecommitdiffstats
path: root/test/ssl_test_ctx_test.c
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2016-08-09 17:03:23 +0200
committerEmilia Kasper <emilia@openssl.org>2016-08-10 14:41:21 +0200
commitd61f00780a232659161ac08847cd787af8672845 (patch)
treeac4c3feba589d309b0ad0650c21e3fb17c8749a6 /test/ssl_test_ctx_test.c
parentda085d273c6f2a82f3e13dc6482e0f00e0daab5b (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_test.c')
-rw-r--r--test/ssl_test_ctx_test.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/ssl_test_ctx_test.c b/test/ssl_test_ctx_test.c
index 479bda4d58..60bd573fbd 100644
--- a/test/ssl_test_ctx_test.c
+++ b/test/ssl_test_ctx_test.c
@@ -174,7 +174,7 @@ static SSL_TEST_CTX_TEST_FIXTURE set_up(const char *const test_case_name)
SSL_TEST_CTX_TEST_FIXTURE fixture;
fixture.test_case_name = test_case_name;
fixture.expected_ctx = SSL_TEST_CTX_new();
- OPENSSL_assert(fixture.expected_ctx != NULL);
+ TEST_check(fixture.expected_ctx != NULL);
return fixture;
}
@@ -254,7 +254,7 @@ static int test_good_configuration()
fixture.expected_ctx->extra.client.servername = SSL_TEST_SERVERNAME_SERVER2;
fixture.expected_ctx->extra.client.npn_protocols =
OPENSSL_strdup("foo,bar");
- OPENSSL_assert(fixture.expected_ctx->extra.client.npn_protocols != NULL);
+ TEST_check(fixture.expected_ctx->extra.client.npn_protocols != NULL);
fixture.expected_ctx->extra.server.servername_callback =
SSL_TEST_SERVERNAME_IGNORE_MISMATCH;
@@ -262,7 +262,7 @@ static int test_good_configuration()
fixture.expected_ctx->resume_extra.server2.alpn_protocols =
OPENSSL_strdup("baz");
- OPENSSL_assert(
+ TEST_check(
fixture.expected_ctx->resume_extra.server2.alpn_protocols != NULL);
fixture.expected_ctx->resume_extra.client.ct_validation =
@@ -302,11 +302,10 @@ int main(int argc, char **argv)
return 1;
conf = NCONF_new(NULL);
- OPENSSL_assert(conf != NULL);
+ TEST_check(conf != NULL);
/* argv[1] should point to test/ssl_test_ctx_test.conf */
- OPENSSL_assert(NCONF_load(conf, argv[1], NULL) > 0);
-
+ TEST_check(NCONF_load(conf, argv[1], NULL) > 0);
ADD_TEST(test_empty_configuration);
ADD_TEST(test_good_configuration);