[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'ubuntu+1'



 debian/changelog                    |    7 +
 debian/patches/series               |    2 
 debian/patches/xi2-fixup-test.patch |  212 ++++++++++++++++++++++++++++++++++++
 3 files changed, 220 insertions(+), 1 deletion(-)

New commits:
commit 4c9d1e81a8cd7f6471fecc4a31b5dcc6f8f16de9
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Tue Jul 30 15:39:23 2013 +0200

    Add patch to fixup xi2 tests.
    
    xi2-fixup-test.patch

diff --git a/debian/changelog b/debian/changelog
index 546c009..00cae20 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xorg-server (2:1.14.99.1-0ubuntu0.0~ppa6) saucy; urgency=low
+
+  * Add patch to fixup xi2 tests.
+    - xi2-fixup-test.patch
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Tue, 30 Jul 2013 15:38:33 +0200
+
 xorg-server (2:1.14.99.1-0ubuntu0.0~ppa5) saucy; urgency=low
 
   * Retry, pick up aarch64 fix, fixup patch.
diff --git a/debian/patches/series b/debian/patches/series
index 2f6a0dc..2a72c8b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -48,5 +48,5 @@ xf86-fixup-detection.patch
 xf86-inactive-gpuscreen.patch
 228_autobind_gpu.patch
 xf86-add--gpu-switch.patch
-
+xi2-fixup-test.patch
 aarch64.patch
diff --git a/debian/patches/xi2-fixup-test.patch b/debian/patches/xi2-fixup-test.patch
new file mode 100644
index 0000000..6e7494a
--- /dev/null
+++ b/debian/patches/xi2-fixup-test.patch
@@ -0,0 +1,212 @@
+diff --git a/Xi/xiqueryversion.c b/Xi/xiqueryversion.c
+index 6c7b9c0..cd23690 100644
+--- a/Xi/xiqueryversion.c
++++ b/Xi/xiqueryversion.c
+@@ -70,12 +70,21 @@ ProcXIQueryVersion(ClientPtr client)
+ 
+     pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
+ 
++    if (version_compare(XIVersion.major_version, XIVersion.minor_version,
++                stuff->major_version, stuff->minor_version) > 0) {
++        major = stuff->major_version;
++        minor = stuff->minor_version;
++    } else {
++        major = XIVersion.major_version;
++        minor = XIVersion.minor_version;
++    }
++
+     if (pXIClient->major_version) {
+ 
+         /* Check to see if the client has only ever asked
+          * for version 2.2 or higher
+          */
+-        if (version_compare(stuff->major_version, stuff->minor_version, 2, 2) >= 0 &&
++        if (version_compare(major, minor, 2, 2) >= 0 &&
+             version_compare(pXIClient->major_version, pXIClient->minor_version, 2, 2) >= 0)
+         {
+ 
+@@ -84,35 +93,23 @@ ProcXIQueryVersion(ClientPtr client)
+              * version to the client but leave the server internal
+              * version set to the highest requested value
+              */
+-            major = stuff->major_version;
+-            minor = stuff->minor_version;
+-            if (version_compare(stuff->major_version, stuff->minor_version,
++            if (version_compare(major, minor,
+                                 pXIClient->major_version, pXIClient->minor_version) > 0)
+             {
+-                pXIClient->major_version = stuff->major_version;
+-                pXIClient->minor_version = stuff->minor_version;
++                pXIClient->major_version = major;
++                pXIClient->minor_version = minor;
+             }
+         } else {
+-            if (version_compare(stuff->major_version, stuff->minor_version,
++            if (version_compare(major, minor,
+                                 pXIClient->major_version, pXIClient->minor_version) < 0) {
+ 
+-                client->errorValue = stuff->major_version;
++                client->errorValue = major;
+                 return BadValue;
+             }
+             major = pXIClient->major_version;
+             minor = pXIClient->minor_version;
+         }
+     } else {
+-        if (version_compare(XIVersion.major_version, XIVersion.minor_version,
+-                    stuff->major_version, stuff->minor_version) > 0) {
+-            major = stuff->major_version;
+-            minor = stuff->minor_version;
+-        }
+-        else {
+-            major = XIVersion.major_version;
+-            minor = XIVersion.minor_version;
+-        }
+-
+         pXIClient->major_version = major;
+         pXIClient->minor_version = minor;
+     }
+diff --git a/test/xi2/protocol-xiqueryversion.c b/test/xi2/protocol-xiqueryversion.c
+index aff0237..ed75c89 100644
+--- a/test/xi2/protocol-xiqueryversion.c
++++ b/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);


Reply to: