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
ea632a58
Commit
ea632a58
authored
Jul 05, 2005
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jul 05, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test case for IsWindowUnicode.
parent
af80bbe7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
119 additions
and
2 deletions
+119
-2
win.c
dlls/user/tests/win.c
+119
-2
No files found.
dlls/user/tests/win.c
View file @
ea632a58
...
...
@@ -2952,8 +2952,8 @@ static LRESULT WINAPI redraw_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LP
}
/* Ensure we exit from RedrawNow regardless of invalidated area */
static
void
test_redrawnow
(
void
)
{
static
void
test_redrawnow
(
void
)
{
WNDCLASSA
cls
;
HWND
hwndMain
;
...
...
@@ -2988,6 +2988,122 @@ static void test_redrawnow(void) {
DestroyWindow
(
hwndMain
);
}
static
void
test_IsWindowUnicode
(
void
)
{
static
const
char
ansi_class_nameA
[]
=
"ansi class name"
;
static
const
WCHAR
ansi_class_nameW
[]
=
{
'a'
,
'n'
,
's'
,
'i'
,
' '
,
'c'
,
'l'
,
'a'
,
's'
,
's'
,
' '
,
'n'
,
'a'
,
'm'
,
'e'
,
0
};
static
const
char
unicode_class_nameA
[]
=
"unicode class name"
;
static
const
WCHAR
unicode_class_nameW
[]
=
{
'u'
,
'n'
,
'i'
,
'c'
,
'o'
,
'd'
,
'e'
,
' '
,
'c'
,
'l'
,
'a'
,
's'
,
's'
,
' '
,
'n'
,
'a'
,
'm'
,
'e'
,
0
};
WNDCLASSA
classA
;
WNDCLASSW
classW
;
HWND
hwnd
;
memset
(
&
classW
,
0
,
sizeof
(
classW
));
classW
.
hInstance
=
GetModuleHandleA
(
0
);
classW
.
lpfnWndProc
=
DefWindowProcW
;
classW
.
lpszClassName
=
unicode_class_nameW
;
if
(
!
RegisterClassW
(
&
classW
))
return
;
memset
(
&
classA
,
0
,
sizeof
(
classA
));
classA
.
hInstance
=
GetModuleHandleA
(
0
);
classA
.
lpfnWndProc
=
DefWindowProcA
;
classA
.
lpszClassName
=
ansi_class_nameA
;
assert
(
RegisterClassA
(
&
classA
));
/* unicode class: window proc */
hwnd
=
CreateWindowExW
(
0
,
unicode_class_nameW
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
GetDesktopWindow
(),
0
,
0
,
NULL
);
assert
(
hwnd
);
ok
(
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return TRUE
\n
"
);
SetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
,
(
ULONG_PTR
)
DefWindowProcA
);
ok
(
!
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return FALSE
\n
"
);
SetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
,
(
ULONG_PTR
)
DefWindowProcW
);
ok
(
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return TRUE
\n
"
);
DestroyWindow
(
hwnd
);
hwnd
=
CreateWindowExA
(
0
,
unicode_class_nameA
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
GetDesktopWindow
(),
0
,
0
,
NULL
);
assert
(
hwnd
);
ok
(
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return TRUE
\n
"
);
SetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
,
(
ULONG_PTR
)
DefWindowProcA
);
ok
(
!
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return FALSE
\n
"
);
SetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
,
(
ULONG_PTR
)
DefWindowProcW
);
ok
(
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return TRUE
\n
"
);
DestroyWindow
(
hwnd
);
/* ansi class: window proc */
hwnd
=
CreateWindowExW
(
0
,
ansi_class_nameW
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
GetDesktopWindow
(),
0
,
0
,
NULL
);
assert
(
hwnd
);
ok
(
!
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return FALSE
\n
"
);
SetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
,
(
ULONG_PTR
)
DefWindowProcW
);
ok
(
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return TRUE
\n
"
);
SetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
,
(
ULONG_PTR
)
DefWindowProcA
);
ok
(
!
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return FALSE
\n
"
);
DestroyWindow
(
hwnd
);
hwnd
=
CreateWindowExA
(
0
,
ansi_class_nameA
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
GetDesktopWindow
(),
0
,
0
,
NULL
);
assert
(
hwnd
);
ok
(
!
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return FALSE
\n
"
);
SetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
,
(
ULONG_PTR
)
DefWindowProcW
);
ok
(
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return TRUE
\n
"
);
SetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
,
(
ULONG_PTR
)
DefWindowProcA
);
ok
(
!
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return FALSE
\n
"
);
DestroyWindow
(
hwnd
);
/* unicode class: class proc */
hwnd
=
CreateWindowExW
(
0
,
unicode_class_nameW
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
GetDesktopWindow
(),
0
,
0
,
NULL
);
assert
(
hwnd
);
ok
(
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return TRUE
\n
"
);
SetClassLongPtrA
(
hwnd
,
GCLP_WNDPROC
,
(
ULONG_PTR
)
DefWindowProcA
);
ok
(
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return TRUE
\n
"
);
/* do not restore class window proc back to unicode */
DestroyWindow
(
hwnd
);
hwnd
=
CreateWindowExA
(
0
,
unicode_class_nameA
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
GetDesktopWindow
(),
0
,
0
,
NULL
);
assert
(
hwnd
);
ok
(
!
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return FALSE
\n
"
);
SetClassLongPtrW
(
hwnd
,
GCLP_WNDPROC
,
(
ULONG_PTR
)
DefWindowProcW
);
ok
(
!
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return FALSE"
);
DestroyWindow
(
hwnd
);
/* ansi class: class proc */
hwnd
=
CreateWindowExW
(
0
,
ansi_class_nameW
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
GetDesktopWindow
(),
0
,
0
,
NULL
);
assert
(
hwnd
);
ok
(
!
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return FALSE
\n
"
);
SetClassLongPtrW
(
hwnd
,
GCLP_WNDPROC
,
(
ULONG_PTR
)
DefWindowProcW
);
ok
(
!
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return FALSE
\n
"
);
/* do not restore class window proc back to ansi */
DestroyWindow
(
hwnd
);
hwnd
=
CreateWindowExA
(
0
,
ansi_class_nameA
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
GetDesktopWindow
(),
0
,
0
,
NULL
);
assert
(
hwnd
);
ok
(
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return TRUE
\n
"
);
SetClassLongPtrA
(
hwnd
,
GCLP_WNDPROC
,
(
ULONG_PTR
)
DefWindowProcA
);
ok
(
IsWindowUnicode
(
hwnd
),
"IsWindowUnicode expected to return TRUE
\n
"
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
win
)
{
...
...
@@ -3053,6 +3169,7 @@ START_TEST(win)
test_nccalcscroll
(
hwndMain
);
test_scrollvalidate
(
hwndMain
);
test_scroll
();
test_IsWindowUnicode
();
UnhookWindowsHookEx
(
hhook
);
...
...
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