Fix dsaparam -genkey with DER outform
[openssl.git] / test / mdc2_internal_test.c
index 9acea21c8446f8d0f53e2a3451d0d995e08abe0b..64aa2dc1685204528818938c3be5018f938a1286 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the OpenSSL license (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,8 +14,7 @@
 
 #include <openssl/mdc2.h>
 #include "testutil.h"
-#include "test_main.h"
-#include "e_os.h"
+#include "internal/nelem.h"
 
 typedef struct {
     const char *input;
@@ -56,15 +55,17 @@ static int test_mdc2(int idx)
                 strlen(testdata.input));
     MDC2_Final(&(md[0]), &c);
 
-    if (memcmp(testdata.expected, md, MDC2_DIGEST_LENGTH)) {
-        fprintf(stderr, "mdc2 test %d: unexpected output\n", idx);
+    if (!TEST_mem_eq(testdata.expected, MDC2_DIGEST_LENGTH,
+                     md, MDC2_DIGEST_LENGTH)) {
+        TEST_info("mdc2 test %d: unexpected output", idx);
         return 0;
     }
 
     return 1;
 }
 
-void register_tests()
+int setup_tests()
 {
     ADD_ALL_TESTS(test_mdc2, OSSL_NELEM(tests));
+    return 1;
 }