summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2015-06-08 14:27:55 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-06-08 14:27:55 +0200
commitbd50eca8deade9b3bd94189b7f6429d2f1bdf5b1 (patch)
tree14464d41c276952f10c1f346138b0a9def4f3cf3 /tests
parent9cb29a180ad5fc0d2d728d162062327b6418ddd5 (diff)
downloadlibtasn1-bd50eca8deade9b3bd94189b7f6429d2f1bdf5b1.tar.gz
tests: added encoding and decoding check with multi-byte tags
Diffstat (limited to 'tests')
-rw-r--r--tests/Test_encoding.asn3
-rw-r--r--tests/Test_encoding.c24
-rw-r--r--tests/Test_tree.asn1
3 files changed, 27 insertions, 1 deletions
diff --git a/tests/Test_encoding.asn b/tests/Test_encoding.asn
index 99b4b40..de7b93f 100644
--- a/tests/Test_encoding.asn
+++ b/tests/Test_encoding.asn
@@ -11,6 +11,9 @@ BEGIN
Koko ::= SEQUENCE {
seqint SEQUENCE OF INTEGER,
int INTEGER,
+ a [1] OCTET STRING,
+ b [10] OCTET STRING,
+ c [100] OCTET STRING,
str OCTET STRING
}
diff --git a/tests/Test_encoding.c b/tests/Test_encoding.c
index 7d3266c..e693ed7 100644
--- a/tests/Test_encoding.c
+++ b/tests/Test_encoding.c
@@ -109,6 +109,30 @@ main (int argc, char *argv[])
exit (1);
}
+ result = asn1_write_value (asn1_element, "a", "string1", 7);
+ if (result != ASN1_SUCCESS)
+ {
+ fprintf (stderr, "asn1_write_value(): str ");
+ asn1_perror (result);
+ exit (1);
+ }
+
+ result = asn1_write_value (asn1_element, "b", "string2", 7);
+ if (result != ASN1_SUCCESS)
+ {
+ fprintf (stderr, "asn1_write_value(): str ");
+ asn1_perror (result);
+ exit (1);
+ }
+
+ result = asn1_write_value (asn1_element, "c", "string3", 7);
+ if (result != ASN1_SUCCESS)
+ {
+ fprintf (stderr, "asn1_write_value(): str ");
+ asn1_perror (result);
+ exit (1);
+ }
+
/* Clear the definition structures */
asn1_delete_structure (&definitions);
diff --git a/tests/Test_tree.asn b/tests/Test_tree.asn
index da60870..0ad0dc5 100644
--- a/tests/Test_tree.asn
+++ b/tests/Test_tree.asn
@@ -144,7 +144,6 @@ Test3 ::= SEQUENCE{
b [1] EXPLICIT GeneralString2
}
-
GeneralString2 ::= [2] EXPLICIT GeneralString
X520LocalityName ::= CHOICE {