summaryrefslogtreecommitdiff
path: root/trust/tests
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-07-23 14:53:53 +0200
committerStef Walter <stef@thewalter.net>2013-07-23 23:06:27 +0200
commitb7cc29a78c3c705374ff25223fe14749ddb076b9 (patch)
tree4d9ec4586d19ed2230f4bdbb2a2e1887f7b254a4 /trust/tests
parent4d04cfdf2ac078cc4a95ff9a145f0045e074470b (diff)
Use simple serial automake test harness
* Add a testing sanity check to see if we're catching errors * Fix a few other testing issues
Diffstat (limited to 'trust/tests')
-rw-r--r--trust/tests/test-builder.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/trust/tests/test-builder.c b/trust/tests/test-builder.c
index 6f9fdcc..1d37924 100644
--- a/trust/tests/test-builder.c
+++ b/trust/tests/test-builder.c
@@ -760,7 +760,9 @@ test_valid_dates (void)
{ CKA_INVALID },
};
- memcpy (&date, "20001010", sizeof (date));
+ memcpy (date.year, "2000", sizeof (date.year));
+ memcpy (date.month, "10", sizeof (date.month));
+ memcpy (date.day, "10", sizeof (date.day));
rv = p11_builder_build (test.builder, test.index, attrs, input, &extra);
assert_num_eq (CKR_OK, rv);
@@ -791,11 +793,15 @@ test_invalid_dates (void)
p11_message_quiet ();
- memcpy (&date, "AAAABBCC", sizeof (date));
+ memcpy (date.year, "AAAA", sizeof (date.year));
+ memcpy (date.month, "BB", sizeof (date.month));
+ memcpy (date.day, "CC", sizeof (date.day));
rv = p11_builder_build (test.builder, test.index, attrs, input, &extra);
assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv);
- memcpy (&date, "20001580", sizeof (date));
+ memcpy (date.year, "2000", sizeof (date.year));
+ memcpy (date.month, "15", sizeof (date.month));
+ memcpy (date.day, "80", sizeof (date.day));
rv = p11_builder_build (test.builder, test.index, attrs, input, &extra);
assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv);