- } tls_method_sym, ssl_ctx_new_sym, ssl_ctx_free_sym, err_get_error_sym,
- openssl_version_num_sym;
- enum test_types_en test_type;
- int i;
-
- if (argc != 4) {
- printf("Unexpected number of arguments\n");
- return 1;
- }
-
- if (strcmp(argv[1], CRYPTO_FIRST_OPT) == 0) {
- test_type = CRYPTO_FIRST;
- } else if (strcmp(argv[1], SSL_FIRST_OPT) == 0) {
- test_type = SSL_FIRST;
- } else if (strcmp(argv[1], JUST_CRYPTO_OPT) == 0) {
- test_type = JUST_CRYPTO;
- } else {
- printf("Unrecognised argument\n");
- return 1;
- }
-
- for (i = 0; i < 2; i++) {
- if ((i == 0 && (test_type == CRYPTO_FIRST
- || test_type == JUST_CRYPTO))
- || (i == 1 && test_type == SSL_FIRST)) {
- if (!shlib_load(argv[2], &cryptolib)) {
- printf("Unable to load libcrypto\n");
- return 1;
- }
- }
- if ((i == 0 && test_type == SSL_FIRST)
- || (i == 1 && test_type == CRYPTO_FIRST)) {
- if (!shlib_load(argv[3], &ssllib)) {
- printf("Unable to load libssl\n");
- return 1;
- }
- }
+ } symbols[3];
+ TLS_method_t myTLS_method;
+ SSL_CTX_new_t mySSL_CTX_new;
+ SSL_CTX_free_t mySSL_CTX_free;
+ ERR_get_error_t myERR_get_error;
+ OpenSSL_version_num_t myOpenSSL_version_num;
+ int result = 0;
+
+ switch (test_type) {
+ case JUST_CRYPTO:
+ if (!TEST_true(shlib_load(path_crypto, &cryptolib)))
+ goto end;
+ break;
+ case CRYPTO_FIRST:
+ if (!TEST_true(shlib_load(path_crypto, &cryptolib))
+ || !TEST_true(shlib_load(path_ssl, &ssllib)))
+ goto end;
+ case SSL_FIRST:
+ if (!TEST_true(shlib_load(path_ssl, &ssllib))
+ || !TEST_true(shlib_load(path_crypto, &cryptolib)))
+ goto end;
+ break;