From fcf5f06b7d335d9811dddab6572ba495f74c5838 Mon Sep 17 00:00:00 2001 From: "U. Artie Eoff" Date: Fri, 10 Jan 2014 12:17:24 -0800 Subject: [PATCH] array-test: assert wl_array_add result is not NULL Signed-off-by: U. Artie Eoff --- tests/array-test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/array-test.c b/tests/array-test.c index 7639878..c457e42 100644 --- a/tests/array-test.c +++ b/tests/array-test.c @@ -61,6 +61,7 @@ TEST(array_add) /* add some data */ for (i = 0; i < iterations; i++) { struct mydata* ptr = wl_array_add(&array, datasize); + assert(ptr); assert((i + 1) * datasize == array.size); ptr->a = i * 3; @@ -95,6 +96,7 @@ TEST(array_copy) /* add some data */ for (i = 0; i < iterations; i++) { int *p = wl_array_add(&source, sizeof(int)); + assert(p); *p = i * 2 + i; } @@ -126,6 +128,7 @@ TEST(array_for_each) wl_array_init(&array); for (i = 0; i < 5; i++) { p = wl_array_add(&array, sizeof *p); + assert(p); *p = elements[i]; }