summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2013-08-13test/xi2: fix protocol-xiqueryversion testMaarten Lankhorst1-30/+30
The old code was broken and allowed setting client version >= XIVersion, this was fixed in the previous patch, but updating the value for XIVersion broke the tests, so fix the tests too. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit b6e5c4669e0db391966deb397e8c975ec7f0124d)
2013-08-13Revert "test: fix XIQueryVersion check for new behaviour"Peter Hutterer1-9/+3
This reverts commit cdcb708678c4785cd7b026b90e316691176e5244.
2013-07-30test: fix XIQueryVersion check for new behaviourPeter Hutterer1-3/+9
As of 4360514d1cc8e3132f93f56172d291074e8c770f, XIQueryVersion supports requesting versions 2.2+ in random order, only 2.0 and 2.1 are restricted. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit a5abf790183798ad8aa2c29c056df3647777cfbd)
2013-05-14os: complain about unsupported pnprintf directivesPeter Hutterer1-0/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> (cherry picked from commit d9848fb4b182ca21bacf28ed7410d1a502cb000e)
2013-05-14os: support %c in pnprintfPeter Hutterer1-0/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> (cherry picked from commit d903d17d7f006fa333265b8476063b189c20d082)
2013-05-14os: support %% in pnprintfPeter Hutterer1-0/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 58ef34ee6d0f68aa28f6f1a26e56f49ec85ed9bf)
2013-05-14os: support pnprintf length modifiers for integersPeter Hutterer1-9/+69
Mainly for %ld, smaller than int is propagated anyway, and %lld isn't really used. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 5ea21560dd071ea4ab87430000d087fd5fe1f092)
2013-02-14os: fix pnprintf OOB buffer read for unterminated length modifiersPeter Hutterer1-0/+8
Format strings with length modifiers but missing format specifier like "%0" will read one byte past the array size. 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>
2013-01-17os: add support for %f to pnprintfPeter Hutterer1-0/+56
This is the lazy man's %f support. Print the decimal part of the number, then append a decimal point, then print the first two digits of the fractional part. So %f in sigsafe printing is really %.2f. No boundary checks in place here. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2013-01-17test/signal-logging: simplify tests using sprintfPeter Hutterer1-102/+42
Ever looked at your own code and thought 'WTF was I thinking?'. yeah, that. Instead of passing in the expected string just use sprintf to print the number for us and compare. In the end we're just trying to emulate printf behaviour anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-12-21test/xi2: fix compiler warningPeter Hutterer1-1/+1
protocol-xiwarppointer.c: In function ‘ScreenSetCursorPosition’: protocol-xiwarppointer.c:71:53: warning: declaration of ‘screen’ shadows a global declaration [-Wshadow] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-19Merge remote-tracking branch 'yselkowitz/master'Keith Packard4-9/+9
I checked this patch with diff -w to check that it only affected whitespace.
2012-12-19Merge remote-tracking branch 'whot/barriers'Keith Packard2-0/+242
Conflicts: Xi/xichangehierarchy.c Small conflict with the patch from Xi: don't use devices after removing them Was easily resolved by hand. Signed-off-by: Keith Packard <keithp@keithp.com>
2012-12-17tests/xi2: at protocol conversion test for barrier eventsPeter Hutterer1-0/+216
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
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>