Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3a228fb5
Commit
3a228fb5
authored
Jun 10, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Jun 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched32/tests: Correct a test to better show the behavior.
parent
c35aa1d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
15 deletions
+41
-15
editor.c
dlls/riched32/tests/editor.c
+41
-15
No files found.
dlls/riched32/tests/editor.c
View file @
3a228fb5
...
...
@@ -827,7 +827,7 @@ static void test_word_wrap(void)
POINTL
point
=
{
0
,
60
};
/* This point must be below the first line */
const
char
*
text
=
"Must be long enough to test line wrapping"
;
DWORD
dwCommonStyle
=
WS_VISIBLE
|
WS_POPUP
|
WS_VSCROLL
|
ES_MULTILINE
;
int
res
,
pos
,
lines
;
int
res
,
pos
,
lines
,
prevlines
,
reflines
[
3
]
;
/* Test the effect of WS_HSCROLL and ES_AUTOHSCROLL styles on wrapping
* when specified on window creation and set later. */
...
...
@@ -920,29 +920,55 @@ static void test_word_wrap(void)
ok
(
pos
,
"pos=%d indicating no word wrap when it is expected.
\n
"
,
pos
);
DestroyWindow
(
hwnd
);
/*
Test to see if wrapping happens with redraw disabled.
*/
/*
First lets see if the text would wrap normally (needed for reference)
*/
hwnd
=
CreateWindow
(
RICHEDIT_CLASS10A
,
NULL
,
dwCommonStyle
,
0
,
0
,
400
,
80
,
NULL
,
NULL
,
hmoduleRichEdit
,
NULL
);
0
,
0
,
200
,
80
,
NULL
,
NULL
,
hmoduleRichEdit
,
NULL
);
ok
(
hwnd
!=
NULL
,
"error: %d
\n
"
,
(
int
)
GetLastError
());
ok
(
IsWindowVisible
(
hwnd
),
"Window should be visible.
\n
"
);
res
=
SendMessage
(
hwnd
,
EM_REPLACESEL
,
FALSE
,
(
LPARAM
)
text
);
ok
(
res
,
"EM_REPLACESEL failed.
\n
"
);
/* Should have wrapped */
reflines
[
0
]
=
SendMessage
(
hwnd
,
EM_GETLINECOUNT
,
0
,
0
);
ok
(
reflines
[
0
]
>
1
,
"Line was expected to wrap (%d lines).
\n
"
,
reflines
[
0
]);
/* Resize the window to fit the line */
MoveWindow
(
hwnd
,
0
,
0
,
600
,
80
,
TRUE
);
/* Text should not be wrapped */
reflines
[
1
]
=
SendMessage
(
hwnd
,
EM_GETLINECOUNT
,
0
,
0
);
ok
(
reflines
[
1
]
==
1
,
"Line wasn't expected to wrap (%d lines).
\n
"
,
reflines
[
1
]);
/* Resize the window again to make sure the line wraps again */
MoveWindow
(
hwnd
,
0
,
0
,
10
,
80
,
TRUE
);
reflines
[
2
]
=
SendMessage
(
hwnd
,
EM_GETLINECOUNT
,
0
,
0
);
ok
(
reflines
[
2
]
>
1
,
"Line was expected to wrap (%d lines).
\n
"
,
reflines
[
2
]);
DestroyWindow
(
hwnd
);
/* Same test with redraw disabled */
hwnd
=
CreateWindow
(
RICHEDIT_CLASS10A
,
NULL
,
dwCommonStyle
,
0
,
0
,
200
,
80
,
NULL
,
NULL
,
hmoduleRichEdit
,
NULL
);
ok
(
hwnd
!=
NULL
,
"error: %d
\n
"
,
(
int
)
GetLastError
());
ok
(
IsWindowVisible
(
hwnd
),
"Window should be visible.
\n
"
);
/* Redraw is disabled by making the window invisible. */
SendMessage
(
hwnd
,
WM_SETREDRAW
,
FALSE
,
0
);
/* redraw is disabled by making the window invisible. */
ok
(
!
IsWindowVisible
(
hwnd
),
"Window shouldn't be visible.
\n
"
);
res
=
SendMessage
(
hwnd
,
EM_REPLACESEL
,
FALSE
,
(
LPARAM
)
text
);
ok
(
res
,
"EM_REPLACESEL failed.
\n
"
);
MoveWindow
(
hwnd
,
0
,
0
,
100
,
80
,
TRUE
);
SendMessage
(
hwnd
,
WM_SETREDRAW
,
TRUE
,
0
);
/* Wrapping didn't happen while redraw was disabled. */
/* Should have wrapped */
prevlines
=
SendMessage
(
hwnd
,
EM_GETLINECOUNT
,
0
,
0
);
ok
(
prevlines
==
reflines
[
0
],
"Line was expected to wrap (%d lines).
\n
"
,
prevlines
);
/* Resize the window to fit the line, no change to the number of lines */
MoveWindow
(
hwnd
,
0
,
0
,
600
,
80
,
TRUE
);
lines
=
SendMessage
(
hwnd
,
EM_GETLINECOUNT
,
0
,
0
);
todo_wine
ok
(
lines
==
1
,
"Line wasn't expected to wrap (lines=%d).
\n
"
,
lines
);
/* There isn't even a rewrap from resizing the window. */
todo_wine
ok
(
lines
==
prevlines
||
broken
(
lines
==
reflines
[
1
]),
/* Win98, WinME and NT4 */
"Expected no change in the number of lines
\n
"
);
/* Resize the window again to make sure the line wraps again */
MoveWindow
(
hwnd
,
0
,
0
,
10
,
80
,
TRUE
);
lines
=
SendMessage
(
hwnd
,
EM_GETLINECOUNT
,
0
,
0
);
todo_wine
ok
(
lines
==
1
,
"Line wasn't expected to wrap (lines=%d).
\n
"
,
lines
);
res
=
SendMessage
(
hwnd
,
EM_REPLACESEL
,
FALSE
,
(
LPARAM
)
text
);
ok
(
res
,
"EM_REPLACESEL failed.
\n
"
);
lines
=
SendMessage
(
hwnd
,
EM_GETLINECOUNT
,
0
,
0
);
ok
(
lines
>
1
,
"Line was expected to wrap (lines=%d).
\n
"
,
lines
);
todo_wine
ok
(
lines
==
prevlines
||
broken
(
lines
==
reflines
[
2
]),
/* Win98, WinME and NT4 */
"Expected no change in the number of lines
\n
"
);
DestroyWindow
(
hwnd
);
}
...
...
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