diff options
| author | Marek Chalupa <mchqwerty@gmail.com> | 2014-11-12 13:14:46 +0100 |
|---|---|---|
| committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2014-11-17 16:48:14 +0200 |
| commit | 6ebe55060e6337f56e295032cc776fce694acbdb (patch) | |
| tree | 686e80bc077b17487edc0e3c79ab2aab47c8cc34 /tests/display-test.c | |
| parent | tests: add timeout (diff) | |
| download | wayland-6ebe55060e6337f56e295032cc776fce694acbdb.tar wayland-6ebe55060e6337f56e295032cc776fce694acbdb.tar.gz wayland-6ebe55060e6337f56e295032cc776fce694acbdb.tar.bz2 wayland-6ebe55060e6337f56e295032cc776fce694acbdb.tar.lz wayland-6ebe55060e6337f56e295032cc776fce694acbdb.tar.xz wayland-6ebe55060e6337f56e295032cc776fce694acbdb.tar.zst wayland-6ebe55060e6337f56e295032cc776fce694acbdb.zip | |
tests: add test_usleep and test_sleep functions
The former one was already used in tests, but was private.
These functions can be shared across the tests, so make them
public.
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'tests/display-test.c')
| -rw-r--r-- | tests/display-test.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/tests/display-test.c b/tests/display-test.c index a1e45b1..f8aac64 100644 --- a/tests/display-test.c +++ b/tests/display-test.c @@ -333,21 +333,6 @@ register_reading(struct wl_display *display) assert(wl_display_flush(display) >= 0); } -#define USEC_TO_NSEC(n) (1000 * (n)) - -/* since we are using alarm() and SIGABRT, we can not - * use usleep function (see 'man usleep') */ -static void -test_usleep(useconds_t usec) -{ - struct timespec ts = { - .tv_sec = 0, - .tv_nsec = USEC_TO_NSEC(usec) - }; - - assert(nanosleep(&ts, NULL) == 0); -} - /* create thread that will call prepare+read so that * it will block */ static pthread_t |
