Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
76cbd21c
Commit
76cbd21c
authored
Feb 21, 2019
by
Sven Baars
Committed by
Alexandre Julliard
Feb 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput8/tests: Fix some memory leaks (Valgrind).
Signed-off-by:
Sven Baars
<
sven.wine@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4bca67bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
device.c
dlls/dinput8/tests/device.c
+16
-1
No files found.
dlls/dinput8/tests/device.c
View file @
76cbd21c
...
@@ -281,6 +281,8 @@ static BOOL CALLBACK enumeration_callback(const DIDEVICEINSTANCEA *lpddi, IDirec
...
@@ -281,6 +281,8 @@ static BOOL CALLBACK enumeration_callback(const DIDEVICEINSTANCEA *lpddi, IDirec
hr
=
IDirectInputDevice8_SetActionMap
(
lpdid
,
data
->
lpdiaf
,
NULL
,
0
);
hr
=
IDirectInputDevice8_SetActionMap
(
lpdid
,
data
->
lpdiaf
,
NULL
,
0
);
ok
(
hr
==
DIERR_ACQUIRED
,
"SetActionMap succeeded with an acquired device hr=%08x
\n
"
,
hr
);
ok
(
hr
==
DIERR_ACQUIRED
,
"SetActionMap succeeded with an acquired device hr=%08x
\n
"
,
hr
);
IDirectInputDevice_Release
(
lpdid2
);
return
DIENUM_CONTINUE
;
return
DIENUM_CONTINUE
;
}
}
...
@@ -329,6 +331,12 @@ static void test_action_mapping(void)
...
@@ -329,6 +331,12 @@ static void test_action_mapping(void)
hr
=
IDirectInput8_EnumDevicesBySemantics
(
pDI
,
0
,
&
af
,
enumeration_callback
,
&
data
,
DIEDBSFL_ATTACHEDONLY
);
hr
=
IDirectInput8_EnumDevicesBySemantics
(
pDI
,
0
,
&
af
,
enumeration_callback
,
&
data
,
DIEDBSFL_ATTACHEDONLY
);
ok
(
SUCCEEDED
(
hr
),
"EnumDevicesBySemantics failed: hr=%08x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"EnumDevicesBySemantics failed: hr=%08x
\n
"
,
hr
);
if
(
data
.
keyboard
)
IDirectInputDevice_Release
(
data
.
keyboard
);
if
(
data
.
mouse
)
IDirectInputDevice_Release
(
data
.
mouse
);
/* Repeat tests with a non NULL user */
/* Repeat tests with a non NULL user */
data
.
username
=
"Ninja Brian"
;
data
.
username
=
"Ninja Brian"
;
hr
=
IDirectInput8_EnumDevicesBySemantics
(
pDI
,
NULL
,
&
af
,
enumeration_callback
,
&
data
,
DIEDBSFL_ATTACHEDONLY
);
hr
=
IDirectInput8_EnumDevicesBySemantics
(
pDI
,
NULL
,
&
af
,
enumeration_callback
,
&
data
,
DIEDBSFL_ATTACHEDONLY
);
...
@@ -383,6 +391,8 @@ static void test_action_mapping(void)
...
@@ -383,6 +391,8 @@ static void test_action_mapping(void)
hr
=
IDirectInputDevice_GetProperty
(
data
.
keyboard
,
DIPROP_USERNAME
,
&
dps
.
diph
);
hr
=
IDirectInputDevice_GetProperty
(
data
.
keyboard
,
DIPROP_USERNAME
,
&
dps
.
diph
);
ok
(
SUCCEEDED
(
hr
),
"GetProperty failed hr=%08x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"GetProperty failed hr=%08x
\n
"
,
hr
);
ok
(
dps
.
wsz
[
0
]
==
0
,
"Expected empty username, got=%s
\n
"
,
wine_dbgstr_w
(
dps
.
wsz
));
ok
(
dps
.
wsz
[
0
]
==
0
,
"Expected empty username, got=%s
\n
"
,
wine_dbgstr_w
(
dps
.
wsz
));
IDirectInputDevice_Release
(
data
.
keyboard
);
}
}
if
(
data
.
mouse
!=
NULL
)
if
(
data
.
mouse
!=
NULL
)
...
@@ -392,9 +402,12 @@ static void test_action_mapping(void)
...
@@ -392,9 +402,12 @@ static void test_action_mapping(void)
test_build_action_map
(
data
.
mouse
,
data
.
lpdiaf
,
DITEST_YAXIS
,
DIDFT_RELAXIS
,
0x01
);
test_build_action_map
(
data
.
mouse
,
data
.
lpdiaf
,
DITEST_YAXIS
,
DIDFT_RELAXIS
,
0x01
);
test_device_input
(
data
.
mouse
,
INPUT_MOUSE
,
MOUSEEVENTF_LEFTDOWN
,
3
);
test_device_input
(
data
.
mouse
,
INPUT_MOUSE
,
MOUSEEVENTF_LEFTDOWN
,
3
);
IDirectInputDevice_Release
(
data
.
mouse
);
}
}
DestroyWindow
(
hwnd
);
DestroyWindow
(
hwnd
);
IDirectInput_Release
(
pDI
);
}
}
static
void
test_save_settings
(
void
)
static
void
test_save_settings
(
void
)
...
@@ -458,7 +471,6 @@ static void test_save_settings(void)
...
@@ -458,7 +471,6 @@ static void test_save_settings(void)
/* Easy case. Ask for default mapping, save, ask for previous map and read it back */
/* Easy case. Ask for default mapping, save, ask for previous map and read it back */
hr
=
IDirectInputDevice8_BuildActionMap
(
pKey
,
&
af
,
NULL
,
DIDBAM_HWDEFAULTS
);
hr
=
IDirectInputDevice8_BuildActionMap
(
pKey
,
&
af
,
NULL
,
DIDBAM_HWDEFAULTS
);
ok
(
SUCCEEDED
(
hr
),
"BuildActionMap failed hr=%08x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"BuildActionMap failed hr=%08x
\n
"
,
hr
);
ok
(
results
[
0
]
==
af
.
rgoAction
[
0
].
dwObjID
,
ok
(
results
[
0
]
==
af
.
rgoAction
[
0
].
dwObjID
,
"Mapped incorrectly expected: 0x%08x got: 0x%08x
\n
"
,
results
[
0
],
af
.
rgoAction
[
0
].
dwObjID
);
"Mapped incorrectly expected: 0x%08x got: 0x%08x
\n
"
,
results
[
0
],
af
.
rgoAction
[
0
].
dwObjID
);
...
@@ -543,6 +555,9 @@ static void test_save_settings(void)
...
@@ -543,6 +555,9 @@ static void test_save_settings(void)
ok
(
other_results
[
1
]
==
af
.
rgoAction
[
1
].
dwObjID
,
ok
(
other_results
[
1
]
==
af
.
rgoAction
[
1
].
dwObjID
,
"Mapped incorrectly expected: 0x%08x got: 0x%08x
\n
"
,
other_results
[
1
],
af
.
rgoAction
[
1
].
dwObjID
);
"Mapped incorrectly expected: 0x%08x got: 0x%08x
\n
"
,
other_results
[
1
],
af
.
rgoAction
[
1
].
dwObjID
);
ok
(
IsEqualGUID
(
&
GUID_SysKeyboard
,
&
af
.
rgoAction
[
1
].
guidInstance
),
"Action should be mapped to keyboard
\n
"
);
ok
(
IsEqualGUID
(
&
GUID_SysKeyboard
,
&
af
.
rgoAction
[
1
].
guidInstance
),
"Action should be mapped to keyboard
\n
"
);
IDirectInputDevice_Release
(
pKey
);
IDirectInput_Release
(
pDI
);
}
}
START_TEST
(
device
)
START_TEST
(
device
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment