summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2006-06-26 14:24:34 +0000
committerSimon Josefsson <simon@josefsson.org>2006-06-26 14:24:34 +0000
commit410374d66dcec3efd3df1d51947dc4dc77c27e87 (patch)
tree590ef28bc86540f0210f8880b7455f29f74080be /tests
parenta92ff1b0e39f8eee991428093137b339555aec6f (diff)
downloadlibtasn1-410374d66dcec3efd3df1d51947dc4dc77c27e87.tar.gz
libtasn1-410374d66dcec3efd3df1d51947dc4dc77c27e87.tar.bz2
libtasn1-410374d66dcec3efd3df1d51947dc4dc77c27e87.zip
Trigger a bug that made Shishi self tests fail on 64-bit platforms.
Diffstat (limited to 'tests')
-rw-r--r--tests/Test_tree.asn35
-rw-r--r--tests/Test_tree.c17
2 files changed, 19 insertions, 33 deletions
diff --git a/tests/Test_tree.asn b/tests/Test_tree.asn
index a294ebf..2cac58c 100644
--- a/tests/Test_tree.asn
+++ b/tests/Test_tree.asn
@@ -13,6 +13,9 @@ KrbError ::= [APPLICATION 30] SEQUENCE {
pvno[0] INTEGER
}
+Checksum ::= SEQUENCE {
+ checksum [1] OCTET STRING
+}
CertTemplate ::= SEQUENCE {
version [0] INTEGER OPTIONAL,
@@ -154,36 +157,4 @@ X520LocalityName ::= CHOICE {
id-Test OBJECT IDENTIFIER ::= {1 2 29 2}
-
END
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/Test_tree.c b/tests/Test_tree.c
index 4df628d..bd748f0 100644
--- a/tests/Test_tree.c
+++ b/tests/Test_tree.c
@@ -392,8 +392,23 @@ test_type test_array[]={
{ACT_READ_LENGTH,"b",NULL,5,ASN1_MEM_ERROR},
{ACT_VISIT,"","",ASN1_PRINT_ALL,ASN1_SUCCESS},
{ACT_DELETE,"","",0,ASN1_SUCCESS},
-
+ /* Bug regression test: Empty write on 64-bit platforms */
+ {ACT_CREATE,"TEST_TREE.Checksum",0,0,ASN1_SUCCESS},
+ {ACT_WRITE,"checksum","foo",0,ASN1_SUCCESS},
+ {ACT_WRITE,"checksum","",0,ASN1_SUCCESS},
+ {ACT_ENCODING_LENGTH,"",0,4,ASN1_MEM_ERROR},
+ {ACT_ENCODING,"",0,3,ASN1_MEM_ERROR},
+ {ACT_ENCODING,"",0,4,ASN1_SUCCESS},
+ {ACT_PRINT_DER,0,0,0,ASN1_SUCCESS},
+ {ACT_DELETE,"","",0,ASN1_SUCCESS},
+ {ACT_CREATE,"TEST_TREE.Checksum",0,0,ASN1_SUCCESS},
+ {ACT_DECODING,0,0,0,ASN1_SUCCESS},
+ {ACT_DECODING_ELEMENT,"checksum",0,0,ASN1_SUCCESS},
+ {ACT_READ,"checksum","",0,ASN1_SUCCESS},
+ {ACT_READ_LENGTH,"checksum",NULL,0,ASN1_SUCCESS}, /* MEM_FAILURE? */
+ {ACT_VISIT,"","",ASN1_PRINT_ALL,ASN1_SUCCESS},
+ {ACT_DELETE,"","",0,ASN1_SUCCESS},
/* end */
{ACT_NULL}