| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846 |
- /*
- * Copyright © 2012 Jonas Ådahl
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
- #include <stdlib.h>
- #include <stdint.h>
- #include <stdio.h>
- #include <stdbool.h>
- #include <string.h>
- #include <unistd.h>
- #include <sys/mman.h>
- #include <sys/types.h>
- #include <sys/wait.h>
- #include <assert.h>
- #include <signal.h>
- #include "wayland-client.h"
- #include "wayland-server.h"
- #include "test-runner.h"
- #include "test-compositor.h"
- #include "../src/timespec-util.h"
- #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
- static void
- registry_handle_global(void *data, struct wl_registry *registry,
- uint32_t id, const char *interface, uint32_t version)
- {
- int *pcounter = data;
- (*pcounter)++;
- assert(*pcounter == 1);
- wl_registry_destroy(registry);
- }
- static const struct wl_registry_listener registry_listener = {
- registry_handle_global,
- NULL
- };
- /* Test that destroying a proxy object doesn't result in any more
- * callback being invoked, even though were many queued. */
- static void
- client_test_proxy_destroy(void)
- {
- struct wl_display *display;
- struct wl_registry *registry;
- int counter = 0;
- display = wl_display_connect(NULL);
- assert(display);
- registry = wl_display_get_registry(display);
- assert(registry != NULL);
- wl_registry_add_listener(registry, ®istry_listener,
- &counter);
- assert(wl_display_roundtrip(display) != -1);
- assert(counter == 1);
- /* don't destroy the registry, we have already destroyed them
- * in the global handler */
- wl_display_disconnect(display);
- }
- struct multiple_queues_state {
- struct wl_display *display;
- struct wl_callback* callback2;
- bool done;
- };
- static void
- sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
- {
- struct multiple_queues_state *state = data;
- state->done = true;
- wl_callback_destroy(callback);
- wl_display_dispatch_pending(state->display);
- wl_callback_destroy(state->callback2);
- }
- static const struct wl_callback_listener sync_listener = {
- sync_callback
- };
- /* Test that when receiving the first of two synchronization
- * callback events, destroying the second one doesn't cause any
- * errors even if the delete_id event is handled out of order. */
- static void
- client_test_multiple_queues(void)
- {
- struct wl_event_queue *queue;
- struct wl_callback *callback1;
- struct multiple_queues_state state;
- int ret = 0;
- state.display = wl_display_connect(NULL);
- assert(state.display);
- queue = wl_display_create_queue(state.display);
- assert(queue);
- state.done = false;
- callback1 = wl_display_sync(state.display);
- assert(callback1 != NULL);
- wl_callback_add_listener(callback1, &sync_listener, &state);
- wl_proxy_set_queue((struct wl_proxy *) callback1, queue);
- state.callback2 = wl_display_sync(state.display);
- assert(state.callback2 != NULL);
- wl_callback_add_listener(state.callback2, &sync_listener, NULL);
- wl_proxy_set_queue((struct wl_proxy *) state.callback2, queue);
- wl_display_flush(state.display);
- while (!state.done && !ret)
- ret = wl_display_dispatch_queue(state.display, queue);
- wl_event_queue_destroy(queue);
- wl_display_disconnect(state.display);
- exit(ret == -1 ? -1 : 0);
- }
- static void
- sync_callback_roundtrip(void *data, struct wl_callback *callback, uint32_t serial)
- {
- bool *done = data;
- *done = true;
- }
- static const struct wl_callback_listener sync_listener_roundtrip = {
- sync_callback_roundtrip
- };
- /* Test that doing a roundtrip on a queue only the events on that
- * queue get dispatched. */
- static void
- client_test_queue_roundtrip(void)
- {
- struct wl_event_queue *queue;
- struct wl_callback *callback1;
- struct wl_callback *callback2;
- struct wl_display *display;
- bool done1 = false;
- bool done2 = false;
- display = wl_display_connect(NULL);
- assert(display);
- queue = wl_display_create_queue(display);
- assert(queue);
- /* arm a callback on the default queue */
- callback1 = wl_display_sync(display);
- assert(callback1 != NULL);
- wl_callback_add_listener(callback1, &sync_listener_roundtrip, &done1);
- /* arm a callback on the other queue */
- callback2 = wl_display_sync(display);
- assert(callback2 != NULL);
- wl_callback_add_listener(callback2, &sync_listener_roundtrip, &done2);
- wl_proxy_set_queue((struct wl_proxy *) callback2, queue);
- /* roundtrip on default queue must not dispatch the other queue. */
- wl_display_roundtrip(display);
- assert(done1 == true);
- assert(done2 == false);
- /* re-arm the sync callback on the default queue, so we see that
- * wl_display_roundtrip_queue() does not dispatch the default queue. */
- wl_callback_destroy(callback1);
- done1 = false;
- callback1 = wl_display_sync(display);
- assert(callback1 != NULL);
- wl_callback_add_listener(callback1, &sync_listener_roundtrip, &done1);
- wl_display_roundtrip_queue(display, queue);
- assert(done1 == false);
- assert(done2 == true);
- wl_callback_destroy(callback1);
- wl_callback_destroy(callback2);
- wl_event_queue_destroy(queue);
- wl_display_disconnect(display);
- }
- static void
- client_test_queue_proxy_wrapper(void)
- {
- struct wl_event_queue *queue;
- struct wl_display *display;
- struct wl_display *display_wrapper;
- struct wl_callback *callback;
- bool done = false;
- /*
- * For an illustration of what usage would normally fail without using
- * proxy wrappers, see the `client_test_queue_set_queue_race' test case.
- */
- display = wl_display_connect(NULL);
- assert(display);
- /* Pretend we are in a separate thread where a thread-local queue is
- * used. */
- queue = wl_display_create_queue(display);
- assert(queue);
- display_wrapper = wl_proxy_create_wrapper(display);
- assert(display_wrapper);
- wl_proxy_set_queue((struct wl_proxy *) display_wrapper, queue);
- callback = wl_display_sync(display_wrapper);
- wl_proxy_wrapper_destroy(display_wrapper);
- assert(callback != NULL);
- /* Pretend we are now another thread and dispatch the dispatch the main
- * queue while also knowing our callback is read and queued. */
- wl_display_roundtrip(display);
- /* Make sure that the pretend-to-be main thread didn't dispatch our
- * callback, behind our back. */
- wl_callback_add_listener(callback, &sync_listener_roundtrip, &done);
- wl_display_flush(display);
- assert(!done);
- /* Make sure that we eventually end up dispatching our callback. */
- while (!done)
- assert(wl_display_dispatch_queue(display, queue) != -1);
- wl_callback_destroy(callback);
- wl_event_queue_destroy(queue);
- wl_display_disconnect(display);
- }
- static void
- client_test_queue_set_queue_race(void)
- {
- struct wl_event_queue *queue;
- struct wl_display *display;
- struct wl_callback *callback;
- bool done = false;
- /*
- * This test illustrates the multi threading scenario which would fail
- * without doing what is done in the `client_test_queue_proxy_wrapper'
- * test.
- */
- display = wl_display_connect(NULL);
- assert(display);
- /* Pretend we are in a separate thread where a thread-local queue is
- * used. */
- queue = wl_display_create_queue(display);
- assert(queue);
- callback = wl_display_sync(display);
- assert(callback != NULL);
- /* Pretend we are now another thread and dispatch the dispatch the main
- * queue while also knowing our callback is read, queued on the wrong
- * queue, and dispatched. */
- wl_display_roundtrip(display);
- /* Pretend we are back in the separate thread, and continue with setting
- * up our callback. */
- wl_callback_add_listener(callback, &sync_listener_roundtrip, &done);
- wl_proxy_set_queue((struct wl_proxy *) callback, queue);
- /* Roundtrip our separate thread queue to make sure any events are
- * dispatched. */
- wl_display_roundtrip_queue(display, queue);
- /* Verify that the callback has indeed been dropped. */
- assert(!done);
- wl_callback_destroy(callback);
- wl_event_queue_destroy(queue);
- wl_display_disconnect(display);
- }
- static char *
- maybe_map_file(int fd, size_t *len)
- {
- char *data;
- *len = lseek(fd, 0, SEEK_END);
- data = mmap(0, *len, PROT_READ, MAP_PRIVATE, fd, 0);
- return data;
- }
- static char *
- map_file(int fd, size_t *len)
- {
- char *data;
- data = maybe_map_file(fd, len);
- assert(data != MAP_FAILED && "Failed to mmap file");
- return data;
- }
- static char *
- last_line_of(char *s)
- {
- char *last = s;
- char *nl;
- /* Walk forward over the newlines, remembering the start of each line
- * that has content, so that a trailing newline is ignored. */
- while ((nl = strchr(last, '\n')) != NULL && nl[1] != '\0')
- last = nl + 1;
- return last;
- }
- static void
- client_test_queue_destroy_with_attached_proxies(void)
- {
- struct wl_event_queue *queue;
- struct wl_display *display;
- struct wl_display *display_wrapper;
- struct wl_callback *callback;
- char *log;
- size_t log_len;
- char callback_name[24];
- int ret;
- display = wl_display_connect(NULL);
- assert(display);
- /* Pretend we are in a separate thread where a thread-local queue is
- * used. */
- queue = wl_display_create_queue(display);
- assert(queue);
- /* Create a sync dispatching events on the thread-local queue. */
- display_wrapper = wl_proxy_create_wrapper(display);
- assert(display_wrapper);
- wl_proxy_set_queue((struct wl_proxy *) display_wrapper, queue);
- callback = wl_display_sync(display_wrapper);
- wl_proxy_wrapper_destroy(display_wrapper);
- assert(callback != NULL);
- /* Destroy the queue before the attached object. */
- wl_event_queue_destroy(queue);
- /* Check that the log contains some information about the attached
- * wl_callback proxy. */
- log = map_file(client_log_fd, &log_len);
- ret = snprintf(callback_name, sizeof(callback_name), "wl_callback#%u",
- wl_proxy_get_id((struct wl_proxy *) callback));
- assert(ret > 0 && ret < (int)sizeof(callback_name) &&
- "callback name creation failed (possibly truncated)");
- assert(strstr(last_line_of(log), callback_name));
- munmap(log, log_len);
- wl_callback_destroy(callback);
- wl_display_disconnect(display);
- }
- static void
- client_test_queue_proxy_event_to_destroyed_queue(void)
- {
- struct wl_event_queue *queue;
- struct wl_display *display;
- struct wl_display *display_wrapper;
- struct wl_callback *callback;
- display = wl_display_connect(NULL);
- assert(display);
- /* Pretend we are in a separate thread where a thread-local queue is
- * used. */
- queue = wl_display_create_queue(display);
- assert(queue);
- /* Create a sync dispatching events on the thread-local queue. */
- display_wrapper = wl_proxy_create_wrapper(display);
- assert(display_wrapper);
- wl_proxy_set_queue((struct wl_proxy *) display_wrapper, queue);
- callback = wl_display_sync(display_wrapper);
- wl_proxy_wrapper_destroy(display_wrapper);
- assert(callback != NULL);
- wl_display_flush(display);
- /* Destroy the queue before the attached object. */
- wl_event_queue_destroy(queue);
- /* During this roundtrip we should receive the done event on 'callback',
- * try to queue it to the destroyed queue, and abort. */
- wl_display_roundtrip(display);
- wl_callback_destroy(callback);
- wl_display_disconnect(display);
- }
- static void
- client_test_queue_destroy_default_with_attached_proxies(void)
- {
- struct wl_display *display;
- struct wl_callback *callback;
- char *log;
- size_t log_len;
- char callback_name[24];
- int ret;
- display = wl_display_connect(NULL);
- assert(display);
- /* Create a sync dispatching events on the default queue. */
- callback = wl_display_sync(display);
- assert(callback != NULL);
- /* Destroy the default queue (by disconnecting) before the attached
- * object. */
- wl_display_disconnect(display);
- /* Check that the log does not contain any warning about the attached
- * wl_callback proxy. */
- log = maybe_map_file(client_log_fd, &log_len);
- ret = snprintf(callback_name, sizeof(callback_name), "wl_callback#%u",
- wl_proxy_get_id((struct wl_proxy *) callback));
- assert(ret > 0 && ret < (int)sizeof(callback_name) &&
- "callback name creation failed (possibly truncated)");
- assert(log == MAP_FAILED || strstr(log, callback_name) == NULL);
- if (log != MAP_FAILED)
- munmap(log, log_len);
- /* HACK: Directly free the memory of the wl_callback proxy to appease
- * ASan. We would normally use wl_callback_destroy(), but since we have
- * destroyed the associated wl_display, using this function would lead
- * to memory errors. */
- free(callback);
- }
- static void
- check_queue_name(struct wl_proxy *proxy, const char *name)
- {
- struct wl_event_queue *queue;
- const char *queue_name;
- queue = wl_proxy_get_queue(proxy);
- queue_name = wl_event_queue_get_name(queue);
- if (!name)
- assert(!queue_name);
- else
- assert(strcmp(queue_name, name) == 0);
- }
- static struct wl_callback *
- roundtrip_named_queue_nonblock(struct wl_display *display,
- struct wl_event_queue *queue,
- const char *name)
- {
- struct wl_callback *callback;
- struct wl_display *wrapped_display = NULL;
- if (queue) {
- wrapped_display = wl_proxy_create_wrapper(display);
- assert(wrapped_display);
- wl_proxy_set_queue((struct wl_proxy *) wrapped_display, queue);
- check_queue_name((struct wl_proxy *) wrapped_display, name);
- callback = wl_display_sync(wrapped_display);
- } else
- callback = wl_display_sync(display);
- check_queue_name((struct wl_proxy *) callback, name);
- if (wrapped_display)
- wl_proxy_wrapper_destroy(wrapped_display);
- assert(callback != NULL);
- return callback;
- }
- static void
- client_test_queue_names(void)
- {
- struct wl_event_queue *queue1, *queue2, *queue3;
- struct wl_display *display;
- struct wl_callback *callback1, *callback2, *callback3, *callback4;
- struct wl_event_queue *default_queue;
- char *log;
- size_t log_len;
- const char *default_queue_name;
- display = wl_display_connect(NULL);
- assert(display);
- default_queue = wl_proxy_get_queue((struct wl_proxy *) display);
- default_queue_name = wl_event_queue_get_name(default_queue);
- assert(strcmp(default_queue_name, "Default Queue") == 0);
- /* Create some event queues both with and without names. */
- queue1 = wl_display_create_queue_with_name(display, "First");
- assert(queue1);
- queue2 = wl_display_create_queue_with_name(display, "Second");
- assert(queue2);
- queue3 = wl_display_create_queue(display);
- assert(queue3);
- /* Create some requests and ensure their queues have the expected
- * names.
- */
- callback1 = roundtrip_named_queue_nonblock(display, queue1, "First");
- callback2 = roundtrip_named_queue_nonblock(display, queue2, "Second");
- callback3 = roundtrip_named_queue_nonblock(display, queue3, NULL);
- callback4 = roundtrip_named_queue_nonblock(display, NULL, "Default Queue");
- /* Destroy one queue with proxies still attached so we can verify
- * that the queue name is in the log message. */
- wl_event_queue_destroy(queue2);
- log = map_file(client_log_fd, &log_len);
- assert(strstr(log, "Second"));
- /* There's no reason for the First queue name to be present. */
- assert(!strstr(log, "First"));
- munmap(log, log_len);
- wl_callback_destroy(callback1);
- wl_callback_destroy(callback2);
- wl_callback_destroy(callback3);
- wl_callback_destroy(callback4);
- wl_event_queue_destroy(queue1);
- wl_event_queue_destroy(queue3);
- wl_display_disconnect(display);
- }
- static void
- dispatch_timeout_sync_callback(void *data, struct wl_callback *callback,
- uint32_t serial)
- {
- bool *done = data;
- *done = true;
- wl_callback_destroy(callback);
- }
- static const struct wl_callback_listener dispatch_timeout_sync_listener = {
- dispatch_timeout_sync_callback
- };
- static void
- client_test_queue_dispatch_simple(void)
- {
- struct wl_display *display;
- struct timespec timeout;
- struct wl_callback *callback;
- bool done = false;
- int ret = 0;
- display = wl_display_connect(NULL);
- assert(display);
- callback = wl_display_sync(display);
- assert(callback != NULL);
- wl_callback_add_listener(callback, &dispatch_timeout_sync_listener, &done);
- timespec_from_msec(&timeout, 1000);
- while (!done) {
- ret = wl_display_dispatch_timeout(display, &timeout);
- assert(ret > 0);
- }
- wl_display_disconnect(display);
- exit(0);
- }
- static void
- client_test_queue_dispatch_timeout(void)
- {
- struct wl_display *display;
- struct timespec timeout;
- int ret = 0;
- display = wl_display_connect(NULL);
- assert(display);
- timespec_from_msec(&timeout, 100);
- ret = wl_display_dispatch_timeout(display, &timeout);
- assert(ret == 0);
- wl_display_disconnect(display);
- exit(0);
- }
- /* Try to use a proxy with a destroyed queue as a factory for
- * another proxy (either normal or wrapper). This should succeed
- * although the new proxy may not be useful until a queue is attached.
- * The following code is safe to perform in the context of the test, since
- * we are not flushing the display write buffer, neither explicitly
- * (wl_display_flush()) nor implicitly (we don't place enough data to
- * fill the display buffer and cause an auto-flush). */
- static void
- client_test_queue_destroy_then_use_proxy_as_factory(void)
- {
- struct wl_display *display;
- struct wl_event_queue *queue;
- struct wl_registry *registry, *registry_wrapper;
- struct wl_proxy *proxy;
- display = wl_display_connect(NULL);
- assert(display);
- /* Create registry with a queue that's immediately destroyed. */
- queue = wl_display_create_queue(display);
- assert(queue);
- registry = wl_display_get_registry(display);
- assert(registry);
- wl_proxy_set_queue((struct wl_proxy *) registry, queue);
- wl_event_queue_destroy(queue);
- /* Scenario 1: Create a proxy using the registry (never flushed,
- * so details don't matter). */
- proxy = wl_registry_bind(registry, 1000, &wl_output_interface, 1);
- assert(proxy);
- /* Scenario 2: Create a wrapper proxy using the registry. */
- registry_wrapper = wl_proxy_create_wrapper(registry);
- assert(registry_wrapper);
- wl_proxy_wrapper_destroy((struct wl_proxy *) registry_wrapper);
- wl_proxy_destroy(proxy);
- wl_registry_destroy(registry);
- wl_display_disconnect(display);
- exit(0);
- }
- static void
- dummy_bind(struct wl_client *client,
- void *data, uint32_t version, uint32_t id)
- {
- }
- TEST(queue_proxy_destroy)
- {
- struct display *d;
- const struct wl_interface *dummy_interfaces[] = {
- &wl_seat_interface,
- &wl_pointer_interface,
- &wl_keyboard_interface,
- &wl_surface_interface
- };
- unsigned int i;
- d = display_create();
- for (i = 0; i < ARRAY_LENGTH(dummy_interfaces); i++)
- wl_global_create(d->wl_display, dummy_interfaces[i],
- dummy_interfaces[i]->version,
- NULL, dummy_bind);
- test_set_timeout(2);
- client_create_noarg(d, client_test_proxy_destroy);
- display_run(d);
- display_destroy(d);
- }
- TEST(queue_multiple_queues)
- {
- struct display *d = display_create();
- test_set_timeout(2);
- client_create_noarg(d, client_test_multiple_queues);
- display_run(d);
- display_destroy(d);
- }
- TEST(queue_roundtrip)
- {
- struct display *d = display_create();
- test_set_timeout(2);
- client_create_noarg(d, client_test_queue_roundtrip);
- display_run(d);
- display_destroy(d);
- }
- TEST(queue_set_queue_proxy_wrapper)
- {
- struct display *d = display_create();
- test_set_timeout(2);
- client_create_noarg(d, client_test_queue_proxy_wrapper);
- display_run(d);
- display_destroy(d);
- }
- TEST(queue_set_queue_race)
- {
- struct display *d = display_create();
- test_set_timeout(2);
- client_create_noarg(d, client_test_queue_set_queue_race);
- display_run(d);
- display_destroy(d);
- }
- TEST(queue_destroy_with_attached_proxies)
- {
- struct display *d = display_create();
- test_set_timeout(2);
- client_create_noarg(d, client_test_queue_destroy_with_attached_proxies);
- display_run(d);
- display_destroy(d);
- }
- TEST(queue_proxy_event_to_destroyed_queue)
- {
- struct display *d = display_create();
- struct client_info *ci;
- char *client_log;
- size_t client_log_len;
- test_set_timeout(2);
- ci = client_create_noarg(d, client_test_queue_proxy_event_to_destroyed_queue);
- display_run(d);
- /* Check that the final line in the log mentions the expected reason
- * for the abort. */
- client_log = map_file(ci->log_fd, &client_log_len);
- assert(!strcmp(last_line_of(client_log),
- "Tried to add event to destroyed queue\n"));
- munmap(client_log, client_log_len);
- /* Check that the client aborted. */
- display_destroy_expect_signal(d, SIGABRT);
- }
- TEST(queue_destroy_default_with_attached_proxies)
- {
- struct display *d = display_create();
- test_set_timeout(2);
- client_create_noarg(d, client_test_queue_destroy_default_with_attached_proxies);
- display_run(d);
- display_destroy(d);
- }
- TEST(queue_names)
- {
- struct display *d = display_create();
- test_set_timeout(2);
- client_create_noarg(d, client_test_queue_names);
- display_run(d);
- display_destroy(d);
- }
- TEST(queue_dispatch_simple)
- {
- struct display *d = display_create();
- test_set_timeout(2);
- client_create_noarg(d, client_test_queue_dispatch_simple);
- display_run(d);
- display_destroy(d);
- }
- TEST(queue_dispatch_timeout)
- {
- struct display *d = display_create();
- test_set_timeout(2);
- client_create_noarg(d, client_test_queue_dispatch_timeout);
- display_run(d);
- display_destroy(d);
- }
- TEST(queue_destroy_then_use_proxy_as_factory)
- {
- struct display *d = display_create();
- test_set_timeout(2);
- client_create_noarg(d, client_test_queue_destroy_then_use_proxy_as_factory);
- display_run(d);
- display_destroy(d);
- }
|