mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-12-20 16:20:08 +01:00
tests/event-loop-test: Remove event loop timer test
The event loop timer test has very precise sequencing and timing constraints, which make it difficult to pass reliably on loaded systems. Since this test isn't providing much value, remove it to prevent the erroneous errors. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
This commit is contained in:
parent
bbb5fa66a7
commit
99638501a1
1 changed files with 0 additions and 43 deletions
|
|
@ -238,49 +238,6 @@ TEST(event_loop_multiple_same_signals)
|
|||
wl_event_loop_destroy(loop);
|
||||
}
|
||||
|
||||
static int
|
||||
timer_callback(void *data)
|
||||
{
|
||||
int *got_it = data;
|
||||
|
||||
++(*got_it);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
TEST(event_loop_timer)
|
||||
{
|
||||
struct wl_event_loop *loop = wl_event_loop_create();
|
||||
struct wl_event_source *source1, *source2;
|
||||
int got_it = 0;
|
||||
|
||||
source1 = wl_event_loop_add_timer(loop, timer_callback, &got_it);
|
||||
assert(source1);
|
||||
wl_event_source_timer_update(source1, 20);
|
||||
|
||||
source2 = wl_event_loop_add_timer(loop, timer_callback, &got_it);
|
||||
assert(source2);
|
||||
wl_event_source_timer_update(source2, 100);
|
||||
|
||||
/* Check that the timer marked for 20 msec from now fires within 30
|
||||
* msec, and that the timer marked for 100 msec is expected to fire
|
||||
* within an additional 90 msec. (Some extra wait time is provided to
|
||||
* account for reasonable code execution / thread preemption delays.) */
|
||||
|
||||
wl_event_loop_dispatch(loop, 0);
|
||||
assert(got_it == 0);
|
||||
wl_event_loop_dispatch(loop, 30);
|
||||
assert(got_it == 1);
|
||||
wl_event_loop_dispatch(loop, 0);
|
||||
assert(got_it == 1);
|
||||
wl_event_loop_dispatch(loop, 90);
|
||||
assert(got_it == 2);
|
||||
|
||||
wl_event_source_remove(source1);
|
||||
wl_event_source_remove(source2);
|
||||
wl_event_loop_destroy(loop);
|
||||
}
|
||||
|
||||
#define MSEC_TO_USEC(msec) ((msec) * 1000)
|
||||
|
||||
struct timer_update_context {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue