summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2015-04-06 16:44:45 +0200
committerUli Schlachter <psychon@znc.in>2015-04-06 16:44:45 +0200
commit7e5cb24eb4a3cfa3e9dc35c173ea043469549a13 (patch)
tree435a758a1da98a9c498b8ef64791e259fb91214e
parent5f13d59080e585bc60d67cd00fd2ceb8671c5c06 (diff)
tests: Add some XFixes-based tests
Signed-off-by: Uli Schlachter <psychon@znc.in>
-rw-r--r--tests/test.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test.c b/tests/test.c
index dd9ae23..2fa40ce 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -256,6 +256,32 @@ static int test_randr(xcb_connection_t *c, xcb_errors_context_t *ctx)
return err;
}
+static int test_xfixes(xcb_connection_t *c, xcb_errors_context_t *ctx)
+{
+ struct xcb_query_extension_reply_t *reply;
+ int err = 0;
+
+ reply = xcb_query_extension_reply(c,
+ xcb_query_extension(c, strlen("XFIXES"), "XFIXES"), NULL);
+ if (!reply || !reply->present) {
+ fprintf(stderr, "XFIXES not supported by display\n");
+ free(reply);
+ return SKIP;
+ }
+
+ err |= check_request(ctx, reply->major_opcode, "XFixes");
+ err |= check_error(ctx, reply->first_error + 0, "BadRegion", "XFixes");
+ err |= check_event(ctx, reply->first_event + 0, "SelectionNotify", "XFixes");
+ err |= check_event(ctx, reply->first_event + 1, "CursorNotify", "XFixes");
+ err |= check_minor(ctx, reply->major_opcode, 0, "QueryVersion");
+ err |= check_minor(ctx, reply->major_opcode, 32, "DeletePointerBarrier");
+ err |= check_minor(ctx, reply->major_opcode, 1337, NULL);
+ err |= check_minor(ctx, reply->major_opcode, 0xffff, NULL);
+
+ free(reply);
+ return err;
+}
+
static int test_xinput(xcb_connection_t *c, xcb_errors_context_t *ctx)
{
struct xcb_query_extension_reply_t *reply;
@@ -359,6 +385,7 @@ static int test_valid_connection(void)
err |= test_randr(c, ctx);
err |= test_xinput(c, ctx);
err |= test_xkb(c, ctx);
+ err |= test_xfixes(c, ctx);
xcb_errors_context_free(ctx);
xcb_disconnect(c);