/*
* 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
#include <openssl/err.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
-#include "e_os.h"
+#include "internal/nelem.h"
static const ASN1_ITEM *item_type;
static const char *test_file;
static expected_error_t expected_error = ASN1_UNKNOWN;
-static int test_bad_asn1()
+static int test_bad_asn1(void)
{
BIO *bio = NULL;
ASN1_VALUE *value = NULL;
* 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;
return ret;
}
+OPT_TEST_DECLARE_USAGE("item_name expected_error test_file.der\n")
+
/*
* Usage: d2i_test <name> <type> <file>, e.g.
* d2i_test generalname bad_generalname.der
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);