Commit Graph

241 Commits

Author SHA1 Message Date
Adam Jackson
d45f5b2493 fixes: Add support for pointer barriers
Implements pointer barriers as specified by version 5 of the XFIXES
protocol. Barriers are axis-aligned, zero-width lines that block pointer
movement for relative input devices. Barriers may block motion in either
the positive or negative direction, or both.

v3:
- Fix off-by-one in version_requests array
- Port to non-glib test harness
- Fix review notes from Søren Sandmann Pedersen, add tests to match

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-31 15:10:51 -04:00
Peter Hutterer
ffd4874798 include: add version_compare helper function
Compare two version numbers in the major.minor form.
Switch the few users of manual version switching over to the new function.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-05-13 09:41:50 +10:00
Nicolas Kaiser
79b3a7f83d test/xi2: remove duplicated include
Remove duplicated include.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-04-25 10:45:34 -07:00
Peter Hutterer
196d679bed test: remove glib dependency
The few features from the glib test suite we used can be replaced with
assert and printf. This patch is a simple replacement for these two
    g_assert → assert
    g_test_message → printf

g_test_init is removed and so is g_test_bug_base. g_test_run replaced with a
simple return 0.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Acked-by: Gaetan Nadon <memsize@videotron.ca>
2011-04-21 13:43:43 +10:00
Peter Hutterer
91a735328c test: add some XIPassiveGrab protocol testing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18 13:05:04 +10:00
Peter Hutterer
419a27b521 Xi: fix valuator alignment in DeepCopyDeviceClasses (#36119)
commit 678f5396c9 only fixed the
initialization, not the copy. After a slave device change, the valuator
were out of alignment again.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-18 13:04:19 +10:00
Peter Hutterer
33e257ab43 test: when unit tests are enabled, build them during "make"
Catch compiler errors that were otherwise only spotted on make check.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-03-24 09:52:04 +10:00
Gaetan Nadon
efcb7275ce test: git ignore the list test executable
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-03-18 11:36:34 -07:00
Gaetan Nadon
6a5bf15fa9 Add generalized unit test support using util-macros.
A handful of modules have begun adding unit test programs.
These macros will help providing a consistent interface which will
help package builders and developers to manage the functionality.

XORG_ENABLE_UNIT_TESTS will turn on/off unit testing, regardless
of how it is implemented. The default (yes/no) can be specified by each
module. It can be used by itself if glib or -wrap support is not needed.

XORG_WITH_GLIB will probe the system for glib-2.0. A different version
can be specified in each module. It will consult XORG_ENABLE_UNIT_TESTS
but can be used by itself in contexts other then unit testing.
The default (yes/no) can be specified by each module.

XORG_LD_WRAP will probe the linker for -wrap support. It will consult
XORG_ENABLE_UNIT_TESTS but can be used by itself in contexts
other then unit testing.

configure options:
  --enable-unit-tests     Enable building unit test cases (default: auto)
  --with-glib             Use GLib library for unit testing (default: auto)

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-03-18 11:36:19 -07:00
Peter Hutterer
92788e677b test: add some tests for basic list manipulation.
This has less purpose as a test but more as documentation on how to actually
use the differnent list calls.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-14 13:25:06 -04:00
Peter Hutterer
579ee8f5d8 Merge branch 'mi-cleanup' into next 2011-02-23 08:44:42 +10:00
Peter Hutterer
17265ccb02 Move master/lastSlave out of the union into separate fields.
The removal of the double-use will cause some suble bugs as some conditions
to check for the dev->u.master case were broken and also evaluated as true
if lastSlave was set (instead of master).

Also breaks the input ABI.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:45 +10:00
Peter Hutterer
93a7399370 test: write some event → XI1 conversion tests.
Don't test everything, but hey, life is short and I'm trying to have one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-02-22 08:08:55 +10:00
Daniel Stone
46b4979601 Input: Allow EventToCore to return multiple events
Some event types (notably Expose and GraphicsExpose) require multiple
events, a la XI 1.x.  Bring the EventToCore API in line with EventToXI's
and allow it to generate multiple events.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-17 09:40:59 +10:00
Peter Hutterer
8456625d64 Merge branch 'for-peter' of git://people.freedesktop.org/~daniels/xserver into for-keith 2011-01-07 09:35:07 +10:00
Peter Hutterer
fc6cbee772 input: add valuator_mask_free() to free a valuator mask.
Expecting the caller to free the mask requires us to keep it in a single
memory block (which may be an issue lateron), aside from leaving the API
asymetrical. Provide valuator_mask_free() to free the memory and reset the
mask pointer to NULL.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-01-07 08:28:27 +10:00
Daniel Stone
06a103ad1d Test: Input: Test up to supported server, not protocol, events
When building against a newer inputproto, the server may support fewer
than XI_LASTEVENT events.  We already have XI2LASTEVENT for the highest
event number supported by the server, so use that instead.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-01-06 17:10:28 +00:00
Daniel Stone
a083efe871 Test: Input: Check flags on DeviceEvent
Add initial validation of acceptable flags for XI2 device events, and
make sure they're swapped.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-01-06 17:10:25 +00:00
Daniel Stone
2592effef5 Test: Input: Add helper function for failing EventToCore
We have quite a few tests which involve checking that EventToCore fails
for specific events, so refactor them into a separate function.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-01-06 17:10:21 +00:00
Peter Hutterer
42dc91e32a include: let BitIsOn() return a boolean value.
Simply returning the mask bit breaks checks like
    BitIsOn(mask, 0) != BitIsOn(mask, 1);
as used in 048e93593e.

The naming of this macro suggests that it should return boolean values
anyway. This patch also adds a few simple tests for these macros to make
sure they don't accidentally break in the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pat Kane <pekane52@gmail.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-11-26 09:59:24 +10:00
Peter Hutterer
d435e1ecb8 test: reduce range of byte-padding macro tests.
Byte padding and conversion is interesting for the rage of 0-8 bytes, and
then interesting towards the end of the valid range (INT_MAX - 7 and INT_MAX
- 3).

Note: this changes the upper range for pad_to_int32() and bytes_to_int32()
from the previous (INT_MAX - 4) to (INT_MAX - 3).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-11-24 08:47:00 +10:00
Peter Hutterer
f49ee9074a test: compare byte padding macros against the expected bytes.
We calculate the expected bytes for each value, let's use it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-11-24 08:47:00 +10:00
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
Peter Hutterer
88cb61e1e5 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-api
Conflicts:
	dix/getevents.c
	hw/xfree86/common/xf86Xinput.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11 12:54:46 +10:00
Peter Hutterer
4613ce3f78 test: valuator_mode tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-25 10:37:52 +10:00
Peter Hutterer
dd11f734a9 input: remove "mode" field from ValuatorClassRec.
We have per-axis mode now. For those bits that still need it (XI 1.x),
assume that the first axis holds the device's mode.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 16:19:00 +10:00
Chase Douglas
290af0418f test: input - set valuators mask for event to core conversion
Commit de8be07cc0 adds a requirement to
event to core conversion that at least one of the X or Y valuators are
set in the valuator mask. This commit fixes the event conversion test to
be compliant.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-10-22 13:36:10 +10:00
Peter Hutterer
9696c782c8 test: valuator_mask tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 11:02:53 +10:00
Jeremy Huddleston
23229c7ce5 test: Fix make distcheck when not building unit tests
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-10-13 19:27:18 -07:00
Dan Nicholson
87a1507da7 xfree86: Match devices based on USB ID
Sometimes the vendor and product names aren't specific enough to target
a USB device, so expose the numeric codes in the ID. A MatchUSBID entry
has been added that supports shell pattern matching when fnmatch(3) is
available. For example:

	MatchUSBID "046d:*"

The IDs are stored in lowercase hex separated by a ':' like "lsusb" or
"lspci -n".

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-11 09:30:33 +10:00
Dan Nicholson
645679c152 xfree86: Match devices based on PnP ID
Serial input devices lack properties such as product or vendor name. This
makes matching InputClass sections difficult. Add a MatchPnPID entry to
test against the PnP ID of the device. The entry supports a shell pattern
match on platforms that support fnmatch(3). For example:

	MatchPnPID "WACf*"

A match type for non-path pattern matching, match_pattern, has been added.
The difference between this and match_path_pattern is the FNM_PATHNAME
flag in fnmatch(3).

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-11 09:30:07 +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
Peter Hutterer
151659f963 test: fix up InputAttributes helper function test.
Just some extra clarification as pointed out by Dan Nicholson,
and that memcpy should have been a memcmp.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-05-28 16:49:30 +10:00
Jamey Sharp
7045486491 Ignore build products in the server's test suite.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-26 11:17:53 -07:00
Peter Hutterer
86303a338a dix: add helper functions to duplicate and free InputAttributes.
No special memory handling is used to give drivers the maximum flexibility
with the data. Drivers should be able to call realloc on the product string
if needed and perform similar operations.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-25 10:06:11 -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
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