summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2009-12-22test/xi2: fail if xi2 class type is garbage. (#25492)Peter Hutterer1-0/+3
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-23test/xi2: fix maximum max_keycode (bug#25492)Julien Cristau1-1/+1
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-11-25Xi: when deleting all properties, reset property handler to NULL.Peter Hutterer1-0/+54
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-11.gitignore: use common defaults with custom section #24239Gaetan Nadon1-0/+2
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-10-06Add platform tests for Dtrace linker magicAlan Coopersmith2-2/+2
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-09-24Fix build of unit tests when dtrace probes are enabledAlan Coopersmith2-0/+8
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-16Fix num_masks/length overflow test for XiSelectEventsAlan Coopersmith1-1/+2
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-16test_convert_XIRawEvent: Don't write more data than the struct holdsAlan Coopersmith1-1/+1
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-16Remove stray semi-colon in protocol-common.cAlan Coopersmith1-1/+1
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-03test: add protocol testing for XIWarpPointer.Peter Hutterer2-0/+220
TODO: some way to check src_x/y coordinates would be good. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03test: expose the default screen to tests, some cleanup work.Peter Hutterer4-12/+26
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-03Xi: if XISetEventMask fails, return this to the client.Peter Hutterer2-2/+3
The only failure point can be a BadAlloc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03Xi: fix broken swap code in XISelectEvents request processing.Peter Hutterer1-1/+1
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-03test: fix request length calculation, add length tests for XISelectEventsPeter Hutterer1-2/+17
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03test: fix build after changing libxf86config.laPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-27test: add a few tests for xtest device initialization.Peter Hutterer2-1/+118
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24test: add XIQueryPointer protocol tests.Peter Hutterer2-0/+224
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24test: fake initialization of a sprite trace and window locationsPeter Hutterer1-0/+27
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-17test: add protocol tests for DeviceChangedEventsPeter Hutterer1-5/+269
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13test: add event conversion tests for XIDeviceEventsPeter Hutterer1-0/+361
2009-08-13test: add focus and enter conversion testing.Peter Hutterer1-0/+30
Doesn't actually convert anything, but verify the expected behaviour.
2009-08-13test: add XI2 eventconversion test for raw events.Peter Hutterer2-1/+252
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13test: fix build error introduced by new AllocDevicePair APIPeter Hutterer1-2/+6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30test: fix build by including eventstr.hPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-22input: remove XI2 keysym grabs, use keycode grabs instead.Peter Hutterer1-2/+2
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-14test: add tests for ProcXIGetClientPointer.Peter Hutterer2-1/+174
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14test: add ProcXISetClientPointer tests.Peter Hutterer2-1/+154
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14test: add ProcXIGetSelectedEvents tests.Peter Hutterer2-1/+246
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14test: add ProcXISelectEvents tests.Peter Hutterer2-1/+326
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14test: add ProcXIQueryDevice tests.Peter Hutterer2-1/+321
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14test: Add ProcXIQueryVersion tests.Peter Hutterer2-0/+197
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14test: add xi2 directory, prepare for protocol testing.Peter Hutterer4-0/+282
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-14Add test subdir to base Makefile.amPeter Hutterer1-3/+0
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-14include: introduce byte counting functions.Peter Hutterer1-0/+39
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-06-29test: fix build error introduced by XINPUT_ABI 7Peter Hutterer1-2/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-05Revert "test: check from INT_MIN to INT_MAX for core type conversion"Peter Hutterer2-31/+26
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 d979f443946011158b6a183582728a6899c33b85. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-04test: check from INT_MIN to INT_MAX for core type conversionPeter Hutterer2-26/+31
ErrorF is link-wrapped to reduce the run-time of the test. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-04test: adjust event_to_core_conversion test for new ProximityIn/Out behaviourPeter Hutterer1-2/+8
Both types now return BadMatch. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-02test: add grab matching tests.Peter Hutterer1-0/+363
2009-06-01input: Add grabtype to GrabParameters.Peter Hutterer1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-01test: Add GetSelectedEvents request to struct size tests.Peter Hutterer1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-01test: fix compile error introduced with the removal of isMaster.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-16Update to new XI2 namesPeter Hutterer1-5/+5
2009-05-08Xi: Add XI2 property requests.Peter Hutterer1-0/+4
2009-05-06test: add test for xi2 struct sizes.Peter Hutterer1-0/+28
2009-05-01input: reshuffle CreateGrab and friends to take a GrabParameters param.Peter Hutterer1-0/+62
This is cleaning up work in preparation for XI2 passive grabs.
2009-04-28test: add InternalEvent to core event conversion tests.Peter Hutterer1-0/+144
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-28test: add a simple test to verify device axis intialization.Peter Hutterer2-2/+85
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-28Add a test-suite for in-server unit-testing.Peter Hutterer3-0/+248
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>