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
d2844b15
Commit
d2844b15
authored
Jun 03, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Jun 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched32/tests: Change the test to facilitate adding a broken().
parent
6a3ac63c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
49 deletions
+41
-49
editor.c
dlls/riched32/tests/editor.c
+41
-49
No files found.
dlls/riched32/tests/editor.c
View file @
d2844b15
...
...
@@ -50,25 +50,29 @@ static HWND new_richedit(HWND parent) {
static
void
test_WM_SETTEXT
(
void
)
{
static
const
struct
{
const
char
*
itemtext
;
DWORD
lines
;
}
testitems
[]
=
{
{
"TestSomeText"
,
1
},
{
"TestSomeText
\r
"
,
1
},
{
"TestSomeText
\r
SomeMoreText
\r
"
,
2
},
{
"TestSomeText
\n\n
TestSomeText"
,
3
},
{
"TestSomeText
\r\r\n
TestSomeText"
,
2
},
{
"TestSomeText
\r\r\n\r
TestSomeText"
,
3
},
{
"TestSomeText
\r\n\r\r\n\r
TestSomeText"
,
4
},
{
"TestSomeText
\r\n
"
,
2
},
{
"TestSomeText
\r\n
SomeMoreText
\r\n
"
,
3
},
{
"TestSomeText
\r\n\r\n
TestSomeText"
,
3
},
{
"TestSomeText TestSomeText"
,
1
},
{
"TestSomeText
\r\n
TestSomeText"
,
2
},
{
"TestSomeText
\r\n
\r\n
TestSomeText"
,
3
},
{
"TestSomeText
\n
"
,
2
},
{
"TestSomeText
\r\r\r
"
,
3
},
{
"TestSomeText
\r\r\r
SomeMoreText"
,
4
}
};
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
const
char
*
TestItem1
=
"TestSomeText"
;
const
char
*
TestItem2
=
"TestSomeText
\r
"
;
const
char
*
TestItem3
=
"TestSomeText
\r
SomeMoreText
\r
"
;
const
char
*
TestItem4
=
"TestSomeText
\n\n
TestSomeText"
;
const
char
*
TestItem5
=
"TestSomeText
\r\r\n
TestSomeText"
;
const
char
*
TestItem6
=
"TestSomeText
\r\r\n\r
TestSomeText"
;
const
char
*
TestItem7
=
"TestSomeText
\r\n\r\r\n\r
TestSomeText"
;
const
char
*
TestItem8
=
"TestSomeText
\r\n
"
;
const
char
*
TestItem9
=
"TestSomeText
\r\n
SomeMoreText
\r\n
"
;
const
char
*
TestItem10
=
"TestSomeText
\r\n\r\n
TestSomeText"
;
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
;
int
i
;
/* This test attempts to show that WM_SETTEXT on a riched32 control does not
* attempt to modify the text that is pasted into the control, and should
...
...
@@ -85,37 +89,25 @@ static void test_WM_SETTEXT(void)
* where \r at the end of the text is a proper line break.
*/
#define TEST_SETTEXT(a, b, nlines) \
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); \
ok (result == lstrlen(buf), \
"WM_GETTEXT returned %ld instead of expected %u\n", \
result, lstrlen(buf)); \
result = strcmp(b, buf); \
ok(result == 0, \
"WM_SETTEXT round trip: strcmp = %ld\n", result); \
result = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); \
ok(result == nlines, "EM_GETLINECOUNT returned %ld, expected %d\n", result, nlines);
TEST_SETTEXT
(
TestItem1
,
TestItem1
,
1
)
TEST_SETTEXT
(
TestItem2
,
TestItem2
,
1
)
TEST_SETTEXT
(
TestItem3
,
TestItem3
,
2
)
TEST_SETTEXT
(
TestItem4
,
TestItem4
,
3
)
TEST_SETTEXT
(
TestItem5
,
TestItem5
,
2
)
TEST_SETTEXT
(
TestItem6
,
TestItem6
,
3
)
TEST_SETTEXT
(
TestItem7
,
TestItem7
,
4
)
TEST_SETTEXT
(
TestItem8
,
TestItem8
,
2
)
TEST_SETTEXT
(
TestItem9
,
TestItem9
,
3
)
TEST_SETTEXT
(
TestItem10
,
TestItem10
,
3
)
TEST_SETTEXT
(
TestItem11
,
TestItem11
,
1
)
TEST_SETTEXT
(
TestItem12
,
TestItem12
,
2
)
TEST_SETTEXT
(
TestItem13
,
TestItem13
,
3
)
TEST_SETTEXT
(
TestItem14
,
TestItem14
,
2
)
TEST_SETTEXT
(
TestItem15
,
TestItem15
,
3
)
TEST_SETTEXT
(
TestItem16
,
TestItem16
,
4
)
#undef TEST_SETTEXT
for
(
i
=
0
;
i
<
sizeof
(
testitems
)
/
sizeof
(
testitems
[
0
]);
i
++
)
{
char
buf
[
1024
]
=
{
0
};
LRESULT
result
;
result
=
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
testitems
[
i
].
itemtext
);
ok
(
result
==
1
,
"[%d] WM_SETTEXT returned %ld instead of 1
\n
"
,
i
,
result
);
result
=
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buf
);
ok
(
result
==
lstrlen
(
buf
),
"[%d] WM_GETTEXT returned %ld instead of expected %u
\n
"
,
i
,
result
,
lstrlen
(
buf
));
result
=
strcmp
(
testitems
[
i
].
itemtext
,
buf
);
ok
(
result
==
0
,
"[%d] WM_SETTEXT round trip: strcmp = %ld
\n
"
,
i
,
result
);
result
=
SendMessage
(
hwndRichEdit
,
EM_GETLINECOUNT
,
0
,
0
);
ok
(
result
==
testitems
[
i
].
lines
,
"[%d] EM_GETLINECOUNT returned %ld, expected %d
\n
"
,
i
,
result
,
testitems
[
i
].
lines
);
}
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