From 675593221c25dbebaaf8e4ce9f4271a8fb0171d0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 21 Mar 2012 00:58:14 +1030 Subject: lib/ccan: namespacize ccan/list to avoid conflict with OpenIndiana's sys/list.h CCAN includes a little utility called "namespacize" which prepends ccan_ to all public methods of a module, and fixes up any dependencies it finds. It's a little primitive, but it works here. Signed-off-by: Rusty Russell --- lib/ccan/list/test/run-check-corrupt.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/ccan/list/test/run-check-corrupt.c') diff --git a/lib/ccan/list/test/run-check-corrupt.c b/lib/ccan/list/test/run-check-corrupt.c index 5dd9f9cc83..af44992bfe 100644 --- a/lib/ccan/list/test/run-check-corrupt.c +++ b/lib/ccan/list/test/run-check-corrupt.c @@ -28,27 +28,27 @@ static int my_fprintf(FILE *stream, const char *format, ...) int main(int argc, char *argv[]) { - struct list_head list; - struct list_node n1; + struct ccan_list_head list; + struct ccan_list_node n1; char expect[100]; plan_tests(9); /* Empty list. */ list.n.next = &list.n; list.n.prev = &list.n; - ok1(list_check(&list, NULL) == &list); + ok1(ccan_list_check(&list, NULL) == &list); /* Bad back ptr */ list.n.prev = &n1; /* Non-aborting version. */ - ok1(list_check(&list, NULL) == NULL); + ok1(ccan_list_check(&list, NULL) == NULL); /* Aborting version. */ sprintf(expect, "test message: prev corrupt in node %p (0) of %p\n", &list, &list); if (setjmp(aborted) == 0) { - list_check(&list, "test message"); - fail("list_check on empty with bad back ptr didn't fail!"); + ccan_list_check(&list, "test message"); + fail("ccan_list_check on empty with bad back ptr didn't fail!"); } else { ok1(strcmp(printf_buffer, expect) == 0); } @@ -58,20 +58,20 @@ int main(int argc, char *argv[]) list.n.prev = &n1; n1.prev = &list.n; n1.next = &list.n; - ok1(list_check(&list, NULL) == &list); - ok1(list_check_node(&n1, NULL) == &n1); + ok1(ccan_list_check(&list, NULL) == &list); + ok1(ccan_list_check_node(&n1, NULL) == &n1); /* Bad back ptr */ n1.prev = &n1; - ok1(list_check(&list, NULL) == NULL); - ok1(list_check_node(&n1, NULL) == NULL); + ok1(ccan_list_check(&list, NULL) == NULL); + ok1(ccan_list_check_node(&n1, NULL) == NULL); /* Aborting version. */ sprintf(expect, "test message: prev corrupt in node %p (1) of %p\n", &n1, &list); if (setjmp(aborted) == 0) { - list_check(&list, "test message"); - fail("list_check on n1 bad back ptr didn't fail!"); + ccan_list_check(&list, "test message"); + fail("ccan_list_check on n1 bad back ptr didn't fail!"); } else { ok1(strcmp(printf_buffer, expect) == 0); } @@ -79,8 +79,8 @@ int main(int argc, char *argv[]) sprintf(expect, "test message: prev corrupt in node %p (0) of %p\n", &n1, &n1); if (setjmp(aborted) == 0) { - list_check_node(&n1, "test message"); - fail("list_check_node on n1 bad back ptr didn't fail!"); + ccan_list_check_node(&n1, "test message"); + fail("ccan_list_check_node on n1 bad back ptr didn't fail!"); } else { ok1(strcmp(printf_buffer, expect) == 0); } -- cgit