xorg-libxcb/tests/check_integration.c
Uli Schlachter 3bd1b4cce3 Add a regression test for #13
This basically took the code from [0], replaced the SetInputFocus
request with NoOp and integrated the result with check. This test
currently hangs.

[0]: https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/13

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-09-30 18:24:43 +02:00

32 lines
861 B
C

#include <check.h>
#include <stdlib.h>
#include "check_suites.h"
#include "xcb.h"
#include "xcbext.h"
START_TEST(request_check_hang)
{
// Other tests mess with the environment. Try to get us an X11 server.
putenv("DISPLAY=:0");
xcb_connection_t *connection = xcb_connect(NULL, NULL);
ck_assert_uint_eq(0, xcb_connection_has_error(connection));
// Regression test for https://gitlab.freedesktop.org/xorg/lib/libxcb/-/issues/53
xcb_void_cookie_t cookie = xcb_no_operation_checked(connection);
xcb_flush(connection);
xcb_get_input_focus(connection);
// The following call once upon a time hung
xcb_request_check(connection, cookie);
xcb_disconnect(connection);
}
END_TEST
Suite *integration_suite(void)
{
Suite *s = suite_create("Integration");
suite_add_test(s, request_check_hang, "regression test: hand in xcb_request_check()");
return s;
}