summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorU. Artie Eoff <ullysses.a.eoff@intel.com>2014-01-10 20:17:24 (GMT)
committerKristian Høgsberg <krh@bitplanet.net>2014-01-15 18:46:08 (GMT)
commitfcf5f06b7d335d9811dddab6572ba495f74c5838 (patch)
treeb865a0bbfa8c23b14a671bbd099a3a2dc2ee6b67
parentf97df69ee2b8981533358b6f62fadb8c0e18a278 (diff)
downloadwayland-fcf5f06b7d335d9811dddab6572ba495f74c5838.tar.gz
wayland-fcf5f06b7d335d9811dddab6572ba495f74c5838.tar.xz
array-test: assert wl_array_add result is not NULL
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
-rw-r--r--tests/array-test.c3
1 files changed, 3 insertions, 0 deletions
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];
}