Commit 009f5f24 authored by Rusty Russell's avatar Rusty Russell

test: add test to ensure we can use non-const lists via check.

Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 77354575
#include <ccan/list/list.h>
#include <ccan/tap/tap.h>
#include <ccan/list/list.c>
#include "helper.h"
struct child {
const char *name;
struct list_node list;
};
int main(int argc, char *argv[])
{
struct child c1, c2;
struct list_head list = LIST_HEAD_INIT(list);
plan_tests(1);
list_add(&list, &c1.list);
list_add_tail(list_check(&list, "Bad list!"), &c2.list);
list_del_from(list_check(&list, "Bad list!"),
list_check_node(&c2.list, "Bad node!"));
list_del_from(list_check(&list, "Bad list!"),
list_check_node(&c1.list, "Bad node!"));
ok1(list_empty(list_check(&list, "Bad emptied list")));
return exit_status();
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment