summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-08-07 16:11:37 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-08-13 11:19:35 +1000
commit8483b08152104dc619d9e44f877d2687d866355e (patch)
treef5caf9910777e5d03d5393753a158f99bd984c26
parent59dc59a72ffd4cbc4df207bc688c92bb4863e8a9 (diff)
test: add focus and enter conversion testing.
Doesn't actually convert anything, but verify the expected behaviour.
-rw-r--r--test/xi2/protocol-eventconvert.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c
index ce201587d..e9ca68b2e 100644
--- a/test/xi2/protocol-eventconvert.c
+++ b/test/xi2/protocol-eventconvert.c
@@ -150,6 +150,35 @@ static void test_XIRawEvent(RawDeviceEvent *in)
}
+static void test_convert_XIFocusEvent(void)
+{
+ xEvent *out;
+ DeviceEvent in;
+ int rc;
+
+ in.header = ET_Internal;
+ in.type = ET_Enter;
+ rc = EventToXI2((InternalEvent*)&in, &out);
+ g_assert(rc == Success);
+ g_assert(out == NULL);
+
+ in.header = ET_Internal;
+ in.type = ET_FocusIn;
+ rc = EventToXI2((InternalEvent*)&in, &out);
+ g_assert(rc == Success);
+ g_assert(out == NULL);
+
+ in.header = ET_Internal;
+ in.type = ET_FocusOut;
+ rc = EventToXI2((InternalEvent*)&in, &out);
+ g_assert(rc == BadImplementation);
+
+ in.header = ET_Internal;
+ in.type = ET_Leave;
+ rc = EventToXI2((InternalEvent*)&in, &out);
+ g_assert(rc == BadImplementation);
+}
+
static void test_convert_XIRawEvent(void)
{
@@ -244,6 +273,7 @@ int main(int argc, char** argv)
g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
g_test_add_func("/xi2/eventconvert/XIRawEvent", test_convert_XIRawEvent);
+ g_test_add_func("/xi2/eventconvert/XIFocusEvent", test_convert_XIFocusEvent);
return g_test_run();
}