2 * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
11 #include <openssl/x509.h>
12 #include <openssl/x509v3.h>
13 #include <openssl/pem.h>
14 #include <openssl/err.h>
18 static const char *infile;
20 static int test_pathlen(void)
27 if (!TEST_ptr(b = BIO_new_file(infile, "r"))
28 || !TEST_ptr(x = PEM_read_bio_X509(b, NULL, NULL, NULL))
29 || !TEST_int_eq(pathlen = X509_get_pathlen(x), 6))
40 OPT_TEST_DECLARE_USAGE("cert.pem\n")
44 if (!TEST_ptr(infile = test_get_argument(0)))
47 ADD_TEST(test_pathlen);