1*b2e98945SBryan Drewery /*-
2*b2e98945SBryan Drewery * Copyright (c) 2020 Dell EMC
3*b2e98945SBryan Drewery * All rights reserved.
4*b2e98945SBryan Drewery *
5*b2e98945SBryan Drewery * Redistribution and use in source and binary forms, with or without
6*b2e98945SBryan Drewery * modification, are permitted provided that the following conditions
7*b2e98945SBryan Drewery * are met:
8*b2e98945SBryan Drewery * 1. Redistributions of source code must retain the above copyright
9*b2e98945SBryan Drewery * notice, this list of conditions and the following disclaimer.
10*b2e98945SBryan Drewery * 2. Redistributions in binary form must reproduce the above copyright
11*b2e98945SBryan Drewery * notice, this list of conditions and the following disclaimer in the
12*b2e98945SBryan Drewery * documentation and/or other materials provided with the distribution.
13*b2e98945SBryan Drewery *
14*b2e98945SBryan Drewery * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*b2e98945SBryan Drewery * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*b2e98945SBryan Drewery * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*b2e98945SBryan Drewery * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*b2e98945SBryan Drewery * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*b2e98945SBryan Drewery * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*b2e98945SBryan Drewery * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*b2e98945SBryan Drewery * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*b2e98945SBryan Drewery * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*b2e98945SBryan Drewery * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*b2e98945SBryan Drewery * SUCH DAMAGE.
25*b2e98945SBryan Drewery */
26*b2e98945SBryan Drewery
27*b2e98945SBryan Drewery #include <bsnmp/asn1.h>
28*b2e98945SBryan Drewery
29*b2e98945SBryan Drewery #include <atf-c.h>
30*b2e98945SBryan Drewery
31*b2e98945SBryan Drewery ATF_TC_WITHOUT_HEAD(sa_19_20_bsnmp_test);
ATF_TC_BODY(sa_19_20_bsnmp_test,tc)32*b2e98945SBryan Drewery ATF_TC_BODY(sa_19_20_bsnmp_test, tc)
33*b2e98945SBryan Drewery {
34*b2e98945SBryan Drewery struct asn_buf b = {};
35*b2e98945SBryan Drewery char test_buf[] = { 0x25, 0x7f };
36*b2e98945SBryan Drewery enum asn_err err;
37*b2e98945SBryan Drewery asn_len_t len;
38*b2e98945SBryan Drewery u_char type;
39*b2e98945SBryan Drewery
40*b2e98945SBryan Drewery b.asn_cptr = test_buf;
41*b2e98945SBryan Drewery b.asn_len = sizeof(test_buf);
42*b2e98945SBryan Drewery
43*b2e98945SBryan Drewery err = asn_get_header(&b, &type, &len);
44*b2e98945SBryan Drewery ATF_CHECK_EQ(ASN_ERR_EOBUF, err);
45*b2e98945SBryan Drewery }
46*b2e98945SBryan Drewery
ATF_TP_ADD_TCS(tp)47*b2e98945SBryan Drewery ATF_TP_ADD_TCS(tp)
48*b2e98945SBryan Drewery {
49*b2e98945SBryan Drewery ATF_TP_ADD_TC(tp, sa_19_20_bsnmp_test);
50*b2e98945SBryan Drewery return (atf_no_error());
51*b2e98945SBryan Drewery }
52