From bd50eca8deade9b3bd94189b7f6429d2f1bdf5b1 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 8 Jun 2015 14:27:55 +0200 Subject: tests: added encoding and decoding check with multi-byte tags --- tests/Test_encoding.asn | 3 +++ tests/Test_encoding.c | 24 ++++++++++++++++++++++++ tests/Test_tree.asn | 1 - 3 files changed, 27 insertions(+), 1 deletion(-) 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 { -- cgit v1.2.1