aboutsummaryrefslogtreecommitdiffstats
path: root/tests/display-test.c
diff options
context:
space:
mode:
authorMarek Chalupa <mchqwerty@gmail.com>2014-11-12 13:14:46 +0100
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-11-17 16:48:14 +0200
commit6ebe55060e6337f56e295032cc776fce694acbdb (patch)
tree686e80bc077b17487edc0e3c79ab2aab47c8cc34 /tests/display-test.c
parenttests: add timeout (diff)
downloadwayland-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.c15
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