mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
tests: Test wl_array_release
array-test.c did not cover wl_array_release, so add one test that specifically tests this method. Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> [Pekka: do not overwrite array.data] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
parent
e8ad23266f
commit
f04f218781
1 changed files with 14 additions and 0 deletions
|
|
@ -45,6 +45,20 @@ TEST(array_init)
|
|||
}
|
||||
}
|
||||
|
||||
TEST(array_release)
|
||||
{
|
||||
struct wl_array array;
|
||||
void *ptr;
|
||||
|
||||
wl_array_init(&array);
|
||||
ptr = wl_array_add(&array, 1);
|
||||
assert(ptr != NULL);
|
||||
assert(array.data != NULL);
|
||||
|
||||
wl_array_release(&array);
|
||||
assert(array.data == WL_ARRAY_POISON_PTR);
|
||||
}
|
||||
|
||||
TEST(array_add)
|
||||
{
|
||||
struct mydata {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue