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>
This commit is contained in:
parent
21414e7c44
commit
3bd1b4cce3
|
@ -10,7 +10,7 @@ LDADD = @CHECK_LIBS@ $(top_builddir)/src/libxcb.la
|
||||||
if HAVE_CHECK
|
if HAVE_CHECK
|
||||||
TESTS = check_all
|
TESTS = check_all
|
||||||
check_PROGRAMS = check_all
|
check_PROGRAMS = check_all
|
||||||
check_all_SOURCES = check_all.c check_suites.h check_public.c
|
check_all_SOURCES = check_all.c check_suites.h check_public.c check_integration.c
|
||||||
|
|
||||||
check-local: check-TESTS
|
check-local: check-TESTS
|
||||||
$(RM) CheckLog.html
|
$(RM) CheckLog.html
|
||||||
|
|
|
@ -21,6 +21,7 @@ int main(void)
|
||||||
{
|
{
|
||||||
int nf;
|
int nf;
|
||||||
SRunner *sr = srunner_create(public_suite());
|
SRunner *sr = srunner_create(public_suite());
|
||||||
|
srunner_add_suite(sr, integration_suite());
|
||||||
srunner_set_xml(sr, "CheckLog_xcb.xml");
|
srunner_set_xml(sr, "CheckLog_xcb.xml");
|
||||||
srunner_run_all(sr, CK_NORMAL);
|
srunner_run_all(sr, CK_NORMAL);
|
||||||
nf = srunner_ntests_failed(sr);
|
nf = srunner_ntests_failed(sr);
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
#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;
|
||||||
|
}
|
|
@ -6,3 +6,4 @@ void suite_add_test(Suite *s, TFun tf, const char *name);
|
||||||
void suite_add_test(Suite *s, const TTest *tt, const char *name);
|
void suite_add_test(Suite *s, const TTest *tt, const char *name);
|
||||||
#endif
|
#endif
|
||||||
Suite *public_suite(void);
|
Suite *public_suite(void);
|
||||||
|
Suite *integration_suite(void);
|
||||||
|
|
Loading…
Reference in New Issue