[PATCH wayland 2/4] tests: add timeout test

Giulio Camuffo giuliocamuffo at gmail.com
Fri Nov 7 12:08:43 PST 2014


Looks good, they fail as expected.

Reviewed-by: Giulio Camuffo <giuliocamuffo at gmail.com>

2014-09-24 15:37 GMT+03:00 Marek Chalupa <mchqwerty at gmail.com>:
> sanity test if timeouts work.
>
> Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
> ---
>  tests/sanity-test.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/tests/sanity-test.c b/tests/sanity-test.c
> index 46f4f85..5a03e7c 100644
> --- a/tests/sanity-test.c
> +++ b/tests/sanity-test.c
> @@ -29,6 +29,9 @@
>  #include "test-runner.h"
>  #include "wayland-util.h"
>
> +#define WL_HIDE_DEPRECATED
> +#include "test-compositor.h"
> +
>  extern int leak_check_enabled;
>
>  TEST(empty)
> @@ -125,3 +128,25 @@ TEST(sanity_fd_exec)
>
>         exec_fd_leak_check(nr_fds + 2);
>  }
> +
> +FAIL_TEST(timeout_tst)
> +{
> +       test_set_timeout(1);
> +       sleep(2);
> +}
> +
> +static void
> +client_timeout(void)
> +{
> +       test_set_timeout(1);
> +       sleep(2);
> +}
> +
> +/* test timeout with test-compositor */
> +FAIL_TEST(tc_timeout_tst)
> +{
> +       struct display *d = display_create();
> +       client_create(d, client_timeout);
> +       display_run(d);
> +       display_destroy(d);
> +}
> --
> 1.9.3
>
> _______________________________________________
> 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