X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=test%2Fmdc2_internal_test.c;h=64aa2dc1685204528818938c3be5018f938a1286;hp=3353507c63196b88f5851274648bdb0b515a18cf;hb=fce1b86f61e183d3b73a51d2077ec2719291b756;hpb=d836d71b2da026b4ed9a2233657b2289ab8e4be0 diff --git a/test/mdc2_internal_test.c b/test/mdc2_internal_test.c index 3353507c63..64aa2dc168 100644 --- a/test/mdc2_internal_test.c +++ b/test/mdc2_internal_test.c @@ -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,7 +14,7 @@ #include #include "testutil.h" -#include "e_os.h" +#include "internal/nelem.h" typedef struct { const char *input; @@ -55,17 +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; } -int main(int argc, char **argv) +int setup_tests() { ADD_ALL_TESTS(test_mdc2, OSSL_NELEM(tests)); - - return run_tests(argv[0]); + return 1; }