4 static int test_string2hashalgorithm(const xmlChar
*name
, const isds_error error
,
5 const isds_hash_algorithm type
) {
7 isds_hash_algorithm new_type
;
9 err
= string2isds_hash_algorithm(name
, &new_type
);
11 FAIL_TEST("string2isds_hash_algorithm() returned unexpected code");
17 FAIL_TEST("conversion returned wrong algorithm");
22 int main(int argc
, char **argv
) {
23 INIT_TEST("isds_hash_algorithm conversion");
32 isds_hash_algorithm algos
[] = {
35 HASH_ALGORITHM_SHA_256
,
36 HASH_ALGORITHM_SHA_512
,
39 for (int i
= 0; i
< sizeof(algos
)/sizeof(algos
[0]); i
++)
40 TEST(names
[i
], test_string2hashalgorithm
, names
[i
], IE_SUCCESS
,
43 TEST("X-Invalid_Type", test_string2hashalgorithm
, BAD_CAST
"X-Invalid_Type",