git.droids-corp.org
/
protos
/
libecoli.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
api documentation for ec_parse
[protos/libecoli.git]
/
src
/
ecoli_test.c
diff --git
a/src/ecoli_test.c
b/src/ecoli_test.c
index
b090bd3
..
541ae01
100644
(file)
--- a/
src/ecoli_test.c
+++ b/
src/ecoli_test.c
@@
-46,7
+46,7
@@
int ec_test_register(struct ec_test *test)
int ec_test_check_parse(struct ec_node *tk, int expected, ...)
{
int ec_test_check_parse(struct ec_node *tk, int expected, ...)
{
- struct ec_p
ars
e *p;
+ struct ec_p
nod
e *p;
struct ec_strvec *vec = NULL;
const char *s;
int ret = -1, match;
struct ec_strvec *vec = NULL;
const char *s;
int ret = -1, match;
@@
-60,7
+60,7
@@
int ec_test_check_parse(struct ec_node *tk, int expected, ...)
goto out;
for (s = va_arg(ap, const char *);
goto out;
for (s = va_arg(ap, const char *);
- s != EC_
NODE_ENDLIST
;
+ s != EC_
VA_END
;
s = va_arg(ap, const char *)) {
if (s == NULL)
goto out;
s = va_arg(ap, const char *)) {
if (s == NULL)
goto out;
@@
-69,12
+69,12
@@
int ec_test_check_parse(struct ec_node *tk, int expected, ...)
goto out;
}
goto out;
}
- p = ec_
node_
parse_strvec(tk, vec);
+ p = ec_parse_strvec(tk, vec);
if (p == NULL) {
EC_LOG(EC_LOG_ERR, "parse is NULL\n");
}
if (p == NULL) {
EC_LOG(EC_LOG_ERR, "parse is NULL\n");
}
- if (ec_p
ars
e_matches(p))
- match = ec_p
ars
e_len(p);
+ if (ec_p
nod
e_matches(p))
+ match = ec_p
nod
e_len(p);
else
match = -1;
if (expected == match) {
else
match = -1;
if (expected == match) {
@@
-85,7
+85,7
@@
int ec_test_check_parse(struct ec_node *tk, int expected, ...)
match, expected);
}
match, expected);
}
- ec_p
ars
e_free(p);
+ ec_p
nod
e_free(p);
out:
ec_strvec_free(vec);
out:
ec_strvec_free(vec);
@@
-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;
struct ec_strvec *vec = NULL;
const char *s;
int ret = 0;
-
unsigned in
t count = 0;
+
size_
t count = 0;
va_list ap;
va_start(ap, type);
va_list ap;
va_start(ap, type);
@@
-110,7
+110,7
@@
int ec_test_check_complete(struct ec_node *tk, enum ec_comp_type type, ...)
goto out;
for (s = va_arg(ap, const char *);
goto out;
for (s = va_arg(ap, const char *);
- s != EC_
NODE_ENDLIST
;
+ s != EC_
VA_END
;
s = va_arg(ap, const char *)) {
if (s == NULL)
goto out;
s = va_arg(ap, const char *)) {
if (s == NULL)
goto out;
@@
-119,7
+119,7
@@
int ec_test_check_complete(struct ec_node *tk, enum ec_comp_type type, ...)
goto out;
}
goto out;
}
- c = ec_
node_
complete_strvec(tk, vec);
+ c = ec_complete_strvec(tk, vec);
if (c == NULL) {
ret = -1;
goto out;
if (c == NULL) {
ret = -1;
goto out;
@@
-127,10
+127,9
@@
int ec_test_check_complete(struct ec_node *tk, enum ec_comp_type type, ...)
/* for each expected completion, check it is there */
for (s = va_arg(ap, const char *);
/* for each expected completion, check it is there */
for (s = va_arg(ap, const char *);
- s != EC_
NODE_ENDLIST
;
+ s != EC_
VA_END
;
s = va_arg(ap, const char *)) {
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;
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 */
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;
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;
}
"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,
}
/* 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;
count, ec_comp_count(c, type));
ec_comp_dump(stdout, c);
ret = -1;