diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-09-14 15:35:13 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-09-14 15:36:05 +0200 |
commit | e4478fb4a0186f9d59969bf93ed8fa6074729b43 (patch) | |
tree | f190d1b7a8ad5ed640f0cb654df888e195cf0f58 | |
parent | a6a05643f0a1a9a5ea431bab65998a7c68b25c03 (diff) | |
download | libtasn1-e4478fb4a0186f9d59969bf93ed8fa6074729b43.tar.gz |
tests: added check for EXPLICIT encoding of tagged values
This catches the regression introduced by multi-byte tags fix.
-rw-r--r-- | tests/Test_encoding.asn | 1 | ||||
-rw-r--r-- | tests/Test_encoding.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/Test_encoding.asn b/tests/Test_encoding.asn index de7b93f..040c88f 100644 --- a/tests/Test_encoding.asn +++ b/tests/Test_encoding.asn @@ -14,6 +14,7 @@ Koko ::= SEQUENCE { a [1] OCTET STRING, b [10] OCTET STRING, c [100] OCTET STRING, + exp [3] EXPLICIT OCTET STRING OPTIONAL, str OCTET STRING } diff --git a/tests/Test_encoding.c b/tests/Test_encoding.c index e693ed7..8e8c702 100644 --- a/tests/Test_encoding.c +++ b/tests/Test_encoding.c @@ -133,6 +133,14 @@ main (int argc, char *argv[]) exit (1); } + result = asn1_write_value (asn1_element, "exp", "string4", 7); + if (result != ASN1_SUCCESS) + { + fprintf (stderr, "asn1_write_value(): str "); + asn1_perror (result); + exit (1); + } + /* Clear the definition structures */ asn1_delete_structure (&definitions); |