[PATCH wayland 3/4] tests: use test_set_timeout in display-test

Pekka Paalanen ppaalanen at gmail.com
Mon Nov 17 07:03:03 PST 2014


On Wed, 12 Nov 2014 13:53:03 +0200
Giulio Camuffo <giuliocamuffo at gmail.com> wrote:

> 2014-11-12 13:46 GMT+02:00 Marek Chalupa <mchqwerty at gmail.com>:
> >
> >
> > On 7 November 2014 21:26, Giulio Camuffo <giuliocamuffo at gmail.com>
> > wrote:
> >>
> >> I'm a bit confused here... you remove the alarm() calls but not the
> >> signal handler or the sigaction setting.
> >
> >
> > The alarm worked with default action - that is kill the process.
> > There were no signal handler or sigaction setting before.
> > When test failed, it was due to SIGALRM and nothing else.
> 
> I see. It looks good then.

Nice, pushed.


Thanks,
pq


> >> On the other hand, in the
> >> patch introducing test_set_timeout() you add a new SIGALRM
> >> handler... Am i missing something?
> >
> >
> > So now it should be all OK with the handlers :)
> >
> >>
> >>
> >>
> >>
> >> --
> >> Giulio
> >>
> >>
> >> 2014-09-24 15:37 GMT+03:00 Marek Chalupa <mchqwerty at gmail.com>:
> >> > replace call to alarm() with test_set_timeout()
> >> >
> >> > Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
> >> > ---
> >> >  tests/display-test.c | 8 ++++----
> >> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >> >
> >> > diff --git a/tests/display-test.c b/tests/display-test.c
> >> > index a1e45b1..8435d60 100644
> >> > --- a/tests/display-test.c
> >> > +++ b/tests/display-test.c
> >> > @@ -425,7 +425,7 @@ threading_post_err(void)
> >> >         /* kill test in 3 seconds. This should be enough time
> >> > for the
> >> >          * thread to exit if it's not blocking. If everything is
> >> > OK, than
> >> >          * the thread was woken up and the test will end before
> >> > the SIGALRM */
> >> > -       alarm(3);
> >> > +       test_set_timeout(3);
> >> >         pthread_join(thread, NULL);
> >> >
> >> >         wl_proxy_destroy((struct wl_proxy *) c->tc);
> >> > @@ -477,7 +477,7 @@ threading_cancel_read(void)
> >> >         /* kill test in 3 seconds. This should be enough time
> >> > for the
> >> >          * thread to exit if it's not blocking. If everything is
> >> > OK, than
> >> >          * the thread was woken up and the test will end before
> >> > the SIGALRM */
> >> > -       alarm(3);
> >> > +       test_set_timeout(3);
> >> >         pthread_join(th1, NULL);
> >> >         pthread_join(th2, NULL);
> >> >         pthread_join(th3, NULL);
> >> > @@ -516,7 +516,7 @@ threading_read_eagain(void)
> >> >          * set it - check if we're testing the right case */
> >> >         assert(errno == EAGAIN);
> >> >
> >> > -       alarm(3);
> >> > +       test_set_timeout(3);
> >> >         pthread_join(th1, NULL);
> >> >         pthread_join(th2, NULL);
> >> >         pthread_join(th3, NULL);
> >> > @@ -577,7 +577,7 @@ threading_read_after_error(void)
> >> >         assert(wl_display_read_events(c->wl_display) == -1);
> >> >
> >> >         /* kill test in 3 seconds */
> >> > -       alarm(3);
> >> > +       test_set_timeout(3);
> >> >         pthread_join(thread, NULL);
> >> >
> >> >         wl_proxy_destroy((struct wl_proxy *) c->tc);
> >> > --
> >> > 1.9.3
> >> >
> >> > _______________________________________________
> >> > wayland-devel mailing list
> >> > wayland-devel at lists.freedesktop.org
> >> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> >
> >
> > Thanks,
> > Marek
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list