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
54bc660d
Commit
54bc660d
authored
Apr 21, 2008
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Apr 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: EM_STREAMIN tests for richedit 1.0 emulation.
parent
0739567d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
0 deletions
+95
-0
editor.c
dlls/riched32/tests/editor.c
+95
-0
No files found.
dlls/riched32/tests/editor.c
View file @
54bc660d
...
...
@@ -153,6 +153,100 @@ static void test_WM_GETTEXTLENGTH(void)
DestroyWindow
(
hwndRichEdit
);
}
static
DWORD
CALLBACK
test_EM_STREAMIN_esCallback
(
DWORD_PTR
dwCookie
,
LPBYTE
pbBuff
,
LONG
cb
,
LONG
*
pcb
)
{
const
char
**
str
=
(
const
char
**
)
dwCookie
;
int
size
=
strlen
(
*
str
);
*
pcb
=
cb
;
if
(
*
pcb
>
size
)
{
*
pcb
=
size
;
}
if
(
*
pcb
>
0
)
{
memcpy
(
pbBuff
,
*
str
,
*
pcb
);
*
str
+=
*
pcb
;
}
return
0
;
}
static
void
test_EM_STREAMIN
(
void
)
{
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
LRESULT
result
;
EDITSTREAM
es
;
char
buffer
[
1024
]
=
{
0
};
const
char
*
streamText1
=
"{
\\
rtf1
\\
ansi
\\
ansicpg1252
\\
deff0
\\
deflang12298{
\\
fonttbl{
\\
f0
\\
fswiss
\\
fprq2
\\
fcharset0 System;}}
\r\n
"
\
"
\\
viewkind4
\\
uc1
\\
pard
\\
f0
\\
fs17 TestSomeText
\\
par
\r\n
"
\
"}
\r\n
"
;
/* This should be accepted in richedit 1.0 emulation. See bug #8326 */
const
char
*
streamText2
=
"{{
\\
colortbl;
\\
red0
\\
green255
\\
blue102;
\\
red255
\\
green255
\\
blue255;"
\
"
\\
red170
\\
green255
\\
blue255;
\\
red255
\\
green238
\\
blue0;
\\
red51
\\
green255"
\
"
\\
blue221;
\\
red238
\\
green238
\\
blue238;}
\\
tx0
\\
tx424
\\
tx848
\\
tx1272 "
\
"
\\
tx1696
\\
tx2120
\\
tx2544
\\
tx2968
\\
tx3392
\\
tx3816
\\
tx4240
\\
tx4664 "
\
"
\\
tx5088
\\
tx5512
\\
tx5936
\\
tx6360
\\
tx6784
\\
tx7208
\\
tx7632
\\
tx8056 "
\
"
\\
tx8480
\\
tx8904
\\
tx9328
\\
tx9752
\\
tx10176
\\
tx10600
\\
tx11024 "
\
"
\\
tx11448
\\
tx11872
\\
tx12296
\\
tx12720
\\
tx13144
\\
cf2 RichEdit1
\\
line }"
;
const
char
*
streamText3
=
"RichEdit1"
;
es
.
dwCookie
=
(
DWORD_PTR
)
&
streamText1
;
es
.
dwError
=
0
;
es
.
pfnCallback
=
test_EM_STREAMIN_esCallback
;
SendMessage
(
hwndRichEdit
,
EM_STREAMIN
,
(
WPARAM
)(
SF_RTF
),
(
LPARAM
)
&
es
);
result
=
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
todo_wine
{
ok
(
result
==
12
,
"EM_STREAMIN: Test 1 returned %ld, expected 12
\n
"
,
result
);
}
result
=
strcmp
(
buffer
,
"TestSomeText"
);
todo_wine
{
ok
(
result
==
0
,
"EM_STREAMIN: Test 1 set wrong text: Result: %s
\n
"
,
buffer
);
}
es
.
dwCookie
=
(
DWORD_PTR
)
&
streamText2
;
SendMessage
(
hwndRichEdit
,
EM_STREAMIN
,
(
WPARAM
)(
SF_RTF
),
(
LPARAM
)
&
es
);
result
=
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
todo_wine
{
ok
(
result
==
9
,
"EM_STREAMIN: Test 2 returned %ld, expected 9
\n
"
,
result
);
}
result
=
strcmp
(
buffer
,
"RichEdit1"
);
todo_wine
{
ok
(
result
==
0
,
"EM_STREAMIN: Test 2 set wrong text: Result: %s
\n
"
,
buffer
);
}
es
.
dwCookie
=
(
DWORD_PTR
)
&
streamText3
;
SendMessage
(
hwndRichEdit
,
EM_STREAMIN
,
(
WPARAM
)(
SF_RTF
),
(
LPARAM
)
&
es
);
result
=
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
todo_wine
{
ok
(
result
==
0
,
"EM_STREAMIN: Test 3 returned %ld, expected 9
\n
"
,
result
);
}
todo_wine
{
ok
(
strlen
(
buffer
)
==
0
,
"EM_STREAMIN: Test 3 set wrong text: Result: %s
\n
"
,
buffer
);
}
DestroyWindow
(
hwndRichEdit
);
}
START_TEST
(
editor
)
{
MSG
msg
;
...
...
@@ -165,6 +259,7 @@ START_TEST( editor )
test_WM_SETTEXT
();
test_WM_GETTEXTLENGTH
();
test_EM_STREAMIN
();
/* Set the environment variable WINETEST_RICHED32 to keep windows
* responsive and open for 30 seconds. This is useful for debugging.
...
...
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