aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/test/xi2
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-07-04 14:21:49 +0200
committermarha <marha@users.sourceforge.net>2011-07-04 14:21:49 +0200
commit5c671fd7f8198bed2fc32b33b81d1081f1486ed9 (patch)
tree96fc6a6d761473737def7c35256fed9bbe52753e /xorg-server/test/xi2
parentd9f970a847e1af706f07560ef163b229bb592307 (diff)
downloadvcxsrv-5c671fd7f8198bed2fc32b33b81d1081f1486ed9.tar.gz
vcxsrv-5c671fd7f8198bed2fc32b33b81d1081f1486ed9.tar.bz2
vcxsrv-5c671fd7f8198bed2fc32b33b81d1081f1486ed9.zip
xserver mesa git update 4 July 2011
Diffstat (limited to 'xorg-server/test/xi2')
-rw-r--r--xorg-server/test/xi2/protocol-eventconvert.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/xorg-server/test/xi2/protocol-eventconvert.c b/xorg-server/test/xi2/protocol-eventconvert.c
index edba974bf..6e61d74b4 100644
--- a/xorg-server/test/xi2/protocol-eventconvert.c
+++ b/xorg-server/test/xi2/protocol-eventconvert.c
@@ -70,6 +70,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
for (i = 0; out->valuators_len && i < sizeof(in->valuators.mask) * 8; i++)
{
+ if (i >= MAX_VALUATORS)
+ assert (!XIMaskIsSet(in->valuators.mask, i));
assert (XIMaskIsSet(in->valuators.mask, i) == XIMaskIsSet(ptr, i));
if (XIMaskIsSet(in->valuators.mask, i))
bits_set++;
@@ -238,7 +240,7 @@ static void test_convert_XIRawEvent(void)
test_XIRawEvent(&in);
printf("Testing valuator masks\n");
- for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+ for (i = 0; i < MAX_VALUATORS; i++)
{
XISetMask(in.valuators.mask, i);
test_XIRawEvent(&in);
@@ -257,7 +259,7 @@ static void test_convert_XIRawEvent(void)
XIClearMask(in.valuators.mask, i);
}
- for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+ for (i = 0; i < MAX_VALUATORS; i++)
{
XISetMask(in.valuators.mask, i);
test_XIRawEvent(&in);
@@ -354,7 +356,7 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
valuators = 0;
- for (i = 0; i < sizeof(in->valuators.mask) * 8; i++)
+ for (i = 0; i < MAX_VALUATORS; i++)
if (XIMaskIsSet(in->valuators.mask, i))
valuators++;
@@ -365,7 +367,9 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
for (i = 0; i < sizeof(in->valuators.mask) * 8 ||
i < (out->valuators_len * 4) * 8; i++)
{
- if (i > sizeof(in->valuators.mask) * 8)
+ if (i >= MAX_VALUATORS)
+ assert(!XIMaskIsSet(in->valuators.mask, i) && !XIMaskIsSet(ptr, i));
+ else if (i > sizeof(in->valuators.mask) * 8)
assert(!XIMaskIsSet(ptr, i));
else if (i > out->valuators_len * 4 * 8)
assert(!XIMaskIsSet(in->valuators.mask, i));
@@ -610,14 +614,14 @@ static void test_convert_XIDeviceEvent(void)
}
printf("Testing valuator masks\n");
- for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+ for (i = 0; i < MAX_VALUATORS; i++)
{
XISetMask(in.valuators.mask, i);
test_XIDeviceEvent(&in);
XIClearMask(in.valuators.mask, i);
}
- for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+ for (i = 0; i < MAX_VALUATORS; i++)
{
XISetMask(in.valuators.mask, i);
@@ -627,7 +631,7 @@ static void test_convert_XIDeviceEvent(void)
XIClearMask(in.valuators.mask, i);
}
- for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+ for (i = 0; i < MAX_VALUATORS; i++)
{
XISetMask(in.valuators.mask, i);
test_XIDeviceEvent(&in);