diff options
-rw-r--r-- | tests/Makefile.am | 6 | ||||
-rw-r--r-- | tests/Test_errors.c | 40 |
2 files changed, 44 insertions, 2 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 2abc669..9dc2d14 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -31,9 +31,11 @@ dist_check_SCRIPTS = crlf MOSTLYCLEANFILES = Test_parser_ERROR.asn -check_PROGRAMS = Test_parser Test_tree Test_encoding Test_indefinite +check_PROGRAMS = Test_parser Test_tree Test_encoding Test_indefinite \ + Test_errors -TESTS = Test_parser Test_tree Test_encoding Test_indefinite crlf +TESTS = Test_parser Test_tree Test_encoding Test_indefinite \ + Test_errors crlf TESTS_ENVIRONMENT = \ ASN1PARSER=$(srcdir)/Test_parser.asn \ diff --git a/tests/Test_errors.c b/tests/Test_errors.c new file mode 100644 index 0000000..6ddcf33 --- /dev/null +++ b/tests/Test_errors.c @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2010 Free Software Foundation, Inc. + * + * This file is part of LIBTASN1. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include "libtasn1.h" + +int +main (int argc, char *argv[]) +{ + asn1_retCode ec = 0; + const char *errstr; + + do { + errstr = asn1_strerror (ec); + asn1_perror (ec); +#ifndef ASN1_DISABLE_DEPRECATED + errstr = libtasn1_strerror (ec); + libtasn1_perror (ec); +#endif + ec++; + } while (errstr); + + return 0; +} |