Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Linux test code fixed by: Keith Packard <keithp@keithp.com>
|
|
If configure is generated with xorg-macros 1.16.0 or newer, and
an appropriate memory checking library is found for the platform,
use it when running unit tests. If not, then no harm is done.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
If configure is generated with xorg-macros 1.16 or later, this allows
builders to --enable-unit-test and run the tests other than the xi2
tests which require ld -wrap (and are still wrapped in if HAVE_LD_WRAP
in tests/xi2/Makefile). If an older xorg-macros is used, the existing
behaviour is preserved of requiring ld -wrap for all unit tests, but
no side effects occur, so the minimum xorg-macros version is not raised.
If unit testing is enabled without ld -wrap, then we create a bogus
"xi2-tests" script just to report that we're skipping them.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
|
|
The patch below fixes a potential buffer overflow in xf86addComment().
This occurs if curlen > 0 && eol_seen == 0 && iscomment == 0 , as
follows from the code:
char *xf86addComment(char *cur, char *add)
<...>
len = strlen(add);
endnewline = add[len - 1] == '\n';
len += 1 + iscomment + (!hasnewline) + (!endnewline) + eol_seen;
if ((str = realloc(cur, len + curlen)) == NULL)
return cur;
cur = str;
if (eol_seen || (curlen && !hasnewline))
cur[curlen++] = '\n';
if (!iscomment)
cur[curlen++] = '#';
strcpy(cur + curlen, add);
if (!endnewline)
strcat(cur, "\n");
Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
[whot: added buffer overflow test case]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
And put a comment in to explain why we're testing for a frac between .3 and
.6. We can't directly compare the frac since the floating/fixed point
conversion loses precision.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
|
|
3304bbff9b4ed63f1a47410a5320a136420ba2c6 added smooth scrolling support for
pointer events and for XIQueryDevice but didn't add the matching parts to
XIDeviceChangedEvents.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
|
|
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
Using this call simplifies callers that don't know if the mask bit is set.
Before:
if (valuator_mask_isset(mask, valnum))
value = valuator_mask_get_double(mask, valnum));
else
value = someothervalue;
Now:
if (!valuator_mask_fetch_double(mask, valnum, &value))
value = someothervalue;
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
|
|
The test was memsetting the wrong thing, this fixes make check in my tinderbox.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Co-authored-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
|
|
For Zaphod mode screen crossing handling we need to know the size of all
screens together (i.e. the whole desktop size). Store that in the screenInfo to
have it readily available in events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
For scroll wheel support, we used to send buttons 4/5 and 6/7 for
horizontal/vertical positive/negative scroll events. For touchpads, we
really want more fine-grained scroll values. GetPointerEvents now
accepts both old-school scroll button presses, and new-style scroll axis
events, while emitting both types of events to support both old and new
clients.
This works with the new XIScrollClass to mark axes as scrolling axes.
Drivers mark any valuators that send scroll events with SetScrollValuator.
(Currently missing: the XIDeviceChangeEvent being sent when a driver changes
a scroll axis at run-time. This can be added later.)
Note: the SCROLL_TYPE enums are intentionally different values to the XI2
proto values to avoid copy/overlapping range bugs.
Co-authored-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
|
|
POINTER_EMULATED merely sets XIPointerEmulated in the generated
DeviceEvent.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Change the DeviceEvent InternalEvent to use doubles for its valuators,
instead of data and data_frac.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Change RawDeviceEvent to use doubles for valuators internally, rather
than data(_raw) and data(_raw)_frac.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Add API for valuator_mask that accepts and returns doubles, rather than
ints. No double API is provided for set_range at the moment.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Add a flags member which will be copied wholesale into the resultant
xXIRawEvent.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
|
|
In all cases, the pointer was simply type-cast anyway. Let's get some
compile-time type safety going, how about that.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Squashed in:
xfree86: Move definition of xf86OptionPtr into separate header file
The pile of spaghettis that is the xfree86 include dependencies make it
rather hard to have a single typedef somewhere that's not interfering with
everything else or drags in a whole bunch of other includes.
Move the xf86OptionRec and GenericListRec declarations into a separate
header.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Also, fix whitespace, mainly around
swaps(&rep.sequenceNumber)
Reviewed-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
|
|
InputOptions is not switched to use struct list for a future patch to unify
it with the XF86OptionRec.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
|
|
This is a set of macros to provide a struct list-alike interface for classic
linked lists such as the XF86OptionRec or the DeviceIntRec. The typical
format for these is to have a "struct foo *next" pointer in each struct foo
and walk through those. These macros provide a few basic functions to add to,
remove from and iterate through these lists.
While struct list is in some ways more flexible, switching legacy code to
use struct list is not alway viable. These macros at least reduce the amount
of open-coded lists.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Renesas SH is not aligned at size of double.
When structure has double value, It is aligned in 4byte (long).
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
GetMaster() currently requires an attached slave device as parameter,
resuling in many calls being IsFloating(dev) ? dev : GetMaster(...);
Add two new parameters so GetMaster can be called unconditionally to get the
right device.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
|
|
Previously, the input tests were working up to sizeof(mask) * 8, which
could be more than the arrays; the latter only being sized as
MAX_VALUATORS.
Hypothetically, if you were switching the stored valuator values to
double instead of uint32_t, and you attempted to set the 39th member of
a MAX_VALUATORS-sized (36) array, you'd probably end up smashing
ev->key_repeat into oblivion and then tripping the check for invalid
flags because you haven't yet put XIPointerEmulated into the valid flags
for XI_Motion. Probably.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Similar to how we link Xorg, make sure that whenever any of the
component libraries changes, we relink libxservertest and the tests.
Not much use testing anything other than the actual source in your tree.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
libxorg.la served to collect all the Xorg convenience libraries into one
massive archive to link into Xorg. This made things easy for symbol
resolution, but it tremendously slowed down the build since each change
caused libxorg.la to be rebuilt. This is an extremely slow process of
extracting all the objects from the sub-libraries and recombining them.
Instead, the archives are linked directly into Xorg. The order of the
libraries had to be tweaked a bit to make symbols resolve correctly with
the lower level code moving later in the link command.
As a side effect, since the dtrace objects are now being linked
directly into Xorg, we don't need the SPECIAL_DTRACE_OBJECTS hack to
add them twice.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
The symbols in sdksyms.c cover the entire source tree. In order to make
them resolve when libxorg.la goes away, move the objects from libloader
to Xorg. Unfortunately, this means sdksyms needs to get built again for
the test code.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
When an empty _SOURCES variable is declared, automake will recognize that
only linking is needed.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Refactor to follow the pattern one Makefile, one .gitignore
where needed.
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>
|
|
X.Org Bug 37801 <http://bugs.freedesktop.org/show_bug.cgi?id=37801>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
|
|
i386 is one of the few architectures that doesn't need double alignment.
X.Org Bug 36986 <http://bugs.freedesktop.org/show_bug.cgi?id=36986>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
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>
|
|
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>
|
|
Remove duplicated include.
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
|
|
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>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
|
|
commit 678f5396c91b3d0c7572ed579b0a4fb62b2b4655 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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
|