aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/test
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-08-01 13:22:08 +0200
committermarha <marha@users.sourceforge.net>2013-08-01 13:22:08 +0200
commit0659c77949b38440a2a9ba67e1ee9cacef1f3a7f (patch)
tree891077ab7001a45e0e37ff2e554db0c56671acdc /xorg-server/test
parent4c8cee9b5a37db30af50aafcbf54b36b9fd9e03a (diff)
downloadvcxsrv-0659c77949b38440a2a9ba67e1ee9cacef1f3a7f.tar.gz
vcxsrv-0659c77949b38440a2a9ba67e1ee9cacef1f3a7f.tar.bz2
vcxsrv-0659c77949b38440a2a9ba67e1ee9cacef1f3a7f.zip
libX11 mesa xserver xkeyboard-config git update 1 aug 2013
xserver commit b6e5c4669e0db391966deb397e8c975ec7f0124d xkeyboard-config commit abaf14335dc6504e59d91e77babc8e034df5beb7 libX11 commit 44f84223f5e2dd46883fcbd352af2798bfa9aeb6 mesa commit 3eef7fec677f40eef1674e44e7ebd836bc7f8612
Diffstat (limited to 'xorg-server/test')
-rw-r--r--xorg-server/test/xi2/protocol-xiqueryversion.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/xorg-server/test/xi2/protocol-xiqueryversion.c b/xorg-server/test/xi2/protocol-xiqueryversion.c
index aff023754..ed75c89db 100644
--- a/xorg-server/test/xi2/protocol-xiqueryversion.c
+++ b/xorg-server/test/xi2/protocol-xiqueryversion.c
@@ -44,8 +44,8 @@
#include "extinit.h" /* for XInputExtensionInit */
#include "scrnintstr.h"
#include "xiqueryversion.h"
-
#include "protocol-common.h"
+#include "exglobals.h"
extern XExtensionVersion XIVersion;
@@ -54,8 +54,8 @@ struct test_data {
int minor_client;
int major_server;
int minor_server;
- int major_cached;
- int minor_cached;
+ int major_expected;
+ int minor_expected;
};
static void
@@ -93,13 +93,8 @@ reply_XIQueryVersion_multiple(ClientPtr client, int len, char *data, void *closu
reply_check_defaults(rep, len, XIQueryVersion);
assert(rep->length == 0);
- if (versions->major_cached == -1) {
- versions->major_cached = rep->major_version;
- versions->minor_cached = rep->minor_version;
- }
-
- assert(versions->major_cached == rep->major_version);
- assert(versions->minor_cached == rep->minor_version);
+ assert(versions->major_expected == rep->major_version);
+ assert(versions->minor_expected == rep->minor_version);
}
/**
@@ -199,6 +194,7 @@ test_XIQueryVersion_multiple(void)
{
xXIQueryVersionReq request;
ClientRec client;
+ XIClientPtr pXIClient;
struct test_data versions;
int rc;
@@ -213,28 +209,26 @@ test_XIQueryVersion_multiple(void)
userdata = (void *) &versions;
/* run 1 */
- versions.major_cached = -1;
- versions.minor_cached = -1;
- /* client is lower than server, noncached */
- request.major_version = 2;
- request.minor_version = 1;
+ /* client is lower than server, nonexpected */
+ versions.major_expected = request.major_version = 2;
+ versions.minor_expected = request.minor_version = 1;
rc = ProcXIQueryVersion(&client);
assert(rc == Success);
- /* client is higher than server, cached */
+ /* client is higher than server, no change */
request.major_version = 2;
request.minor_version = 3;
rc = ProcXIQueryVersion(&client);
assert(rc == Success);
- /* client is equal, cached */
+ /* client tries to set higher version, stays same */
request.major_version = 2;
request.minor_version = 2;
rc = ProcXIQueryVersion(&client);
assert(rc == Success);
- /* client is low than cached */
+ /* client tries to set lower version, no change */
request.major_version = 2;
request.minor_version = 0;
rc = ProcXIQueryVersion(&client);
@@ -243,20 +237,24 @@ test_XIQueryVersion_multiple(void)
/* run 2 */
client = init_client(request.length, &request);
XIVersion.major_version = 2;
- XIVersion.minor_version = 2;
- versions.major_cached = -1;
- versions.minor_cached = -1;
+ XIVersion.minor_version = 3;
- request.major_version = 2;
- request.minor_version = 2;
+ versions.major_expected = request.major_version = 2;
+ versions.minor_expected = request.minor_version = 2;
rc = ProcXIQueryVersion(&client);
assert(rc == Success);
+ /* client bumps version from 2.2 to 2.3 */
request.major_version = 2;
- request.minor_version = 3;
+ versions.minor_expected = request.minor_version = 3;
rc = ProcXIQueryVersion(&client);
assert(rc == Success);
+ /* real version is changed, too! */
+ pXIClient = dixLookupPrivate(&client.devPrivates, XIClientPrivateKey);
+ assert(pXIClient->minor_version == 3);
+
+ /* client tries to set lower version, no change */
request.major_version = 2;
request.minor_version = 1;
rc = ProcXIQueryVersion(&client);
@@ -265,20 +263,22 @@ test_XIQueryVersion_multiple(void)
/* run 3 */
client = init_client(request.length, &request);
XIVersion.major_version = 2;
- XIVersion.minor_version = 2;
- versions.major_cached = -1;
- versions.minor_cached = -1;
+ XIVersion.minor_version = 3;
- request.major_version = 2;
- request.minor_version = 3;
+ versions.major_expected = request.major_version = 2;
+ versions.minor_expected = request.minor_version = 3;
rc = ProcXIQueryVersion(&client);
assert(rc == Success);
request.major_version = 2;
- request.minor_version = 2;
+ versions.minor_expected = request.minor_version = 2;
rc = ProcXIQueryVersion(&client);
assert(rc == Success);
+ /* but real client version must not be lowered */
+ pXIClient = dixLookupPrivate(&client.devPrivates, XIClientPrivateKey);
+ assert(pXIClient->minor_version == 3);
+
request.major_version = 2;
request.minor_version = 1;
rc = ProcXIQueryVersion(&client);