diff options
author | Pauli <paul.dale@oracle.com> | 2017-07-18 11:48:27 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2017-07-27 07:53:08 +1000 |
commit | ad887416f1e59c3294a7d8f83a0ca77120523b4a (patch) | |
tree | 99971c4acaaa7a43efa38a0d52e230c0e68a1c6c /test/crltest.c | |
parent | d445302418b41b76c15e103954b1311d98077480 (diff) |
Update the test framework so that the need for test_main is removed. Everything
that needed test_main now works using the same infrastructure as tests that used
register_tests.
This meant:
* renaming register_tests to setup_tests and giving it a success/failure return.
* renaming the init_test function to setup_test_framework.
* renaming the finish_test function to pulldown_test_framework.
* adding a user provided global_init function that runs before the test frame
work is initialised. It returns a failure indication that stops the stest.
* adding helper functions that permit tests to access their command line args.
* spliting the BIO initialisation and finalisation out from the test setup and
teardown.
* hiding some of the now test internal functions.
* fix the comments in testutil.h
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3953)
Diffstat (limited to 'test/crltest.c')
-rw-r--r-- | test/crltest.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/test/crltest.c b/test/crltest.c index 048f67fec5..720c13b3a2 100644 --- a/test/crltest.c +++ b/test/crltest.c @@ -364,23 +364,22 @@ static int test_unknown_critical_crl(int n) return r; } -int test_main(int argc, char *argv[]) +int setup_tests(void) { - int status = EXIT_FAILURE; - if (!TEST_ptr(test_root = X509_from_strings(kCRLTestRoot)) || !TEST_ptr(test_leaf = X509_from_strings(kCRLTestLeaf))) - goto err; + return 0; ADD_TEST(test_no_crl); ADD_TEST(test_basic_crl); ADD_TEST(test_bad_issuer_crl); ADD_TEST(test_known_critical_crl); ADD_ALL_TESTS(test_unknown_critical_crl, OSSL_NELEM(unknown_critical_crls)); + return 1; +} - status = run_tests(argv[0]); -err: +void cleanup_tests(void) +{ X509_free(test_root); X509_free(test_leaf); - return status; } |