Index: lib/libbsnmp/Makefile =================================================================== --- lib/libbsnmp/Makefile +++ lib/libbsnmp/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ SUBDIR= libbsnmp +SUBDIR.${MK_TESTS}+= tests .include Index: lib/libbsnmp/tests/Makefile =================================================================== --- /dev/null +++ lib/libbsnmp/tests/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.include + +ATF_TESTS_C+= bsnmpd_test + +SRCS.bsmpd_test= bsnmpd_test.c + +LIBADD+= bsnmp + +.include Index: lib/libbsnmp/tests/bsnmpd_test.c =================================================================== --- /dev/null +++ lib/libbsnmp/tests/bsnmpd_test.c @@ -0,0 +1,25 @@ +#include + +#include + +ATF_TC_WITHOUT_HEAD(sa_19_20_bsnmp_test); +ATF_TC_BODY(sa_19_20_bsnmp_test, tc) +{ + struct asn_buf b = {}; + char test_buf[] = { 0x25, 0x7f }; + enum asn_err err; + asn_len_t len; + u_char type; + + b.asn_cptr = test_buf; + b.asn_len = sizeof(test_buf); + + err = asn_get_header(&b, &type, &len); + ATF_CHECK_EQ(ASN_ERR_EOBUF, err); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, sa_19_20_bsnmp_test); + return (atf_no_error()); +}