start testing BIT STRING
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15756 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -391,6 +391,40 @@ test_oid (void)
|
|||||||
test_cmp_oid);
|
test_cmp_oid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
test_cmp_bit_string (void *a, void *b)
|
||||||
|
{
|
||||||
|
return heim_bit_string_cmp((heim_bit_string *)a, (heim_bit_string *)b);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
test_bit_string (void)
|
||||||
|
{
|
||||||
|
struct test_case tests[] = {
|
||||||
|
{NULL, 1, "\x00"},
|
||||||
|
};
|
||||||
|
heim_bit_string values[] = {
|
||||||
|
{ 0, "" },
|
||||||
|
};
|
||||||
|
int i;
|
||||||
|
int ntests = sizeof(tests) / sizeof(*tests);
|
||||||
|
|
||||||
|
for (i = 0; i < ntests; ++i) {
|
||||||
|
tests[i].val = &values[i];
|
||||||
|
asprintf (&tests[i].name, "bit_string %d", i);
|
||||||
|
if (tests[i].name == NULL)
|
||||||
|
errx(1, "malloc");
|
||||||
|
}
|
||||||
|
|
||||||
|
return generic_test (tests, ntests, sizeof(heim_bit_string),
|
||||||
|
(generic_encode)der_put_bit_string,
|
||||||
|
(generic_length)length_bit_string,
|
||||||
|
(generic_decode)der_get_bit_string,
|
||||||
|
(generic_free)free_bit_string,
|
||||||
|
test_cmp_bit_string);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
check_fail_unsigned(void)
|
check_fail_unsigned(void)
|
||||||
{
|
{
|
||||||
@@ -555,6 +589,7 @@ main(int argc, char **argv)
|
|||||||
ret += test_general_string ();
|
ret += test_general_string ();
|
||||||
ret += test_generalized_time ();
|
ret += test_generalized_time ();
|
||||||
ret += test_oid ();
|
ret += test_oid ();
|
||||||
|
ret += test_bit_string();
|
||||||
ret += check_fail_unsigned();
|
ret += check_fail_unsigned();
|
||||||
ret += check_fail_integer();
|
ret += check_fail_integer();
|
||||||
ret += check_fail_length();
|
ret += check_fail_length();
|
||||||
|
Reference in New Issue
Block a user