Commit Graph

34 Commits

Author SHA1 Message Date
Cyril Brulebois
c481dae0dc test: Fix missing xkbsrv.h include.
Otherwise, building fails with CFLAGS="-Wall -Werror" this way:
| protocol-common.c: In function ‘init_simple’:
| protocol-common.c:159: error: implicit declaration of function ‘XkbInitPrivates’
| protocol-common.c:159: error: nested extern declaration of ‘XkbInitPrivates’

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-12 11:49:21 +10:00
Keith Packard
8e97e5f942 If XTest is always required, then eliminate the XTest devPrivate
The internals of XTest are used by Xi and Xkb, and both Xi and Xkb are
always required, so it makes little sense to have XTest place data in
a devPrivate, especially a devPrivate which is only available when the
XTest extension is enabled.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-07 19:56:47 -07:00
Keith Packard
bc26665661 Initialize private keys in test suite
Make sure all of the private keys used by the test code are
initialized before being used.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Robert Hooker <sarvatt@ubuntu.com>
2010-06-06 21:24:04 -07:00
Jamey Sharp
c6613cfc26 test/xi2: Initialize predefined atoms before XInputExtensionInit.
XInputExtensionInit calls MakeAtom, which doesn't work without the atoms
table initialized.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-14 17:33:50 -07:00
Mikhail Gusarov
3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Keith Packard
a974c8e7cb Merge remote branch 'whot/for-keith' 2010-04-30 12:33:00 -07:00
Rami Ylimäki
262c2c9031 test: Fix linking of wrapped functions in XI2 tests.
Running "make check" will lead to build problems in
scratchbox. Building the first test that wraps dixLookupWindow fails
because symbol __real_dixLookupWindow can't be resolved. Defining
wrapping options as linker options instead of compiler options makes
everything build nicely in scratchbox.

Signed-off-by: Rami Ylimäki <ext-rami.ylimaki@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-28 15:42:43 +10:00
Tiago Vignatti
4f8dc1109d dix and others: remove unused arraySize field from ScreenInfo
Bizarre. This seems to never be used before. I left the field in ScreenInfo,
with another name. So, stop looking at it.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-04-26 14:35:27 +03: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
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
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
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