Skip to content

Commit

Permalink
dinput/tests: Add guidType test for collection objects.
Browse files Browse the repository at this point in the history
(cherry picked from commit 4413356)
CW-Bug-Id: #22257
  • Loading branch information
w-flo authored and rbernon committed May 23, 2023
1 parent f458252 commit 87ca0c6
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion dlls/dinput/tests/joystick8.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,11 @@ static void test_simple_joystick( DWORD version )
REPORT_COUNT(1, 4),
INPUT(1, Data|Var|Abs),
END_COLLECTION,

USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC),
USAGE(1, HID_USAGE_GENERIC_RZ),
COLLECTION(1, Physical),
END_COLLECTION,
END_COLLECTION,
};
C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN);
Expand Down Expand Up @@ -632,6 +637,14 @@ static void test_simple_joystick( DWORD version )
.wUsagePage = HID_USAGE_PAGE_GENERIC,
.wUsage = HID_USAGE_GENERIC_JOYSTICK,
},
{
.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
.guidType = GUID_Unknown,
.dwType = DIDFT_COLLECTION|DIDFT_NODATA|DIDFT_MAKEINSTANCE(2),
.tszName = L"Collection 2 - Z Rotation",
.wUsagePage = HID_USAGE_PAGE_GENERIC,
.wUsage = HID_USAGE_GENERIC_RZ,
},
};
const DIDEVICEOBJECTINSTANCEW expect_objects_5[] =
{
Expand Down Expand Up @@ -717,6 +730,21 @@ static void test_simple_joystick( DWORD version )
.wReportId = 1,
},
};
struct check_object_todo todo_objects[ARRAY_SIZE(expect_objects)] =
{
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{ .guid = TRUE },
};
struct check_object_todo todo_objects_5[ARRAY_SIZE(expect_objects_5)] =
{
{.guid = TRUE, .type = TRUE, .flags = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
Expand All @@ -733,7 +761,7 @@ static void test_simple_joystick( DWORD version )
.version = version,
.expect_count = version < 0x700 ? ARRAY_SIZE(expect_objects_5) : ARRAY_SIZE(expect_objects),
.expect_objs = version < 0x700 ? expect_objects_5 : expect_objects,
.todo_objs = version < 0x700 ? todo_objects_5 : NULL,
.todo_objs = version < 0x700 ? todo_objects_5 : todo_objects,
.todo_extra = version < 0x700,
};

Expand Down

0 comments on commit 87ca0c6

Please sign in to comment.