Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
41f5b155
Commit
41f5b155
authored
Apr 28, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleacc: Add AccessibleObjectFromWindow tests.
parent
81722255
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
1 deletion
+71
-1
Makefile.in
dlls/oleacc/tests/Makefile.in
+1
-1
main.c
dlls/oleacc/tests/main.c
+70
-0
No files found.
dlls/oleacc/tests/Makefile.in
View file @
41f5b155
TESTDLL
=
oleacc.dll
IMPORTS
=
ole32 oleacc
IMPORTS
=
ole32 oleacc
user32
C_SRCS
=
\
main.c
dlls/oleacc/tests/main.c
View file @
41f5b155
...
...
@@ -211,6 +211,69 @@ static void test_LresultFromObject(const char *name)
ok
(
Object_ref
==
1
,
"Object_ref = %d
\n
"
,
Object_ref
);
}
static
LRESULT
WINAPI
test_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
switch
(
msg
)
{
case
WM_GETOBJECT
:
ok
(
wparam
==
0xffffffff
||
broken
(
wparam
==
0x8000
),
"wparam = %lx
\n
"
,
wparam
);
if
(
lparam
==
(
DWORD
)
OBJID_CURSOR
)
return
E_UNEXPECTED
;
if
(
lparam
==
(
DWORD
)
OBJID_CLIENT
)
return
LresultFromObject
(
&
IID_IUnknown
,
wparam
,
&
Object
);
ok
(
0
,
"unexpected (%ld)
\n
"
,
lparam
);
return
0
;
}
return
DefWindowProcA
(
hwnd
,
msg
,
wparam
,
lparam
);
}
static
BOOL
register_window_class
(
void
)
{
WNDCLASSA
cls
;
memset
(
&
cls
,
0
,
sizeof
(
cls
));
cls
.
lpfnWndProc
=
test_window_proc
;
cls
.
lpszClassName
=
"oleacc_test"
;
cls
.
hInstance
=
GetModuleHandleA
(
NULL
);
return
RegisterClassA
(
&
cls
);
}
static
void
unregister_window_class
(
void
)
{
UnregisterClassA
(
"oleacc_test"
,
NULL
);
}
static
void
test_AccessibleObjectFromWindow
(
void
)
{
IUnknown
*
unk
;
HRESULT
hr
;
HWND
hwnd
;
hr
=
AccessibleObjectFromWindow
(
NULL
,
OBJID_CURSOR
,
&
IID_IUnknown
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %x
\n
"
,
hr
);
hr
=
AccessibleObjectFromWindow
(
NULL
,
OBJID_CURSOR
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
,
"got %x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IUnknown_Release
(
unk
);
hwnd
=
CreateWindowA
(
"oleacc_test"
,
"test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
0
,
0
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hwnd
!=
NULL
,
"CreateWindow failed
\n
"
);
hr
=
AccessibleObjectFromWindow
(
hwnd
,
OBJID_CURSOR
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_UNEXPECTED
,
"got %x
\n
"
,
hr
);
ok
(
Object_ref
==
1
,
"Object_ref = %d
\n
"
,
Object_ref
);
hr
=
AccessibleObjectFromWindow
(
hwnd
,
OBJID_CLIENT
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"got %x
\n
"
,
hr
);
ok
(
Object_ref
==
2
,
"Object_ref = %d
\n
"
,
Object_ref
);
IUnknown_Release
(
unk
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
main
)
{
int
argc
;
...
...
@@ -233,8 +296,15 @@ START_TEST(main)
return
;
}
if
(
!
register_window_class
())
{
skip
(
"can't register test window class
\n
"
);
return
;
}
test_getroletext
();
test_LresultFromObject
(
argv
[
0
]);
test_AccessibleObjectFromWindow
();
unregister_window_class
();
CoUninitialize
();
}
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