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
078989d4
Commit
078989d4
authored
Apr 25, 2009
by
Massimo Del Fedele
Committed by
Alexandre Julliard
Apr 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit20: Test for fonttbl streamout.
parent
6f173277
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
editor.c
dlls/riched20/tests/editor.c
+56
-0
No files found.
dlls/riched20/tests/editor.c
View file @
078989d4
...
@@ -3383,6 +3383,61 @@ static void test_EM_STREAMOUT(void)
...
@@ -3383,6 +3383,61 @@ static void test_EM_STREAMOUT(void)
DestroyWindow
(
hwndRichEdit
);
DestroyWindow
(
hwndRichEdit
);
}
}
static
void
test_EM_STREAMOUT_FONTTBL
(
void
)
{
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
EDITSTREAM
es
;
char
buf
[
1024
]
=
{
0
};
char
*
p
;
char
*
fontTbl
;
int
brackCount
;
const
char
*
TestItem
=
"TestSomeText"
;
/* fills in the richedit control with some text */
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
TestItem
);
/* streams out the text in rtf format */
p
=
buf
;
es
.
dwCookie
=
(
DWORD_PTR
)
&
p
;
es
.
dwError
=
0
;
es
.
pfnCallback
=
test_WM_SETTEXT_esCallback
;
memset
(
buf
,
0
,
sizeof
(
buf
));
SendMessage
(
hwndRichEdit
,
EM_STREAMOUT
,
(
WPARAM
)(
SF_RTF
),
(
LPARAM
)
&
es
);
/* scans for \fonttbl, error if not found */
fontTbl
=
strstr
(
buf
,
"
\\
fonttbl"
);
ok
(
fontTbl
!=
NULL
,
"missing
\\
fonttbl section
\n
"
);
if
(
fontTbl
)
{
/* scans for terminating closing bracket */
brackCount
=
1
;
while
(
*
fontTbl
&&
brackCount
)
{
if
(
*
fontTbl
==
'{'
)
brackCount
++
;
else
if
(
*
fontTbl
==
'}'
)
brackCount
--
;
fontTbl
++
;
}
/* checks wether closing bracket is ok */
ok
(
brackCount
==
0
,
"missing closing bracket in
\\
fonttbl block
\n
"
);
if
(
!
brackCount
)
{
/* char before closing fonttbl block should be a closed bracket */
fontTbl
-=
2
;
ok
(
*
fontTbl
==
'}'
,
"spurious character '%02x' before
\\
fonttbl closing bracket
\n
"
,
*
fontTbl
);
/* char after fonttbl block should be a crlf */
fontTbl
+=
2
;
ok
(
*
fontTbl
==
0x0d
&&
*
(
fontTbl
+
1
)
==
0x0a
,
"missing crlf after
\\
fonttbl block
\n
"
);
}
}
DestroyWindow
(
hwndRichEdit
);
}
static
void
test_EM_SETTEXTEX
(
void
)
static
void
test_EM_SETTEXTEX
(
void
)
{
{
HWND
hwndRichEdit
,
parent
;
HWND
hwndRichEdit
,
parent
;
...
@@ -6631,6 +6686,7 @@ START_TEST( editor )
...
@@ -6631,6 +6686,7 @@ START_TEST( editor )
test_WM_PASTE
();
test_WM_PASTE
();
test_EM_STREAMIN
();
test_EM_STREAMIN
();
test_EM_STREAMOUT
();
test_EM_STREAMOUT
();
test_EM_STREAMOUT_FONTTBL
();
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