diff options
| author | Kristian Høgsberg <krh@bitplanet.net> | 2012-06-15 16:09:39 -0400 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-06-15 16:09:39 -0400 |
| commit | b576443a0eb848085d0fcdf2b2d2987bcfb58a7f (patch) | |
| tree | 0ea185b592c90fa32f123da16e08bb455ce3318d /tests/os-wrappers-test.c | |
| parent | TODO: Remove cursor-as-regular-surface item (diff) | |
| download | wayland-b576443a0eb848085d0fcdf2b2d2987bcfb58a7f.tar wayland-b576443a0eb848085d0fcdf2b2d2987bcfb58a7f.tar.gz wayland-b576443a0eb848085d0fcdf2b2d2987bcfb58a7f.tar.bz2 wayland-b576443a0eb848085d0fcdf2b2d2987bcfb58a7f.tar.lz wayland-b576443a0eb848085d0fcdf2b2d2987bcfb58a7f.tar.xz wayland-b576443a0eb848085d0fcdf2b2d2987bcfb58a7f.tar.zst wayland-b576443a0eb848085d0fcdf2b2d2987bcfb58a7f.zip | |
tests: Update test cases to new closure allocate convention
Diffstat (limited to 'tests/os-wrappers-test.c')
| -rw-r--r-- | tests/os-wrappers-test.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/os-wrappers-test.c b/tests/os-wrappers-test.c index 9c4e7b2..0b38a35 100644 --- a/tests/os-wrappers-test.c +++ b/tests/os-wrappers-test.c @@ -244,7 +244,7 @@ static void marshal_demarshal(struct marshal_data *data, void (*func)(void), int size, const char *format, ...) { - struct wl_closure closure; + struct wl_closure *closure; static const int opcode = 4444; static struct wl_object sender = { NULL, NULL, 1234 }; struct wl_message message = { "test", format, NULL }; @@ -252,15 +252,14 @@ marshal_demarshal(struct marshal_data *data, struct wl_object object; va_list ap; uint32_t msg[1] = { 1234 }; - int ret; va_start(ap, format); - ret = wl_closure_vmarshal(&closure, &sender, opcode, ap, &message); + closure = wl_closure_vmarshal(&sender, opcode, ap, &message); va_end(ap); - assert(ret == 0); - assert(wl_closure_send(&closure, data->write_connection) == 0); - wl_closure_destroy(&closure); + assert(closure); + assert(wl_closure_send(closure, data->write_connection) == 0); + wl_closure_destroy(closure); assert(data->write_mask == (WL_CONNECTION_WRITABLE | WL_CONNECTION_READABLE)); assert(wl_connection_data(data->write_connection, @@ -272,10 +271,10 @@ marshal_demarshal(struct marshal_data *data, wl_map_init(&objects); object.id = msg[0]; - ret = wl_connection_demarshal(data->read_connection, - &closure, size, &objects, &message); - wl_closure_invoke(&closure, &object, func, data); - wl_closure_destroy(&closure); + closure = wl_connection_demarshal(data->read_connection, + size, &objects, &message); + wl_closure_invoke(closure, &object, func, data); + wl_closure_destroy(closure); } static void |
