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
d6bdae11
Commit
d6bdae11
authored
Nov 18, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Nov 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add single-threaded tests for WM_[GET|SET]TEXT and [Get|Set]WindowText.
parent
0a6e56bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
win.c
dlls/user32/tests/win.c
+49
-0
No files found.
dlls/user32/tests/win.c
View file @
d6bdae11
...
...
@@ -64,6 +64,7 @@ static BOOL (WINAPI *pMirrorRgn)(HWND hwnd, HRGN hrgn);
static
BOOL
test_lbuttondown_flag
;
static
DWORD
num_gettext_msgs
;
static
DWORD
num_settext_msgs
;
static
HWND
hwndMessage
;
static
HWND
hwndMain
,
hwndMain2
;
static
HHOOK
hhook
;
...
...
@@ -798,6 +799,9 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
case
WM_GETTEXT
:
num_gettext_msgs
++
;
break
;
case
WM_SETTEXT
:
num_settext_msgs
++
;
break
;
}
return
DefWindowProcA
(
hwnd
,
msg
,
wparam
,
lparam
);
...
...
@@ -5691,12 +5695,57 @@ static void test_ShowWindow(void)
static
void
test_gettext
(
void
)
{
BOOL
success
;
char
buf
[
32
];
INT
buf_len
;
HWND
hwnd
;
LRESULT
r
;
hwnd
=
CreateWindowExA
(
0
,
"MainWindowClass"
,
"caption"
,
WS_POPUP
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"CreateWindowExA error %d
\n
"
,
GetLastError
()
);
/* test GetWindowTextA */
num_gettext_msgs
=
0
;
memset
(
buf
,
0
,
sizeof
(
buf
)
);
buf_len
=
GetWindowTextA
(
hwnd
,
buf
,
sizeof
(
buf
)
);
ok
(
buf_len
!=
0
,
"expected a nonempty window text
\n
"
);
ok
(
!
strcmp
(
buf
,
"caption"
),
"got wrong window text '%s'
\n
"
,
buf
);
ok
(
num_gettext_msgs
==
1
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
/* test WM_GETTEXT */
num_gettext_msgs
=
0
;
memset
(
buf
,
0
,
sizeof
(
buf
)
);
r
=
SendMessageA
(
hwnd
,
WM_GETTEXT
,
sizeof
(
buf
),
(
LONG_PTR
)
buf
);
ok
(
r
!=
0
,
"expected a nonempty window text
\n
"
);
ok
(
!
strcmp
(
buf
,
"caption"
),
"got wrong window text '%s'
\n
"
,
buf
);
ok
(
num_gettext_msgs
==
1
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
/* test SetWindowTextA */
num_settext_msgs
=
0
;
success
=
SetWindowTextA
(
hwnd
,
"new_caption"
);
ok
(
success
,
"SetWindowTextA failed
\n
"
);
ok
(
num_settext_msgs
==
1
,
"got %u WM_SETTEXT messages
\n
"
,
num_settext_msgs
);
num_gettext_msgs
=
0
;
memset
(
buf
,
0
,
sizeof
(
buf
)
);
buf_len
=
GetWindowTextA
(
hwnd
,
buf
,
sizeof
(
buf
)
);
ok
(
buf_len
!=
0
,
"expected a nonempty window text
\n
"
);
ok
(
!
strcmp
(
buf
,
"new_caption"
),
"got wrong window text '%s'
\n
"
,
buf
);
ok
(
num_gettext_msgs
==
1
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
/* test WM_SETTEXT */
num_settext_msgs
=
0
;
r
=
SendMessageA
(
hwnd
,
WM_SETTEXT
,
0
,
(
ULONG_PTR
)
"another_caption"
);
ok
(
r
!=
0
,
"WM_SETTEXT failed
\n
"
);
ok
(
num_settext_msgs
==
1
,
"got %u WM_SETTEXT messages
\n
"
,
num_settext_msgs
);
num_gettext_msgs
=
0
;
memset
(
buf
,
0
,
sizeof
(
buf
)
);
buf_len
=
GetWindowTextA
(
hwnd
,
buf
,
sizeof
(
buf
)
);
ok
(
buf_len
!=
0
,
"expected a nonempty window text
\n
"
);
ok
(
!
strcmp
(
buf
,
"another_caption"
),
"got wrong window text '%s'
\n
"
,
buf
);
ok
(
num_gettext_msgs
==
1
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
/* seems to crash on every modern Windows version */
if
(
0
)
{
...
...
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