array-test: assert wl_array_add result is not NULL
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
This commit is contained in:
parent
f97df69ee2
commit
fcf5f06b7d
|
@ -61,6 +61,7 @@ TEST(array_add)
|
||||||
/* add some data */
|
/* add some data */
|
||||||
for (i = 0; i < iterations; i++) {
|
for (i = 0; i < iterations; i++) {
|
||||||
struct mydata* ptr = wl_array_add(&array, datasize);
|
struct mydata* ptr = wl_array_add(&array, datasize);
|
||||||
|
assert(ptr);
|
||||||
assert((i + 1) * datasize == array.size);
|
assert((i + 1) * datasize == array.size);
|
||||||
|
|
||||||
ptr->a = i * 3;
|
ptr->a = i * 3;
|
||||||
|
@ -95,6 +96,7 @@ TEST(array_copy)
|
||||||
/* add some data */
|
/* add some data */
|
||||||
for (i = 0; i < iterations; i++) {
|
for (i = 0; i < iterations; i++) {
|
||||||
int *p = wl_array_add(&source, sizeof(int));
|
int *p = wl_array_add(&source, sizeof(int));
|
||||||
|
assert(p);
|
||||||
*p = i * 2 + i;
|
*p = i * 2 + i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,6 +128,7 @@ TEST(array_for_each)
|
||||||
wl_array_init(&array);
|
wl_array_init(&array);
|
||||||
for (i = 0; i < 5; i++) {
|
for (i = 0; i < 5; i++) {
|
||||||
p = wl_array_add(&array, sizeof *p);
|
p = wl_array_add(&array, sizeof *p);
|
||||||
|
assert(p);
|
||||||
*p = elements[i];
|
*p = elements[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user