summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFabio Fiorina <fiorinaf@gnutls.org>2003-02-05 19:50:48 +0000
committerFabio Fiorina <fiorinaf@gnutls.org>2003-02-05 19:50:48 +0000
commitf9b2cd36e3eab09695cb56941372e4942fd85b85 (patch)
tree55487edac132dbfdefef8ac4d873dda1cf6eaba3 /tests
parentd5ac51e4cefcdb1062bb29451545b2f08b82a515 (diff)
downloadlibtasn1-f9b2cd36e3eab09695cb56941372e4942fd85b85.tar.gz
change asn1_create_element interface
Diffstat (limited to 'tests')
-rw-r--r--tests/Test_parser.c4
-rw-r--r--tests/Test_tree.asn7
-rw-r--r--tests/Test_tree.c14
3 files changed, 23 insertions, 2 deletions
diff --git a/tests/Test_parser.c b/tests/Test_parser.c
index 31755c6..87c1ee2 100644
--- a/tests/Test_parser.c
+++ b/tests/Test_parser.c
@@ -89,10 +89,10 @@ test_type test_array[]={
{0}
};
-char
+int
readLine(FILE *file,char *line)
{
- char c;
+ int c;
while(((c=fgetc(file))!=EOF) && (c!='\n')){
*line=c;
diff --git a/tests/Test_tree.asn b/tests/Test_tree.asn
index 657090c..4e3db3f 100644
--- a/tests/Test_tree.asn
+++ b/tests/Test_tree.asn
@@ -17,6 +17,13 @@ Sequence1 ::= SEQUENCE{
oct OCTET STRING
}
+DHParameter ::= SEQUENCE {
+ prime INTEGER,
+ base INTEGER,
+ privateValueLength INTEGER OPTIONAL
+}
+
+
id-octetTest1 OBJECT IDENTIFIER ::= {1 2 3 4}
Sequence_octetTest1 ::= SEQUENCE{
diff --git a/tests/Test_tree.c b/tests/Test_tree.c
index bfd58c8..cd01222 100644
--- a/tests/Test_tree.c
+++ b/tests/Test_tree.c
@@ -64,6 +64,20 @@ test_type test_array[]={
{ACT_DELETE,"","",0,ASN1_ELEMENT_NOT_FOUND},
/* Test: Integer */
+ {ACT_CREATE,"TEST_TREE.DHParameter",0,0,ASN1_SUCCESS},
+ {ACT_WRITE,"prime","1",0,ASN1_SUCCESS},
+ {ACT_WRITE,"base","2",0,ASN1_SUCCESS},
+ {ACT_WRITE,"privateValueLength",NULL,0,ASN1_SUCCESS},
+ {ACT_VISIT,"","",ASN1_PRINT_ALL,ASN1_SUCCESS},
+ {ACT_ENCODING,"",0,0,ASN1_SUCCESS},
+ {ACT_PRINT_DER,0,0,0,ASN1_SUCCESS},
+ {ACT_DELETE,"","",0,ASN1_SUCCESS},
+ {ACT_CREATE,"TEST_TREE.DHParameter",0,0,ASN1_SUCCESS},
+ {ACT_DECODING,0,0,0,ASN1_SUCCESS},
+ {ACT_VISIT,"","",ASN1_PRINT_ALL,ASN1_SUCCESS},
+ {ACT_DELETE,"","",0,ASN1_SUCCESS},
+
+ /* Test: Integer */
{ACT_CREATE,"TEST_TREE.AnyTest2",0,0,ASN1_SUCCESS},
{ACT_WRITE,"","int",0,ASN1_SUCCESS},
{ACT_WRITE,"int","0",0,ASN1_SUCCESS},