aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/test/input.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-06-11 14:16:16 +0000
committermarha <marha@users.sourceforge.net>2010-06-11 14:16:16 +0000
commitd1e4f4b8546c7955c66dd023bfd6ef437db9d21d (patch)
tree529985e77bfc95aa95fe5b540e8f42b0ef041206 /xorg-server/test/input.c
parent13919cf85a6ca41d97238de13344aba59e0f7680 (diff)
parent4c61bf84b11e26e6f22648668c95ea760a379163 (diff)
downloadvcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.tar.gz
vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.tar.bz2
vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/test/input.c')
-rw-r--r--xorg-server/test/input.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/xorg-server/test/input.c b/xorg-server/test/input.c
index 1271ee683..42435a9db 100644
--- a/xorg-server/test/input.c
+++ b/xorg-server/test/input.c
@@ -801,14 +801,34 @@ static void cmp_attr_fields(InputAttributes *attr1,
} else
g_assert(attr2->device == NULL);
+ if (attr1->pnp_id != NULL)
+ {
+ g_assert(attr1->pnp_id != attr2->pnp_id);
+ g_assert(strcmp(attr1->pnp_id, attr2->pnp_id) == 0);
+ } else
+ g_assert(attr2->pnp_id == NULL);
+
+ if (attr1->usb_id != NULL)
+ {
+ g_assert(attr1->usb_id != attr2->usb_id);
+ g_assert(strcmp(attr1->usb_id, attr2->usb_id) == 0);
+ } else
+ g_assert(attr2->usb_id == NULL);
+
tags1 = attr1->tags;
tags2 = attr2->tags;
+
+ /* if we don't have any tags, skip the tag checking bits */
if (!tags1)
{
g_assert(!tags2);
return;
}
+ /* Don't lug around empty arrays */
+ g_assert(*tags1);
+ g_assert(*tags2);
+
/* check for identical content, but duplicated */
while (*tags1)
{
@@ -818,6 +838,7 @@ static void cmp_attr_fields(InputAttributes *attr1,
tags2++;
}
+ /* ensure tags1 and tags2 have the same no of elements */
g_assert(!*tags2);
/* check for not sharing memory */
@@ -842,7 +863,7 @@ static void dix_input_attributes(void)
g_assert(!new);
new = DuplicateInputAttributes(&orig);
- g_assert(memcpy(&orig, new, sizeof(InputAttributes)));
+ g_assert(memcmp(&orig, new, sizeof(InputAttributes)) == 0);
orig.product = "product name";
new = DuplicateInputAttributes(&orig);
@@ -859,6 +880,16 @@ static void dix_input_attributes(void)
cmp_attr_fields(&orig, new);
FreeInputAttributes(new);
+ orig.pnp_id = "PnPID";
+ new = DuplicateInputAttributes(&orig);
+ cmp_attr_fields(&orig, new);
+ FreeInputAttributes(new);
+
+ orig.usb_id = "USBID";
+ new = DuplicateInputAttributes(&orig);
+ cmp_attr_fields(&orig, new);
+ FreeInputAttributes(new);
+
orig.flags = 0xF0;
new = DuplicateInputAttributes(&orig);
cmp_attr_fields(&orig, new);