diff options
Diffstat (limited to 'tests/common/test_backends.c')
| -rw-r--r-- | tests/common/test_backends.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/common/test_backends.c b/tests/common/test_backends.c index 605dac0..4c99646 100644 --- a/tests/common/test_backends.c +++ b/tests/common/test_backends.c @@ -1,5 +1,11 @@ #define _POSIX_C_SOURCE 200809L #include "yasl/native.h" +#if YASL_HAS_WAYLAND +#include "yasl/native/wayland.h" +#endif +#if YASL_HAS_X11 +#include "yasl/native/x11.h" +#endif #include "yasl/loop.h" #include "yasl/yasl.h" @@ -145,6 +151,8 @@ static void x11_behavior(struct yasl_loop *loop, struct yasl_display *d, struct Display *native = yasl_display_get_native_handle(d); Window window = (Window)(uintptr_t)yasl_surface_get_native_handle(w->surface); assert(native && window); + assert(yasl_x11_display_get_display(d) == native); + assert(yasl_x11_surface_get_window(w->surface) == (uintptr_t)window); XSync(native, False); XImage *image = XGetImage(native, window, 0, 0, 1, 1, AllPlanes, ZPixmap); assert(image && (XGetPixel(image, 0, 0) & 0xffffff) == 0x4080c0); @@ -282,6 +290,16 @@ int main(int argc, char **argv) struct yasl_display *b = yasl_display_open(loop, &spec); assert(a && b); struct window wa = create(a), wb = create(b); +#if YASL_HAS_WAYLAND + assert(yasl_wayland_display_get_wl_display(a) != NULL); + assert(yasl_wayland_surface_get_wl_surface(wa.surface) != NULL); + assert(!yasl_x11_display_get_display(a)); +#endif +#if YASL_HAS_X11 + assert(yasl_x11_display_get_display(b) != NULL); + assert(yasl_x11_surface_get_window(wb.surface) != 0); + assert(!yasl_wayland_display_get_wl_display(b)); +#endif attach(&wa); attach(&wb); pump(loop, a, b); |
