summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2012-12-17barriers: Support line and ray barriersJasper St. Pierre1-0/+26
This allows clients to add barriers that extend to the edge of the screen. Clients are encouraged to use these instead of precise coordinates in these cases to help prevent pointer leaks. Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-12dix: split xi2_mask_isset into a per-device functionPeter Hutterer1-0/+6
For touch selection conflicts, we need to check not only if the mask is set for the device, but if it is set for only that specific device (regardless of XIAll*Devices) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-05Fix formatting of address operatorsYaakov Selkowitz4-9/+9
The formatter confused address operators preceded by casts with bitwise-and expressions, placing spaces on either side of both. That syntax isn't used by ordinary address operators, however, so fix them for consistency. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-19input: drop FP1616 macroPeter Hutterer1-2/+2
The double_to_f1616() functions do the same thing, and they're tested. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-09-05Merge remote-tracking branch 'jeremyhu/master'Keith Packard1-2/+2
2012-08-29tests: move GCC diagnostics pragma outside of functionPeter Hutterer1-2/+2
This is a a gcc 4.6+ feature. signal-logging.c:210: error: #pragma GCC diagnostic not allowed inside functions 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>
2012-08-28test/list: Fix test_xorg_list_del testJeremy Huddleston Sequoia1-2/+2
We never use child[2], so it's state is undefined. This issue seems to have existed since the test was first written: 92788e677be79bd04e5ef140f4ced50ad8b1bf8e Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-08-27test: Make os test more compliantJeremy Huddleston Sequoia1-1/+1
sighandler_t is not UNIX. Regression from: 7f09126e068015db54c56bb982b8f91065375700 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-08-21os: add support for %d and %i to pnprintfPeter Hutterer1-0/+21
The mouse driver uses %i in some debug messages Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-21Add FormatInt64 to convert signed integers in signal-safe mannerPeter Hutterer1-3/+77
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-21test: add a few tests for signal-safe loggingPeter Hutterer1-0/+101
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-21test: assert from signal-safe number conversionPeter Hutterer1-6/+4
Throw an assert when the conversion fails instead of just returning. Asserts are more informative. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-07os: don't unconditionally unblock SIGIO in OsReleaseSignals()Peter Hutterer1-0/+36
Calling OsReleaseSignal() inside the signal handler releases SIGIO, causing the signal handler to be called again from within the handler. Practical use-case: when synaptics calls TimerSet in the signal handler, this causes the signals to be released, eventually hanging the server. Regression introduced in 08962951de. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-08-05test: always add DIX_LIB and OS_LIB on XORG buildsPeter Hutterer1-2/+0
With --disable-xorg, We also disabled a bunch of tests because of their perceived reliance on a DDX. The cause was libtool missing some object files that never ended up in libxservertest.la. Only the xfree86 test has a true dependency on XORG. DIX_LIB was pointing to dix.O (instead of libdix.la) when DTRACE_SPECIAL_OBJECTS was defined. libdix.la should be part of XSERVER_LIBS but dix.O is not a recognised libtool object, so it got skipped for libxservertest.a. Only in the XORG case would we add DIX_LIB and OS_LIB manually, thus forcing linkage with the dtrace-generated objects. Fixing this by packaging up the dtrace-generated files as part of libdix.la/libos.la doesn't work for Solaris (and possible others), so simply always force linkage against the DIX_LIB/OS_LIB in the case of dtrace objects. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Tested-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-07-12xtest: add extinit.h for SyncExtensionInitDave Airlie1-0/+1
This adds the decl for SyncExtenionInit. Signed-off-by: Dave Airlie <airlied@redhat.com> Tested-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10AllocDevicePair: Ensure XKB privates are initialisedDaniel Stone1-2/+0
Since we call directly into XKB and may be doing so before the extension has been initialised, make sure its privates are set up first. XTest had a hack to do this itself, but seems cleaner to just make sure we do it in AllocDevicePair. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10Move DRI2 from external module to built-inDaniel Stone1-1/+6
Instead of keeping a tiny amount of code in an external module, just man up and build it into the core server. v2: Fix test/Makefile.am to only link libdri2.la if DRI2 is set Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10Move DRI1 from external module to built-inDaniel Stone1-1/+6
Rather than building the tiny amount of code required for XFree86-DRI as an external module, build it in if it's enabled at configure time. v2: Fix test/Makefile.am to only link libdri.la if DRI is set Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> fixup for DRI1 move Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09Replace padlength tables with inline functions from misc.hAlan Coopersmith1-2/+32
Adds new function padding_for_int32() and uses existing pad_to_int32() depending on required results. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-04Merge branch 'sigio-vt-switch-issues' into for-keithPeter Hutterer2-1/+132
Conflicts: test/Makefile.am Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-07-03os: add OsBlockSIGIO and OsReleaseSIGIOPeter Hutterer2-1/+132
Let the dix be in charge of changing the sigprocmask so we only have one entity that changes it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-07-02Merge branch 'sigsafe-logging-varargs'Keith Packard3-1/+118
This merge includes a minor fixup for '%p' arguments; must cast to uintptr_t instead of uint64_t as we use -Werror=pointer-to-int-cast which complains when doing a cast (even explicitly) from a pointer to an integer of different size.
2012-06-22AC_SUBST the GLX_SYS_LIBSPeter Hutterer2-2/+2
libxservertest needs -lpthread from glxapi.c's pthread_once() call. Usually this would be pulled in by the XORG_LIBS but not when building without Xorg. This commit has no visible effect on the current tree, preparation for test cleanups. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-06-22test/.gitignore: add hashtabletestSergei Trofimovich1-0/+1
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-06-21Add FormatUInt64{,Hex}() for formatting numbers in a signal safe mannerChase Douglas3-1/+118
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>
2012-06-05test/touch: Initialize device nameChase Douglas1-0/+5
Without this change, the test will segfault when we switch to signal- safe logging. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-16test: don't shadow parameter 'len'Peter Hutterer1-4/+3
protocol-xiquerydevice.c:226:25: warning: declaration of ‘len’ shadows a parameter [-Wshadow] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-16test: fix redundant declaration of "BadDevice"Peter Hutterer7-2/+6
In file included from protocol-common.c:36:0: protocol-common.h:36:12: warning: redundant redeclaration of ‘BadDevice’ [-Wredundant-decls] In file included from protocol-common.c:30:0: ../../Xi/exglobals.h:41:12: note: previous declaration of ‘BadDevice’ was here Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-16test: fix "userdata shadows global declaration" warningsPeter Hutterer4-14/+14
protocol-xiquerypointer.c:124:72: warning: declaration of ‘userdata’ shadows a global declaration [-Wshadow] and similar Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-16test: fix "redundant declaration of devices" warningPeter Hutterer1-1/+1
In file included from protocol-xiwarppointer.c:41:0: protocol-common.h:91:23: warning: redundant redeclaration of ‘devices’ [-Wredundant-decls] protocol-common.h:86:3: note: previous declaration of ‘devices’ was here Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-01xserver: Fix out-of-tree buildMichal Suchanek1-1/+1
Fixes regression caused by ccb3e78124fb05defd0c9b438746b79d84dfc3ae Signed-off-by: Michal Suchanek <hramrach@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-01Xi: return BadValue on XIQueryVersion if the version is less than first callPeter Hutterer1-0/+113
Clients that use plugin systems may require multiple calls to XIQueryVersion from different plugins. The current error handling requires client-side synchronisation of version numbers. The first call to XIQueryVersion defines the server behaviour. Once cached, always return that version number to any clients. Unless a client requests a version lower than the first defined one, then a BadValue must be returned to be protocol-compatible. Introduced in 2c23ef83b0e03e163aeeb06133538606886f4e9c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23test: Fix make distJeremy Huddleston1-2/+3
It seems like make dist should be doing te right thing without this commit, but it's not in some cases. Don't ask me to explain why. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-18Xext: add a generic hashtable implementationErkki Seppälä2-1/+164
The generic hashtable implementation adds a key-value container, that keeps the key and value inside the hashtable structure and manages their memory by itself. This data structure is best suited for fixed-length keys and values. One creates a new hash table with ht_create and disposes it with ht_destroy. ht_create accepts the key and value sizes (in bytes) in addition to the hashing and comparison functions to use. When adding keys with ht_add, they will be copied into the hash and a pointer to the value will be returned: data may be put into this structure (or if the hash table is to be used as a set, one can just not put anything in). The hash table comes also with one generic hashing function plus a comparison function to facilitate ease of use. It also has a custom hashing and comparison functions for hashing resource IDs with HashXID. Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
2012-03-29test: reset the client before checking the swapped versionPeter Hutterer1-0/+1
As of 2c23ef83b0e03e163aeeb06133538606886f4e9c, the server returns BadValue for the same client with multiple versions. Avoid this by resetting the client before we issue the same request as a fake swap client. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-29test: init the sync extensions for tests to pass againPeter Hutterer2-0/+27
Introduced in d645edd11e7482f98c8b7e0d6c8693285c484907 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-24os: Pass the FatalError message to OsVendorFatalErrorJeremy Huddleston1-1/+1
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-03-23test: Fix 'make dist' for configurations that build the Xorg DDXJeremy Huddleston1-0/+3
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-21Introduce a consistent coding styleKeith Packard23-1027/+1138
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-04test: add new test cases to .gitignoreGaetan Nadon2-0/+2
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>
2012-02-03Namespace list api to reduce conflicts with similar system headersAlan Coopersmith2-72/+72
Rename functions/macros from list_* to xorg_list_* Rename struct from struct list to struct xorg_list. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> In-sed-I-trust: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-15test: Fix linking issues when building unit tests without the Xorg DDXJeremy Huddleston2-4/+144
This allows unit tests to build and run successfully on darwin when only the Xvfb or XQuartz DDX is built. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-12-23test/xi2: Really fix infinite loop in test_convert_XITouchOwnershipEventChase Douglas1-1/+1
long i; for (i = 1; ; i <<= 1) if (i == (1 << 31)) break; (1 << 31) is compiled as an int, and thus is equal to -2147483648. We are trying to compare it against a long, which on 64-bit machines is 2147483648. This results in an infinite loop. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-22test/xi2: Fix infinite loop in test_convert_XITouchOwnershipEventKeith Packard1-1/+3
The touchid test was using a loop like: for(i = 1; i < 0xffffffff; i <<= 1) When 'i' is a 32-bit variable, this infinite loops as it goes from 0x80000000 to 0. 'i' is declared as 'long', which is 32-bit in 32-bit mode. Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-22test: fix grab mode value tests for new XIGrabModeTouchPeter Hutterer1-4/+13
This test checks that last-valid-mode + 1 returns a BadValue. With the addition of XIGrabModeTouch, that value has changed - sync it up again. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21test: add a basic test for ownership event valuesPeter Hutterer1-0/+94
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-21test: drop printfs from protocol-eventconvert.cPeter Hutterer1-8/+0
The test outputs are noisy enough, no need having these here too. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-20dix: add DIX API to create touchpointsPeter Hutterer1-0/+70
The DIX touchpoints are the ones used for event processing. Co-authored-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-20dix: if we run out of space for new touch events, resize the queuePeter Hutterer1-0/+51
The SIGIO handler forces us to drop the current touch and schedule the actual resize for later. Should not happen if the device sets up the TouchClassRec with the correct number of touchpoints. Co-authored-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-19dix: add helper functions to create DDX touch recsPeter Hutterer2-1/+151
DDX touch points are the ones that keep records of the driver-submitted touchpoints. They're unaffected by the grab state and terminate on a TouchEnd submitted by the driver. The client ID assigned is server-global. Since drivers usually submit in the SIGIO handler, we cannot allocate in the these functions. Co-authored-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>