summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-05-04 17:00:57 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-06 14:37:22 +1000
commitd523fbe428e4513d85402caa83e9349256b680cc (patch)
treed7aa8306e8a897ad0207e61ebdc5ecd4c2fedb1f
parent59358de4b68a01452bf68593beb83605087ebc8f (diff)
test: add test for xi2 struct sizes.
-rw-r--r--test/input.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/input.c b/test/input.c
index a9027f0d3..e49cc8127 100644
--- a/test/input.c
+++ b/test/input.c
@@ -25,10 +25,12 @@
#include <dix-config.h>
#endif
+#include <stdint.h>
#include <X11/X.h>
#include "misc.h"
#include "resource.h"
#include <X11/Xproto.h>
+#include <X11/extensions/XI2proto.h>
#include <X11/Xatom.h>
#include "windowstr.h"
#include "inputstr.h"
@@ -276,6 +278,31 @@ static void dix_event_to_core_conversion(void)
dix_event_to_core(ET_ProximityOut);
}
+static void xi2_struct_sizes(void)
+{
+#define compare(req) \
+ g_assert(sizeof(req) == sz_##req);
+
+ compare(xXIQueryVersionReq);
+ compare(xXIWarpDevicePointerReq);
+ compare(xXIChangeDeviceCursorReq);
+ compare(xXIChangeDeviceHierarchyReq);
+ compare(xXISetClientPointerReq);
+ compare(xXIGetClientPointerReq);
+ compare(xXISelectEventsReq);
+ compare(xXIQueryVersionReq);
+ compare(xXIQueryDeviceReq);
+ compare(xXISetDeviceFocusReq);
+ compare(xXIGetDeviceFocusReq);
+ compare(xXIGrabDeviceReq);
+ compare(xXIUngrabDeviceReq);
+ compare(xXIAllowEventsReq);
+ compare(xXIPassiveGrabDeviceReq);
+ compare(xXIPassiveUngrabDeviceReq);
+#undef compare
+}
+
+
int main(int argc, char** argv)
{
g_test_init(&argc, &argv,NULL);
@@ -284,6 +311,7 @@ int main(int argc, char** argv)
g_test_add_func("/dix/input/init-valuators", dix_init_valuators);
g_test_add_func("/dix/input/event-core-conversion", dix_event_to_core_conversion);
g_test_add_func("/dix/input/check-grab-values", dix_check_grab_values);
+ g_test_add_func("/dix/input/xi2-struct-sizes", xi2_struct_sizes);
return g_test_run();
}