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
7ddb8e25
Commit
7ddb8e25
authored
Nov 08, 2013
by
André Hentschel
Committed by
Alexandre Julliard
Nov 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput8/tests: Enable compilation with -D__WINESRC__.
parent
daf3c95d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
40 deletions
+25
-40
Makefile.in
dlls/dinput8/tests/Makefile.in
+0
-1
device.c
dlls/dinput8/tests/device.c
+20
-34
dinput.c
dlls/dinput8/tests/dinput.c
+5
-5
No files found.
dlls/dinput8/tests/Makefile.in
View file @
7ddb8e25
TESTDLL
=
dinput8.dll
IMPORTS
=
dinput8 ole32 user32 advapi32
EXTRADEFS
=
-U__WINESRC__
-DWINE_STRICT_PROTOTYPES
-DWINE_NO_NAMELESS_EXTENSION
-DWIDL_C_INLINE_WRAPPERS
C_SRCS
=
\
device.c
\
...
...
dlls/dinput8/tests/device.c
View file @
7ddb8e25
...
...
@@ -27,10 +27,10 @@
#include "dinput.h"
struct
enum_data
{
LPDIRECTINPUT8
pDI
;
LPDIACTIONFORMAT
lpdiaf
;
LPDIRECTINPUTDEVICE8
keyboard
;
LPDIRECTINPUTDEVICE8
mouse
;
IDirectInput8A
*
pDI
;
DIACTIONFORMATA
*
lpdiaf
;
IDirectInputDevice8A
*
keyboard
;
IDirectInputDevice8A
*
mouse
;
const
char
*
username
;
int
ndevices
;
};
...
...
@@ -46,7 +46,7 @@ enum {
DITEST_YAXIS
};
static
DIACTION
actionMapping
[]
=
static
DIACTION
A
actionMapping
[]
=
{
/* axis */
{
0
,
0x01008A01
/* DIAXIS_DRIVINGR_STEER */
,
0
,
{
"Steer"
}
},
...
...
@@ -60,12 +60,7 @@ static DIACTION actionMapping[]=
{
4
,
DIMOUSE_YAXIS
,
0
,
{
"Y Axis"
}
}
};
static
void
test_device_input
(
LPDIRECTINPUTDEVICE8
lpdid
,
DWORD
event_type
,
DWORD
event
,
DWORD
expected
)
static
void
test_device_input
(
IDirectInputDevice8A
*
lpdid
,
DWORD
event_type
,
DWORD
event
,
DWORD
expected
)
{
HRESULT
hr
;
DIDEVICEOBJECTDATA
obj_data
;
...
...
@@ -115,16 +110,11 @@ static void test_device_input(
ok
(
hr
==
DI_OK
&&
data_size
==
1
,
"GetDeviceData() failed: %08x cnt:%d
\n
"
,
hr
,
data_size
);
}
static
void
test_build_action_map
(
LPDIRECTINPUTDEVICE8
lpdid
,
LPDIACTIONFORMAT
lpdiaf
,
int
action_index
,
DWORD
expected_type
,
DWORD
expected_inst
)
static
void
test_build_action_map
(
IDirectInputDevice8A
*
lpdid
,
DIACTIONFORMATA
*
lpdiaf
,
int
action_index
,
DWORD
expected_type
,
DWORD
expected_inst
)
{
HRESULT
hr
;
DIACTION
*
actions
;
DIACTION
A
*
actions
;
DWORD
instance
,
type
,
how
;
GUID
assigned_to
;
DIDEVICEINSTANCEA
ddi
;
...
...
@@ -147,12 +137,8 @@ static void test_build_action_map(
ok
(
IsEqualGUID
(
&
assigned_to
,
&
ddi
.
guidInstance
),
"Action and device GUID do not match action=%d
\n
"
,
action_index
);
}
static
BOOL
CALLBACK
enumeration_callback
(
LPCDIDEVICEINSTANCE
lpddi
,
LPDIRECTINPUTDEVICE8
lpdid
,
DWORD
dwFlags
,
DWORD
dwRemaining
,
LPVOID
pvRef
)
static
BOOL
CALLBACK
enumeration_callback
(
const
DIDEVICEINSTANCEA
*
lpddi
,
IDirectInputDevice8A
*
lpdid
,
DWORD
dwFlags
,
DWORD
dwRemaining
,
LPVOID
pvRef
)
{
HRESULT
hr
;
DIPROPDWORD
dp
;
...
...
@@ -266,9 +252,9 @@ static BOOL CALLBACK enumeration_callback(
static
void
test_action_mapping
(
void
)
{
HRESULT
hr
;
HINSTANCE
hinst
=
GetModuleHandle
(
NULL
);
LPDIRECTINPUT8
pDI
=
NULL
;
DIACTIONFORMAT
af
;
HINSTANCE
hinst
=
GetModuleHandle
A
(
NULL
);
IDirectInput8A
*
pDI
=
NULL
;
DIACTIONFORMAT
A
af
;
struct
enum_data
data
=
{
pDI
,
&
af
,
NULL
,
NULL
,
NULL
,
0
};
hr
=
CoCreateInstance
(
&
CLSID_DirectInput8
,
0
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectInput8A
,
(
LPVOID
*
)
&
pDI
);
...
...
@@ -293,7 +279,7 @@ static void test_action_mapping(void)
memset
(
&
af
,
0
,
sizeof
(
af
));
af
.
dwSize
=
sizeof
(
af
);
af
.
dwActionSize
=
sizeof
(
DIACTION
);
af
.
dwActionSize
=
sizeof
(
DIACTION
A
);
af
.
dwDataSize
=
4
*
sizeof
(
actionMapping
)
/
sizeof
(
actionMapping
[
0
]);
af
.
dwNumActions
=
sizeof
(
actionMapping
)
/
sizeof
(
actionMapping
[
0
]);
af
.
rgoAction
=
actionMapping
;
...
...
@@ -345,15 +331,15 @@ static void test_action_mapping(void)
static
void
test_save_settings
(
void
)
{
HRESULT
hr
;
HINSTANCE
hinst
=
GetModuleHandle
(
NULL
);
LPDIRECTINPUT8
pDI
=
NULL
;
DIACTIONFORMAT
af
;
HINSTANCE
hinst
=
GetModuleHandle
A
(
NULL
);
IDirectInput8A
*
pDI
=
NULL
;
DIACTIONFORMAT
A
af
;
IDirectInputDevice8A
*
pKey
;
static
const
GUID
mapping_guid
=
{
0xcafecafe
,
0x2
,
0x3
,
{
0x4
,
0x5
,
0x6
,
0x7
,
0x8
,
0x9
,
0xa
,
0xb
}
};
static
const
GUID
other_guid
=
{
0xcafe
,
0xcafe
,
0x3
,
{
0x4
,
0x5
,
0x6
,
0x7
,
0x8
,
0x9
,
0xa
,
0xb
}
};
static
DIACTION
actions
[]
=
{
static
DIACTION
A
actions
[]
=
{
{
0
,
DIKEYBOARD_A
,
0
,
{
"Blam"
}
},
{
1
,
DIKEYBOARD_B
,
0
,
{
"Kapow"
}
}
};
...
...
@@ -392,7 +378,7 @@ static void test_save_settings(void)
memset
(
&
af
,
0
,
sizeof
(
af
));
af
.
dwSize
=
sizeof
(
af
);
af
.
dwActionSize
=
sizeof
(
DIACTION
);
af
.
dwActionSize
=
sizeof
(
DIACTION
A
);
af
.
dwDataSize
=
4
*
sizeof
(
actions
)
/
sizeof
(
actions
[
0
]);
af
.
dwNumActions
=
sizeof
(
actions
)
/
sizeof
(
actions
[
0
]);
af
.
rgoAction
=
actions
;
...
...
dlls/dinput8/tests/dinput.c
View file @
7ddb8e25
...
...
@@ -436,11 +436,11 @@ struct enum_semantics_test
unsigned
int
device_count
;
BOOL
mouse
;
BOOL
keyboard
;
LPDIACTIONFORMAT
lpdiaf
;
DIACTIONFORMATA
*
lpdiaf
;
const
char
*
username
;
};
static
DIACTION
actionMapping
[]
=
static
DIACTION
A
actionMapping
[]
=
{
/* axis */
{
0
,
0x01008A01
/* DIAXIS_DRIVINGR_STEER */
,
0
,
{
"Steer"
}
},
...
...
@@ -454,7 +454,7 @@ static DIACTION actionMapping[]=
{
4
,
DIMOUSE_YAXIS
,
0
,
{
"Y Axis"
}
}
};
static
BOOL
CALLBACK
enum_semantics_callback
(
LPCDIDEVICEINSTANCE
lpddi
,
IDirectInputDevice8A
*
lpdid
,
DWORD
dwFlags
,
DWORD
dwRemaining
,
void
*
context
)
static
BOOL
CALLBACK
enum_semantics_callback
(
const
DIDEVICEINSTANCEA
*
lpddi
,
IDirectInputDevice8A
*
lpdid
,
DWORD
dwFlags
,
DWORD
dwRemaining
,
void
*
context
)
{
struct
enum_semantics_test
*
data
=
context
;
...
...
@@ -469,7 +469,7 @@ static BOOL CALLBACK enum_semantics_callback(LPCDIDEVICEINSTANCE lpddi, IDirectI
return
DIENUM_CONTINUE
;
}
static
BOOL
CALLBACK
set_action_map_callback
(
LPCDIDEVICEINSTANCE
lpddi
,
IDirectInputDevice8A
*
lpdid
,
DWORD
dwFlags
,
DWORD
dwRemaining
,
void
*
context
)
static
BOOL
CALLBACK
set_action_map_callback
(
const
DIDEVICEINSTANCEA
*
lpddi
,
IDirectInputDevice8A
*
lpdid
,
DWORD
dwFlags
,
DWORD
dwRemaining
,
void
*
context
)
{
HRESULT
hr
;
struct
enum_semantics_test
*
data
=
context
;
...
...
@@ -503,7 +503,7 @@ static void test_EnumDevicesBySemantics(void)
memset
(
&
diaf
,
0
,
sizeof
(
diaf
));
diaf
.
dwSize
=
sizeof
(
diaf
);
diaf
.
dwActionSize
=
sizeof
(
DIACTION
);
diaf
.
dwActionSize
=
sizeof
(
DIACTION
A
);
diaf
.
dwNumActions
=
sizeof
(
actionMapping
)
/
sizeof
(
actionMapping
[
0
]);
diaf
.
dwDataSize
=
4
*
diaf
.
dwNumActions
;
diaf
.
rgoAction
=
actionMapping
;
...
...
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