X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Flist%2Ftest%2Frun.c;h=13a1da4198134d88cbeb56020c1ee9acd7cce24a;hp=7c71e396ca36e8823435bf8b81d5e96d4e9b91dc;hb=dc0aafc9d58e231f5d6d70c9838b151a162428b1;hpb=a04a5f7472bd8146936864702084e533d474eea4 diff --git a/ccan/list/test/run.c b/ccan/list/test/run.c index 7c71e396..13a1da41 100644 --- a/ccan/list/test/run.c +++ b/ccan/list/test/run.c @@ -101,21 +101,23 @@ int main(int argc, char *argv[]) } ok1(i == 3); - /* Test list_for_each_safe and list_del. */ + /* Test list_for_each_safe, list_del and list_del_from. */ i = 0; list_for_each_safe(&parent.children, c, n, list) { switch (i++) { case 0: - ok1(c == &c1); + ok1(c == &c1); + list_del(&c->list); break; case 1: ok1(c == &c2); + list_del_from(&parent.children, &c->list); break; case 2: ok1(c == &c3); + list_del_from(&parent.children, &c->list); break; } - list_del(&c->list); ok1(list_check(&parent.children, NULL)); if (i > 2) break;