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
2353e1d2
Commit
2353e1d2
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 2.0.
parent
54bc660d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
0 deletions
+92
-0
editor.c
dlls/riched20/tests/editor.c
+92
-0
No files found.
dlls/riched20/tests/editor.c
View file @
2353e1d2
...
@@ -2302,6 +2302,97 @@ static DWORD CALLBACK EditStreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff,
...
@@ -2302,6 +2302,97 @@ static DWORD CALLBACK EditStreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff,
return
1
;
/* indicates callback failed */
return
1
;
/* indicates callback failed */
}
}
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
"
;
/* In richedit 2.0 mode, this should NOT be accepted, unlike 1.0 */
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
==
0
,
"EM_STREAMIN: Test 2 returned %ld, expected 0
\n
"
,
result
);
}
todo_wine
{
ok
(
strlen
(
buffer
)
==
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
);
}
static
void
test_EM_StreamIn_Undo
(
void
)
static
void
test_EM_StreamIn_Undo
(
void
)
{
{
/* The purpose of this test is to determine when a EM_StreamIn should be
/* The purpose of this test is to determine when a EM_StreamIn should be
...
@@ -2820,6 +2911,7 @@ START_TEST( editor )
...
@@ -2820,6 +2911,7 @@ START_TEST( editor )
test_EM_GETMODIFY
();
test_EM_GETMODIFY
();
test_EM_EXSETSEL
();
test_EM_EXSETSEL
();
test_WM_PASTE
();
test_WM_PASTE
();
test_EM_STREAMIN
();
test_EM_StreamIn_Undo
();
test_EM_StreamIn_Undo
();
test_EM_FORMATRANGE
();
test_EM_FORMATRANGE
();
test_unicode_conversions
();
test_unicode_conversions
();
...
...
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