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
17c437d4
Commit
17c437d4
authored
Apr 21, 2008
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Apr 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched32: Add more todo tests for CR and LF behavior for richedit 1.0.
parent
46ff4a6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
14 deletions
+36
-14
editor.c
dlls/riched32/tests/editor.c
+36
-14
No files found.
dlls/riched32/tests/editor.c
View file @
17c437d4
...
...
@@ -64,6 +64,9 @@ static void test_WM_SETTEXT()
const
char
*
TestItem11
=
"TestSomeText TestSomeText"
;
const
char
*
TestItem12
=
"TestSomeText
\r\n
TestSomeText"
;
const
char
*
TestItem13
=
"TestSomeText
\r\n
\r\n
TestSomeText"
;
const
char
*
TestItem14
=
"TestSomeText
\n
"
;
const
char
*
TestItem15
=
"TestSomeText
\r\r\r
"
;
const
char
*
TestItem16
=
"TestSomeText
\r\r\r
SomeMoreText"
;
char
buf
[
1024
]
=
{
0
};
LRESULT
result
;
...
...
@@ -72,9 +75,19 @@ static void test_WM_SETTEXT()
return it as is. In particular, \r\r\n is NOT converted, unlike riched20.
Currently, builtin riched32 mangles solitary \r or \n when not part of
a \r\n pair.
For riched32, the rules for breaking lines seem to be the following:
- \r\n is one line break. This is the normal case.
- \r{0,N}\n is one line break. In particular, \n by itself is a line break.
- \n{1,N} are that many line breaks.
- \r with text or other characters (except \n) past it, is a line break. That
is, a run of \r{N} without a terminating \n is considered N line breaks
- \r at the end of the text is NOT a line break. This differs from riched20,
where \r at the end of the text is a proper line break. This causes
TestItem2 to fail its test.
*/
#define TEST_SETTEXT(a, b,
is_todo
) \
#define TEST_SETTEXT(a, b,
nlines, is_todo, is_todo2
) \
result = SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) a); \
ok (result == 1, "WM_SETTEXT returned %ld instead of 1\n", result); \
result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buf); \
...
...
@@ -88,21 +101,30 @@ static void test_WM_SETTEXT()
} else { \
ok(result == 0, \
"WM_SETTEXT round trip: strcmp = %ld\n", result); \
} \
result = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); \
if (is_todo2) todo_wine { \
ok(result == nlines, "EM_GETLINECOUNT returned %ld, expected %d\n", result, nlines); \
} else { \
ok(result == nlines, "EM_GETLINECOUNT returned %ld, expected %d\n", result, nlines); \
}
TEST_SETTEXT
(
TestItem1
,
TestItem1
,
0
)
TEST_SETTEXT
(
TestItem2
,
TestItem2
,
1
)
TEST_SETTEXT
(
TestItem3
,
TestItem3
,
1
)
TEST_SETTEXT
(
TestItem4
,
TestItem4
,
1
)
TEST_SETTEXT
(
TestItem5
,
TestItem5
,
1
)
TEST_SETTEXT
(
TestItem6
,
TestItem6
,
1
)
TEST_SETTEXT
(
TestItem7
,
TestItem7
,
1
)
TEST_SETTEXT
(
TestItem8
,
TestItem8
,
0
)
TEST_SETTEXT
(
TestItem9
,
TestItem9
,
0
)
TEST_SETTEXT
(
TestItem10
,
TestItem10
,
0
)
TEST_SETTEXT
(
TestItem11
,
TestItem11
,
0
)
TEST_SETTEXT
(
TestItem12
,
TestItem12
,
0
)
TEST_SETTEXT
(
TestItem13
,
TestItem13
,
0
)
TEST_SETTEXT
(
TestItem1
,
TestItem1
,
1
,
0
,
0
)
TEST_SETTEXT
(
TestItem2
,
TestItem2
,
1
,
1
,
1
)
TEST_SETTEXT
(
TestItem3
,
TestItem3
,
2
,
1
,
1
)
TEST_SETTEXT
(
TestItem4
,
TestItem4
,
3
,
1
,
0
)
TEST_SETTEXT
(
TestItem5
,
TestItem5
,
2
,
1
,
1
)
TEST_SETTEXT
(
TestItem6
,
TestItem6
,
3
,
1
,
1
)
TEST_SETTEXT
(
TestItem7
,
TestItem7
,
4
,
1
,
1
)
TEST_SETTEXT
(
TestItem8
,
TestItem8
,
2
,
0
,
0
)
TEST_SETTEXT
(
TestItem9
,
TestItem9
,
3
,
0
,
0
)
TEST_SETTEXT
(
TestItem10
,
TestItem10
,
3
,
0
,
0
)
TEST_SETTEXT
(
TestItem11
,
TestItem11
,
1
,
0
,
0
)
TEST_SETTEXT
(
TestItem12
,
TestItem12
,
2
,
0
,
0
)
TEST_SETTEXT
(
TestItem13
,
TestItem13
,
3
,
0
,
0
)
TEST_SETTEXT
(
TestItem14
,
TestItem14
,
2
,
1
,
0
)
TEST_SETTEXT
(
TestItem15
,
TestItem15
,
3
,
1
,
1
)
TEST_SETTEXT
(
TestItem16
,
TestItem16
,
4
,
1
,
0
)
#undef TEST_SETTEXT
DestroyWindow
(
hwndRichEdit
);
...
...
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