summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2015-09-14 15:35:13 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-09-14 15:36:05 +0200
commite4478fb4a0186f9d59969bf93ed8fa6074729b43 (patch)
treef190d1b7a8ad5ed640f0cb654df888e195cf0f58
parenta6a05643f0a1a9a5ea431bab65998a7c68b25c03 (diff)
downloadlibtasn1-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.asn1
-rw-r--r--tests/Test_encoding.c8
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);