summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2010-03-16 11:03:26 +0100
committerSimon Josefsson <simon@josefsson.org>2010-03-16 11:03:26 +0100
commita9cd295645d66cf19cd7b0a8ff82a15dcf141770 (patch)
tree0557aa44d0f48b5414e7a59f95c4270964ddbbb7 /tests
parentabdaaa7bc126f742b026c1ef6e3d0f63fec8a4b4 (diff)
downloadlibtasn1-a9cd295645d66cf19cd7b0a8ff82a15dcf141770.tar.gz
libtasn1-a9cd295645d66cf19cd7b0a8ff82a15dcf141770.tar.bz2
libtasn1-a9cd295645d66cf19cd7b0a8ff82a15dcf141770.zip
tests/Test_errors: Add, for more error checking.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am6
-rw-r--r--tests/Test_errors.c40
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;
+}