diff options
author | Stef Walter <stef@thewalter.net> | 2013-07-08 16:36:50 +0200 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2013-07-08 16:43:41 +0200 |
commit | 03787ae83b1911118a7a689c4817bbce1e74dabd (patch) | |
tree | c7c83e748d6c4f935e7a4269fde0880f42c29f4d /trust/tests | |
parent | 9f7c426d5a6bfb0e60895a690ed835c47e04cb4e (diff) |
trust: Support using the parser without an asn1_cache
Diffstat (limited to 'trust/tests')
-rw-r--r-- | trust/tests/test-parser.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/trust/tests/test-parser.c b/trust/tests/test-parser.c index cc71d1d..c8cac03 100644 --- a/trust/tests/test-parser.c +++ b/trust/tests/test-parser.c @@ -414,6 +414,24 @@ test_parse_unrecognized (void) p11_message_loud (); } +static void +test_parse_no_asn1_cache (void) +{ + p11_parser *parser; + int ret; + + parser = p11_parser_new (NULL); + assert_ptr_not_null (parser); + + ret = p11_parse_file (parser, SRCDIR "/files/cacert3.der", P11_PARSE_FLAG_NONE); + assert_num_eq (P11_PARSE_SUCCESS, ret); + + /* Should have gotten certificate */ + assert_num_eq (1, p11_parser_parsed (parser)->num); + + p11_parser_free (parser); +} + int main (int argc, char *argv[]) @@ -428,5 +446,9 @@ main (int argc, p11_test (test_parse_thawte, "/parser/parse_thawte"); p11_test (test_parse_invalid_file, "/parser/parse_invalid_file"); p11_test (test_parse_unrecognized, "/parser/parse_unrecognized"); + + p11_fixture (NULL, NULL); + p11_test (test_parse_no_asn1_cache, "/parser/null-asn1-cache"); + return p11_test_run (argc, argv); } |