Commit Graph

50 Commits

Author SHA1 Message Date
Peter Hutterer
b4baab90c0 dix: EventToCore needs to copy the root window too.
This value isn't actually set for normal events but it saves us some work
for the record extension support.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27 14:38:16 -08:00
Peter Hutterer
90e6d93cf9 test/xi2: fail if xi2 class type is garbage. (#25492)
If the keycode range exceeds the allowable length, memory gets overwritten.
Catch this case by making sure that only allowed class types are
present.

X.Org Bug 25492 <http://bugs.freedesktop.org/show_bug.cgi?id=25492>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-22 21:30:52 -08:00
Julien Cristau
b44c9be244 test/xi2: fix maximum max_keycode (bug#25492)
The number of keycodes needs to be lower than 0xFFFD so that the length
field of xXIKeyInfo doesn't overflow.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-23 11:43:21 +10:00
Peter Hutterer
1b127ab842 Xi: when deleting all properties, reset property handler to NULL.
Trying to unregister property handlers during the device closure process
leads to invalid memory accesses.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-11-25 10:57:07 +10:00
Gaetan Nadon
c739beb439 .gitignore: use common defaults with custom section #24239
Using common defaults will reduce errors and maintenance.
Only the very small or inexistent custom section need periodic maintenance
when the structure of the component changes. Do not edit defaults.

Reviewed-By: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-11 21:40:20 -08:00
Alan Coopersmith
4b0911565d Add platform tests for Dtrace linker magic
Replaces special handling for Xquartz DDX and scales better to handling
the multiple platforms that now have some level of Dtrace support available.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2009-10-06 19:40:19 -07:00
Alan Coopersmith
e23bffc41b Fix build of unit tests when dtrace probes are enabled
ar loses the dtrace probe magic when building static libraries, so we
have to link with the .O files in order to resolve the dtrace probe symbols.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-24 16:36:25 -07:00
Alan Coopersmith
139368f7ae Fix num_masks/length overflow test for XiSelectEvents
Have to set windowid to a valid value first, since that check
appears earlier in the code than the masks/length check.

Also have to have data[] set large enough so that reading mask
data for 0xFFFF masks doesn't overflow past the end of the array
into uninitialized data.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-16 11:44:08 +10:00
Alan Coopersmith
13decf5efe test_convert_XIRawEvent: Don't write more data than the struct holds
sizeof(in.valuators.mask) * 8 == 40, but the valuators arrays only
holds 36 entries, so the test was smashing the stack when 36 < i < 40
(leading to core dumps on Solaris x86, since the return address was
 overwritten with an invalid pointer).

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-16 11:04:25 +10:00
Alan Coopersmith
38a61e9a7c Remove stray semi-colon in protocol-common.c
Caused Sun compilers to issue warning:
"protocol-common.c", line 141: warning: syntax error:  empty declaration

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-16 11:04:25 +10:00
Peter Hutterer
84eb4c66a4 test: add protocol testing for XIWarpPointer.
TODO: some way to check src_x/y coordinates would be good.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03 11:00:54 +10:00
Peter Hutterer
1b7858e846 test: expose the default screen to tests, some cleanup work.
Provide common #define for invalid window IDs.
Init the sprite's hotPhys, provide a common #define for the initial sprite
position.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03 11:00:49 +10:00
Peter Hutterer
377a5f655c Xi: if XISetEventMask fails, return this to the client.
The only failure point can be a BadAlloc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03 08:39:27 +10:00
Peter Hutterer
b41db8fe46 Xi: fix broken swap code in XISelectEvents request processing.
The pointer advanced 12 bytes too short. Rather unfortunate if both the code
and the test have the same bug.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03 08:39:27 +10:00
Peter Hutterer
6fe235d363 test: fix request length calculation, add length tests for XISelectEvents
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03 08:39:26 +10:00
Peter Hutterer
7ab1b50c54 test: fix build after changing libxf86config.la
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03 08:39:26 +10:00
Peter Hutterer
2fba2eac0b test: add a few tests for xtest device initialization.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-27 14:24:51 +10:00
Peter Hutterer
fe430d7d3b test: add XIQueryPointer protocol tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24 10:08:14 +10:00
Peter Hutterer
f1c856ef90 test: fake initialization of a sprite trace and window locations
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24 10:07:06 +10:00
Peter Hutterer
7e37e7c50e test: add protocol tests for DeviceChangedEvents
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-17 14:40:21 +10:00
Peter Hutterer
af38f6790c test: add event conversion tests for XIDeviceEvents 2009-08-13 11:19:36 +10:00
Peter Hutterer
8483b08152 test: add focus and enter conversion testing.
Doesn't actually convert anything, but verify the expected behaviour.
2009-08-13 11:19:35 +10:00
Peter Hutterer
59dc59a72f test: add XI2 eventconversion test for raw events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13 11:19:35 +10:00
Peter Hutterer
10d7948e03 test: fix build error introduced by new AllocDevicePair API
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13 11:19:35 +10:00
Peter Hutterer
9498113139 test: fix build by including eventstr.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 21:59:52 +10:00
Peter Hutterer
9a1bfa5664 input: remove XI2 keysym grabs, use keycode grabs instead.
Keysym grabs are tricky in the details, keycode grabs are known to work. So
for now, provide keycode grabs only.

Requires inputproto 1.9.99.15.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-22 12:12:51 +10:00
Peter Hutterer
cc575a3ba4 test: add tests for ProcXIGetClientPointer.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 11:43:58 +10:00
Peter Hutterer
92b0065a19 test: add ProcXISetClientPointer tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 11:41:29 +10:00
Peter Hutterer
019bc9d70c test: add ProcXIGetSelectedEvents tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 11:41:29 +10:00
Peter Hutterer
8579d39c12 test: add ProcXISelectEvents tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 11:41:29 +10:00
Peter Hutterer
60b7a79900 test: add ProcXIQueryDevice tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 11:41:28 +10:00
Peter Hutterer
441c91be05 test: Add ProcXIQueryVersion tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 11:41:28 +10:00
Peter Hutterer
1d635ae65b test: add xi2 directory, prepare for protocol testing.
These two files provide a couple of common defines, functions and variables
that will be used in a number of protocol tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 11:41:28 +10:00
Peter Hutterer
4b93413b2a Add test subdir to base Makefile.am
If unittests are enabled, make will build those as well - spotting potential
build errors in the tests faster. Furthermore, this allows for the tests to
be run from the top-level directory.
This patch removes the "run make check to build the test suite" message
since that'd pop up after every build now.

If unittests are disabled, this change has no effect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 11:40:46 +10:00
Peter Hutterer
912402fd71 include: introduce byte counting functions.
This patch adds the following three functions:
 bits_to_bytes(bits) - the number of bytes needed to hold 'bits'
 bytes_to_int32(bytes) - the number of 4-byte units to hold 'bytes'
 pad_to_int32(bytes) - the closest multiple of 4 equal to or larger than
                        'bytes'.

All three operations are common in protocol processing and currently the
server has ((foo + 7)/8 + 3)/4 operations all over the place. A common set
of functions reduce the error rate of these (albeit simple) calculations and
improve readability of the code.

The functions do not check for overflow.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 10:05:53 +10:00
Peter Hutterer
bf0f3b8f2b test: fix build error introduced by XINPUT_ABI 7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-29 13:31:19 +10:00
Peter Hutterer
7f3456a408 Revert "test: check from INT_MIN to INT_MAX for core type conversion"
This patch requires extra special casing to check if the linker supports the
-wrap option. Patches to do so will follow, in the meantime, revert this
commit. It shouldn't have been pushed in the first place anyway.

This reverts commit d979f44394.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-05 16:45:28 +10:00
Peter Hutterer
d979f44394 test: check from INT_MIN to INT_MAX for core type conversion
ErrorF is link-wrapped to reduce the run-time of the test.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-04 11:41:02 +10:00
Peter Hutterer
d8471bc7a1 test: adjust event_to_core_conversion test for new ProximityIn/Out behaviour
Both types now return BadMatch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-04 11:32:36 +10:00
Peter Hutterer
38df8351b3 test: add grab matching tests. 2009-06-02 16:02:31 +10:00
Peter Hutterer
080b0331b3 input: Add grabtype to GrabParameters.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-01 13:48:43 +10:00
Peter Hutterer
cc71dfb4f5 test: Add GetSelectedEvents request to struct size tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-01 13:45:30 +10:00
Peter Hutterer
de5c5b1db0 test: fix compile error introduced with the removal of isMaster.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-01 13:45:30 +10:00
Peter Hutterer
8ff1bff8f4 Update to new XI2 names 2009-05-16 12:20:58 +10:00
Peter Hutterer
83f32d3972 Xi: Add XI2 property requests. 2009-05-08 14:33:23 +10:00
Peter Hutterer
d523fbe428 test: add test for xi2 struct sizes. 2009-05-06 14:37:22 +10:00
Peter Hutterer
6a618929a0 input: reshuffle CreateGrab and friends to take a GrabParameters param.
This is cleaning up work in preparation for XI2 passive grabs.
2009-05-01 09:07:37 +10:00
Peter Hutterer
98a1fa9941 test: add InternalEvent to core event conversion tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-28 16:03:56 +10:00
Peter Hutterer
990e8362a7 test: add a simple test to verify device axis intialization.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-28 16:03:56 +10:00
Peter Hutterer
4eac0df060 Add a test-suite for in-server unit-testing.
This patch adds a test/ directory that contains the setup for a unit-testing
suite designed for in-server unit-testing. All functions available to the X
server are available to the test binaries through static linking.

This test suite uses the glib testing framework.
Do not use glib calls outside of the test/ directory.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-28 16:03:56 +10:00