70
70
camel_test_init (argc, argv);
72
camel_test_start("Param list decoding");
72
camel_test_start ("Param list decoding");
74
74
for (i = 0; i < G_N_ELEMENTS (test1); i++) {
75
75
struct _camel_header_param *head, *node;
77
camel_test_push("param decoding[%d] '%s'", i, test1[i].list);
77
camel_test_push ("param decoding[%d] '%s'", i, test1[i].list);
78
78
head = camel_header_param_list_decode (test1[i].list);
79
79
check (head != NULL);
81
81
for (j = 0; j < test1[i].count; j++) {
82
check_msg(node != NULL, "didn't find all params");
82
check_msg (node != NULL, "didn't find all params");
83
83
check (strcmp (node->name, test1[i].params[j * 2]) == 0);
84
84
check (strcmp (node->value, test1[i].params[j * 2 + 1]) == 0);
87
check_msg(node == NULL, "found more params than should have");
87
check_msg (node == NULL, "found more params than should have");
88
88
camel_header_param_list_free (head);
89
89
camel_test_pull ();
94
camel_test_start("Param list encoding");
94
camel_test_start ("Param list encoding");
96
96
for (i = 0; i < G_N_ELEMENTS (test2); i++) {
97
97
struct _camel_header_param *head = NULL, *scan;
100
camel_test_push("param encoding[%d]", i);
100
camel_test_push ("param encoding[%d]", i);
102
102
for (j = 0; j < test2[i].count; j++)
103
103
camel_header_set_param (&head, test2[i].params[j * 2], test2[i].params[j * 2 + 1]);