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
c35926e4
Commit
c35926e4
authored
Jul 01, 2023
by
Jinoh Kang
Committed by
Alexandre Julliard
Jul 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20/tests: Add tests for change notifications caused by EM_SETSEL{,EX}.
parent
b70eb32c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
0 deletions
+91
-0
txtsrv.c
dlls/riched20/tests/txtsrv.c
+91
-0
No files found.
dlls/riched20/tests/txtsrv.c
View file @
c35926e4
...
...
@@ -424,6 +424,8 @@ static HRESULT __thiscall ITextHostImpl_TxGetPropertyBits(ITextHost *iface, DWOR
static
int
en_vscroll_sent
;
static
int
en_update_sent
;
static
int
en_change_sent
;
static
int
en_selchange_sent
;
static
HRESULT
__thiscall
ITextHostImpl_TxNotify
(
ITextHost
*
iface
,
DWORD
code
,
void
*
data
)
{
ITextHostTestImpl
*
This
=
impl_from_ITextHost
(
iface
);
...
...
@@ -438,6 +440,15 @@ static HRESULT __thiscall ITextHostImpl_TxNotify( ITextHost *iface, DWORD code,
en_update_sent
++
;
ok
(
!
data
,
"got %p
\n
"
,
data
);
break
;
case
EN_CHANGE
:
en_change_sent
++
;
todo_wine
ok
(
data
!=
NULL
,
"got %p
\n
"
,
data
);
break
;
case
EN_SELCHANGE
:
en_selchange_sent
++
;
ok
(
data
!=
NULL
,
"got %p
\n
"
,
data
);
break
;
}
return
S_OK
;
}
...
...
@@ -1268,25 +1279,105 @@ static void test_set_selection_message( void )
{
ITextServices
*
txtserv
;
ITextHost
*
host
;
CHARRANGE
range
;
LRESULT
result
;
HRESULT
hr
;
if
(
!
init_texthost
(
&
txtserv
,
&
host
))
return
;
ITextServices_TxSetText
(
txtserv
,
L""
);
if
(
winetest_debug
>
1
)
trace
(
"TxSendMessage EM_SETEVENTMASK"
);
hr
=
ITextServices_TxSendMessage
(
txtserv
,
EM_SETEVENTMASK
,
0
,
ENM_CHANGE
|
ENM_SELCHANGE
,
&
result
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
if
(
winetest_debug
>
1
)
trace
(
"TxSendMessage EM_SETSEL 0 20"
);
CLEAR_COUNTER
(
ITextHostImpl_TxViewChange
);
en_change_sent
=
0
;
en_selchange_sent
=
0
;
hr
=
ITextServices_TxSendMessage
(
txtserv
,
EM_SETSEL
,
0
,
20
,
&
result
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
CHECK_CALLED
(
ITextHostImpl_TxViewChange
);
todo_wine
ok
(
en_change_sent
==
0
,
"got %d
\n
"
,
en_change_sent
);
todo_wine
ok
(
en_selchange_sent
==
0
,
"got %d
\n
"
,
en_selchange_sent
);
hr
=
ITextServices_TxSendMessage
(
txtserv
,
EM_EXGETSEL
,
0
,
(
LPARAM
)
&
range
,
&
result
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
trace
(
"getsel: %lu, %lu
\n
"
,
range
.
cpMin
,
range
.
cpMax
);
if
(
winetest_debug
>
1
)
trace
(
"TxSendMessage EM_SETSELEX 0 20"
);
CLEAR_COUNTER
(
ITextHostImpl_TxViewChange
);
en_change_sent
=
0
;
en_selchange_sent
=
0
;
range
.
cpMin
=
0
;
range
.
cpMax
=
20
;
hr
=
ITextServices_TxSendMessage
(
txtserv
,
EM_EXSETSEL
,
0
,
(
LPARAM
)
&
range
,
&
result
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
CHECK_CALLED
(
ITextHostImpl_TxViewChange
);
todo_wine
ok
(
en_change_sent
==
0
,
"got %d
\n
"
,
en_change_sent
);
ok
(
en_selchange_sent
==
0
,
"got %d
\n
"
,
en_selchange_sent
);
if
(
winetest_debug
>
1
)
trace
(
"TxSetText"
);
CLEAR_COUNTER
(
ITextHostImpl_TxViewChange
);
en_change_sent
=
0
;
en_selchange_sent
=
0
;
hr
=
ITextServices_TxSendMessage
(
txtserv
,
EM_EXGETSEL
,
0
,
(
LPARAM
)
&
range
,
&
result
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
trace
(
"getsel: %lu, %lu
\n
"
,
range
.
cpMin
,
range
.
cpMax
);
ITextServices_TxSetText
(
txtserv
,
lorem
);
hr
=
ITextServices_TxSendMessage
(
txtserv
,
EM_EXGETSEL
,
0
,
(
LPARAM
)
&
range
,
&
result
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
trace
(
"getsel: %lu, %lu
\n
"
,
range
.
cpMin
,
range
.
cpMax
);
CHECK_CALLED
(
ITextHostImpl_TxViewChange
);
ok
(
en_change_sent
==
1
,
"got %d
\n
"
,
en_change_sent
);
todo_wine
ok
(
en_selchange_sent
==
0
,
"got %d
\n
"
,
en_selchange_sent
);
if
(
winetest_debug
>
1
)
trace
(
"TxSendMessage EM_SETSEL 0 20"
);
CLEAR_COUNTER
(
ITextHostImpl_TxViewChange
);
en_change_sent
=
0
;
en_selchange_sent
=
0
;
hr
=
ITextServices_TxSendMessage
(
txtserv
,
EM_SETSEL
,
0
,
20
,
&
result
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
CHECK_CALLED
(
ITextHostImpl_TxViewChange
);
todo_wine
ok
(
en_change_sent
==
0
,
"got %d
\n
"
,
en_change_sent
);
ok
(
en_selchange_sent
==
1
,
"got %d
\n
"
,
en_selchange_sent
);
hr
=
ITextServices_TxSendMessage
(
txtserv
,
EM_EXGETSEL
,
0
,
(
LPARAM
)
&
range
,
&
result
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
trace
(
"getsel: %lu, %lu
\n
"
,
range
.
cpMin
,
range
.
cpMax
);
if
(
winetest_debug
>
1
)
trace
(
"TxSendMessage EM_SETSELEX 0 20"
);
CLEAR_COUNTER
(
ITextHostImpl_TxViewChange
);
en_change_sent
=
0
;
en_selchange_sent
=
0
;
range
.
cpMin
=
0
;
range
.
cpMax
=
20
;
hr
=
ITextServices_TxSendMessage
(
txtserv
,
EM_EXSETSEL
,
0
,
(
LPARAM
)
&
range
,
&
result
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
CHECK_CALLED
(
ITextHostImpl_TxViewChange
);
todo_wine
ok
(
en_change_sent
==
0
,
"got %d
\n
"
,
en_change_sent
);
ok
(
en_selchange_sent
==
0
,
"got %d
\n
"
,
en_selchange_sent
);
hr
=
ITextServices_TxSendMessage
(
txtserv
,
EM_EXGETSEL
,
0
,
(
LPARAM
)
&
range
,
&
result
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
trace
(
"getsel: %lu, %lu
\n
"
,
range
.
cpMin
,
range
.
cpMax
);
if
(
winetest_debug
>
1
)
trace
(
"release interfaces"
);
ITextServices_Release
(
txtserv
);
ITextHost_Release
(
host
);
...
...
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