X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=test%2Fd2i_test.c;h=3ce38485bd22137231c89ac57ee0eed2def5cdf6;hp=255982e2af84575fbb7988c38293cab2a550f360;hb=23ccf13dd68e75ba6cabbcaaeaff21d22aacb7d0;hpb=176db6dc51ec0a972bfa8836cfdab8f6767c978a diff --git a/test/d2i_test.c b/test/d2i_test.c index 255982e2af..3ce38485bd 100644 --- a/test/d2i_test.c +++ b/test/d2i_test.c @@ -1,7 +1,7 @@ /* * Copyright 2016-2017 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 @@ -67,7 +67,7 @@ static int test_bad_asn1(void) * performs sanity checks on the input and can reject it before the * decoder is called. */ - len = BIO_read(bio, buf, sizeof buf); + len = BIO_read(bio, buf, sizeof(buf)); if (!TEST_int_ge(len, 0)) goto err; @@ -106,6 +106,8 @@ static int test_bad_asn1(void) return ret; } +OPT_TEST_DECLARE_USAGE("item_name expected_error test_file.der\n") + /* * Usage: d2i_test , e.g. * d2i_test generalname bad_generalname.der @@ -127,10 +129,8 @@ int setup_tests(void) if (!TEST_ptr(test_type_name = test_get_argument(0)) || !TEST_ptr(expected_error_string = test_get_argument(1)) - || !TEST_ptr(test_file = test_get_argument(2))) { - TEST_note("Usage: d2i_test item_name expected_error file.der"); + || !TEST_ptr(test_file = test_get_argument(2))) return 0; - } item_type = ASN1_ITEM_lookup(test_type_name);