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
45629dc0
Commit
45629dc0
authored
Jun 12, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Jun 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched32/tests: Cater for differences between platforms.
parent
50846328
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
9 deletions
+31
-9
editor.c
dlls/riched32/tests/editor.c
+31
-9
No files found.
dlls/riched32/tests/editor.c
View file @
45629dc0
...
...
@@ -348,11 +348,12 @@ static const struct getline_s {
int
line
;
size_t
buffer_len
;
const
char
*
text
;
const
char
*
broken_text
;
}
gl
[]
=
{
{
0
,
10
,
"foo bar
\r\n
"
},
{
1
,
10
,
"
\r
"
},
{
2
,
10
,
"
\r\r\n
"
},
{
3
,
10
,
"bar
\n
"
},
{
0
,
10
,
"foo bar
\r\n
"
,
"foo bar
\r\n
"
},
{
1
,
10
,
"
\r
"
,
"
\r\r\r\n
"
},
{
2
,
10
,
"
\r\r\n
"
,
"bar
\n
"
},
{
3
,
10
,
"bar
\n
"
,
"
\r\n
"
},
{
4
,
10
,
"
\r\n
"
},
/* Buffer smaller than line length */
...
...
@@ -367,19 +368,40 @@ static void test_EM_GETLINE(void)
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
static
const
int
nBuf
=
1024
;
char
dest
[
1024
],
origdest
[
1024
];
LRESULT
linecount
;
const
char
text
[]
=
"foo bar
\r\n
"
"
\r
"
"
\r\r\n
"
"bar
\n
"
;
BOOL
broken_os
=
FALSE
;
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
text
);
linecount
=
SendMessage
(
hwndRichEdit
,
EM_GETLINECOUNT
,
0
,
0
);
if
(
linecount
==
4
)
{
broken_os
=
TRUE
;
win_skip
(
"Win9x, WinME and NT4 handle '
\\
r only' differently
\n
"
);
}
memset
(
origdest
,
0xBB
,
nBuf
);
for
(
i
=
0
;
i
<
sizeof
(
gl
)
/
sizeof
(
struct
getline_s
);
i
++
)
{
int
nCopied
;
int
expected_nCopied
=
min
(
gl
[
i
].
buffer_len
,
strlen
(
gl
[
i
].
text
));
int
expected_bytes_written
=
min
(
gl
[
i
].
buffer_len
,
strlen
(
gl
[
i
].
text
)
+
1
);
int
nCopied
,
expected_nCopied
,
expected_bytes_written
;
char
gl_text
[
1024
];
if
(
gl
[
i
].
line
>=
linecount
)
continue
;
/* Win9x, WinME and NT4 */
if
(
broken_os
&&
gl
[
i
].
broken_text
)
/* Win9x, WinME and NT4 */
strcpy
(
gl_text
,
gl
[
i
].
broken_text
);
else
strcpy
(
gl_text
,
gl
[
i
].
text
);
expected_nCopied
=
min
(
gl
[
i
].
buffer_len
,
strlen
(
gl_text
));
/* Cater for the fact that Win9x, WinME and NT4 don't append the '\0' */
expected_bytes_written
=
min
(
gl
[
i
].
buffer_len
,
strlen
(
gl_text
)
+
(
broken_os
?
0
:
1
));
memset
(
dest
,
0xBB
,
nBuf
);
*
(
WORD
*
)
dest
=
gl
[
i
].
buffer_len
;
...
...
@@ -393,11 +415,11 @@ static void test_EM_GETLINE(void)
ok
(
!
dest
[
0
]
&&
!
dest
[
1
]
&&
!
strncmp
(
dest
+
2
,
origdest
+
2
,
nBuf
-
2
),
"buffer_len=0
\n
"
);
else
if
(
gl
[
i
].
buffer_len
==
1
)
ok
(
dest
[
0
]
==
gl
[
i
].
text
[
0
]
&&
!
dest
[
1
]
&&
ok
(
dest
[
0
]
==
gl
_
text
[
0
]
&&
!
dest
[
1
]
&&
!
strncmp
(
dest
+
2
,
origdest
+
2
,
nBuf
-
2
),
"buffer_len=1
\n
"
);
else
{
ok
(
!
strncmp
(
dest
,
gl
[
i
].
text
,
expected_bytes_written
),
ok
(
!
strncmp
(
dest
,
gl
_
text
,
expected_bytes_written
),
"%d: expected_bytes_written=%d
\n
"
,
i
,
expected_bytes_written
);
ok
(
!
strncmp
(
dest
+
expected_bytes_written
,
origdest
+
expected_bytes_written
,
nBuf
-
expected_bytes_written
),
...
...
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