]> git.ozlabs.org Git - ccan/blobdiff - ccan/alloc/test/run.c
Remove compile warnings of tests under Ubuntu (return value ignored)
[ccan] / ccan / alloc / test / run.c
index bf8ab479e6b74cb90286fc0a7f4ec5fc3a8907df..8247122eaa4041b8ebf643d2e5077605019f64ce 100644 (file)
@@ -2,6 +2,7 @@
 #include "tap/tap.h"
 #include "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);