X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=test%2Fmdc2_internal_test.c;h=0e32331f24703d6e031db6e88e83f4ab9491d196;hp=3353507c63196b88f5851274648bdb0b515a18cf;hb=0e43960e88128bb86031a45c0fe9ca3e3a310c3b;hpb=d836d71b2da026b4ed9a2233657b2289ab8e4be0 diff --git a/test/mdc2_internal_test.c b/test/mdc2_internal_test.c index 3353507c63..0e32331f24 100644 --- a/test/mdc2_internal_test.c +++ b/test/mdc2_internal_test.c @@ -1,7 +1,7 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * - * Licensed under the OpenSSL license (the "License"). You may not use + * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html @@ -9,12 +9,18 @@ /* Internal tests for the mdc2 module */ +/* + * MDC2 low level APIs are deprecated for public use, but still ok for + * internal use. + */ +#include "internal/deprecated.h" + #include #include #include #include "testutil.h" -#include "e_os.h" +#include "internal/nelem.h" typedef struct { const char *input; @@ -55,17 +61,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(void) { ADD_ALL_TESTS(test_mdc2, OSSL_NELEM(tests)); - - return run_tests(argv[0]); + return 1; }