]> git.ozlabs.org Git - ccan/blobdiff - container_of/test/run.c
New variant of container_of: container_of_var, for list.h
[ccan] / container_of / test / run.c
index ff567325fd912b743894c25199b79c59f34a1b71..d08b06a667d17dbee81725e579c238a501396956 100644 (file)
@@ -12,8 +12,10 @@ int main(int argc, char *argv[])
        int *intp = &foo.a;
        char *charp = &foo.b;
 
-       plan_tests(2);
+       plan_tests(4);
        ok1(container_of(intp, struct foo, a) == &foo);
        ok1(container_of(charp, struct foo, b) == &foo);
+       ok1(container_of_var(intp, &foo, a) == &foo);
+       ok1(container_of_var(charp, &foo, b) == &foo);
        return exit_status();
 }