Fix potential null problem.
[openssl.git] / test / enginetest.c
index d50e41818dc2ed5db7636e6edc62294c5765e80e..4e782778598f57cdcdbe63eec74fce155fbf0106 100644 (file)
@@ -9,20 +9,16 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 #include <openssl/e_os2.h>
 
-#ifdef OPENSSL_NO_ENGINE
-int main(int argc, char *argv[])
-{
-    printf("No ENGINE support\n");
-    return (0);
-}
-#else
+# include "testutil.h"
+
+#ifndef OPENSSL_NO_ENGINE
 # include <openssl/buffer.h>
 # include <openssl/crypto.h>
 # include <openssl/engine.h>
 # include <openssl/err.h>
-# include "testutil.h"
 
 static void display_engine_list(void)
 {
@@ -179,9 +175,14 @@ static int test_engines(void)
         ENGINE_free(block[loop]);
     return to_return;
 }
+#endif
 
-void register_tests(void)
+int setup_tests(void)
 {
+#ifdef OPENSSL_NO_ENGINE
+    TEST_note("No ENGINE support");
+#else
     ADD_TEST(test_engines);
-}
 #endif
+    return 1;
+}