From e4478fb4a0186f9d59969bf93ed8fa6074729b43 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 14 Sep 2015 15:35:13 +0200 Subject: tests: added check for EXPLICIT encoding of tagged values This catches the regression introduced by multi-byte tags fix. --- tests/Test_encoding.asn | 1 + tests/Test_encoding.c | 8 ++++++++ 2 files changed, 9 insertions(+) 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); -- cgit v1.2.1