]> git.ozlabs.org Git - ccan/blobdiff - ccan/alloc/test/run.c
Import f5c992bdaeb73ef726ff4728a9922721474cd6f5 from ctdb:
[ccan] / ccan / alloc / test / run.c
index bf8ab479e6b74cb90286fc0a7f4ec5fc3a8907df..801db5762443da6840f733928ba3a82dbb75e65c 100644 (file)
@@ -1,7 +1,8 @@
-#include "alloc/alloc.h"
-#include "tap/tap.h"
-#include "alloc/alloc.c"
+#include <ccan/alloc/alloc.h>
+#include <ccan/tap/tap.h>
+#include <ccan/alloc/alloc.c>
 #include <stdlib.h>
+#include <err.h>
 
 #define POOL_ORD 16
 #define POOL_SIZE (1 << POOL_ORD)
@@ -52,7 +53,8 @@ int main(int argc, char *argv[])
        plan_tests(178);
 
        /* FIXME: Needs to be page aligned for now. */
-       posix_memalign(&mem, 1 << POOL_ORD, POOL_SIZE);
+       if (posix_memalign(&mem, 1 << POOL_ORD, POOL_SIZE) != 0)
+               errx(1, "Failed allocating aligned memory"); 
 
        /* Small pool, all allocs fail, even 0-length. */
        alloc_init(mem, 0);