X-Git-Url: http://git.droids-corp.org/?p=protos%2Flibecoli.git;a=blobdiff_plain;f=src%2Fecoli_test.c;h=541ae01a2632a96a965bdc2c04d3011cdca2a6d8;hp=4429e679941bc8b34cb10893b821c25574358dc3;hb=HEAD;hpb=984760622f2c8472fd2667e24bcceb543bdb1aff diff --git a/src/ecoli_test.c b/src/ecoli_test.c index 4429e67..541ae01 100644 --- a/src/ecoli_test.c +++ b/src/ecoli_test.c @@ -99,7 +99,7 @@ int ec_test_check_complete(struct ec_node *tk, enum ec_comp_type type, ...) struct ec_strvec *vec = NULL; const char *s; int ret = 0; - unsigned int count = 0; + size_t count = 0; va_list ap; va_start(ap, type); @@ -129,8 +129,7 @@ int ec_test_check_complete(struct ec_node *tk, enum ec_comp_type type, ...) for (s = va_arg(ap, const char *); s != EC_VA_END; s = va_arg(ap, const char *)) { - struct ec_comp_iter *iter; - const struct ec_comp_item *item; + struct ec_comp_item *item; if (s == NULL) { ret = -1; @@ -140,8 +139,7 @@ int ec_test_check_complete(struct ec_node *tk, enum ec_comp_type type, ...) count++; /* only check matching completions */ - iter = ec_comp_iter(c, type); - while ((item = ec_comp_iter_next(iter)) != NULL) { + EC_COMP_FOREACH(item, c, type) { const char *str = ec_comp_item_get_str(item); if (str != NULL && strcmp(str, s) == 0) break; @@ -152,13 +150,12 @@ int ec_test_check_complete(struct ec_node *tk, enum ec_comp_type type, ...) "completion <%s> not in list\n", s); ret = -1; } - ec_comp_iter_free(iter); } /* check if we have more completions (or less) than expected */ if (count != ec_comp_count(c, type)) { EC_LOG(EC_LOG_ERR, - "nb_completion (%d) does not match (%d)\n", + "nb_completion (%zu) does not match (%zu)\n", count, ec_comp_count(c, type)); ec_comp_dump(stdout, c); ret = -1;