summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-12-03 14:57:53 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-03 14:57:53 +1000
commit5bc4c0b10c6ca97272cdbf1581d1a2403502bc06 (patch)
tree56998ecdb22bddc662cf36b9b3f9da49a4e4d80f
parent06a95f7d08b4d163f75e429ec5aa79dad294d91e (diff)
server/barriers: pixmaps are not allowed as drawable for barriers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--tests/server/barriers-validity.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/server/barriers-validity.cpp b/tests/server/barriers-validity.cpp
index b931195..342830b 100644
--- a/tests/server/barriers-validity.cpp
+++ b/tests/server/barriers-validity.cpp
@@ -48,6 +48,23 @@ TEST_F(BarrierSimpleTest, DestroyInvalidBarrier)
ASSERT_ERROR(error, xfixes_error_base + BadBarrier);
}
+TEST_F(BarrierSimpleTest, PixmapsNotAllowed)
+{
+ XORG_TESTCASE("Pixmaps are not allowed as drawable.\n"
+ "Ensure error is generated\n");
+
+ ::Display *dpy = Display();
+ Window root = DefaultRootWindow(dpy);
+ Pixmap p = XCreatePixmap(dpy, root, 10, 10, DefaultDepth(dpy, DefaultScreen(dpy)));
+ XSync(dpy, False);
+
+ SetErrorTrap(Display());
+ XFixesCreatePointerBarrier(dpy, p, 20, 20, 20, 40, BarrierPositiveX, 0, NULL);
+ const XErrorEvent *error = ReleaseErrorTrap(Display());
+ ASSERT_ERROR(error, BadWindow);
+ ASSERT_EQ(error->resourceid, p);
+}
+
TEST_F(BarrierSimpleTest, InvalidDeviceCausesBadDevice)
{
XORG_TESTCASE("Ensure that passing a garbage device ID\n"