Fix unit tests when no-bf configured
authorTodd Short <tshort@akamai.com>
Wed, 12 Apr 2017 20:32:38 +0000 (16:32 -0400)
committerRich Salz <rsalz@openssl.org>
Fri, 14 Apr 2017 11:33:45 +0000 (07:33 -0400)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3206)

test/bftest.c

index 978fd582b1ac0654bd3c25b98eec6052752fb18f..eea9fcb7b9409d0681c14e3be9bf72457a724b75 100644 (file)
 
 #include "../e_os.h"
 
-#ifdef OPENSSL_NO_BF
-int main(int argc, char *argv[])
-{
-    printf("No BF support\n");
-    return (0);
-}
-#else
+#ifndef OPENSSL_NO_BF
 # include <openssl/blowfish.h>
 
 # ifdef CHARSET_EBCDIC
@@ -440,10 +434,11 @@ static int test_bf_ofb64(void)
 
     return ret;
 }
+#endif
 
 int test_main(int argc, char *argv[])
 {
-    int ret;
+#ifndef OPENSSL_NO_BF
 # ifdef CHARSET_EBCDIC
     int n;
 
@@ -461,10 +456,7 @@ int test_main(int argc, char *argv[])
     ADD_TEST(test_bf_ofb64);
 
     if (argc > 1)
-        ret = print_test_data();
-    else
-        ret = run_tests(argv[0]);
-
-    return ret;
-}
+        return print_test_data();
 #endif
+    return run_tests(argv[0]);
+}