test_begin("rfc822 parse content param");
rfc822_parser_init(&parser, (const void *)input, strlen(input), NULL);
- while ((ret = rfc822_parse_content_param(&parser, &key, &value)) > 0) {
+ while ((ret = rfc822_parse_content_param(&parser, &key, &value)) > 0 &&
+ i < N_ELEMENTS(output)) {
test_assert_idx(strcmp(output[i].key, key) == 0, i);
test_assert_idx(strcmp(output[i].value, value) == 0, i);
i++;
}
test_assert(ret == 0);
+ test_assert(i == N_ELEMENTS(output));
test_end();
}