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
2b6f0b9a
Commit
2b6f0b9a
authored
Sep 07, 2011
by
Bruno Jesus
Committed by
Alexandre Julliard
Sep 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add SetCaretPos/GetCaretPos tests.
parent
2e08b31f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
3 deletions
+35
-3
edit.c
dlls/user32/tests/edit.c
+35
-3
No files found.
dlls/user32/tests/edit.c
View file @
2b6f0b9a
...
@@ -736,9 +736,10 @@ static void test_edit_control_1(void)
...
@@ -736,9 +736,10 @@ static void test_edit_control_1(void)
*/
*/
static
void
test_edit_control_2
(
void
)
static
void
test_edit_control_2
(
void
)
{
{
HWND
hwndMain
;
HWND
hwndMain
,
phwnd
;
char
szLocalString
[
MAXLEN
];
char
szLocalString
[
MAXLEN
];
LONG
r
;
LONG
r
,
w
=
150
,
h
=
50
;
POINT
cpos
;
/* Create main and edit windows. */
/* Create main and edit windows. */
hwndMain
=
CreateWindow
(
szEditTest2Class
,
"ET2"
,
WS_OVERLAPPEDWINDOW
,
hwndMain
=
CreateWindow
(
szEditTest2Class
,
"ET2"
,
WS_OVERLAPPEDWINDOW
,
...
@@ -749,7 +750,7 @@ static void test_edit_control_2(void)
...
@@ -749,7 +750,7 @@ static void test_edit_control_2(void)
hwndET2
=
CreateWindow
(
"EDIT"
,
NULL
,
hwndET2
=
CreateWindow
(
"EDIT"
,
NULL
,
WS_CHILD
|
WS_BORDER
|
ES_LEFT
|
ES_AUTOHSCROLL
,
WS_CHILD
|
WS_BORDER
|
ES_LEFT
|
ES_AUTOHSCROLL
,
0
,
0
,
150
,
50
,
/* important this not be 0 size. */
0
,
0
,
w
,
h
,
/* important this not be 0 size. */
hwndMain
,
(
HMENU
)
ID_EDITTEST2
,
hinst
,
NULL
);
hwndMain
,
(
HMENU
)
ID_EDITTEST2
,
hinst
,
NULL
);
assert
(
hwndET2
);
assert
(
hwndET2
);
if
(
winetest_interactive
)
if
(
winetest_interactive
)
...
@@ -768,6 +769,37 @@ static void test_edit_control_2(void)
...
@@ -768,6 +769,37 @@ static void test_edit_control_2(void)
ok
(
lstrcmp
(
szLocalString
,
"bar"
)
==
0
,
ok
(
lstrcmp
(
szLocalString
,
"bar"
)
==
0
,
"Wrong contents of edit: %s
\n
"
,
szLocalString
);
"Wrong contents of edit: %s
\n
"
,
szLocalString
);
/* try setting the caret before it's visible */
r
=
SetCaretPos
(
0
,
0
);
todo_wine
ok
(
0
==
r
,
"SetCaretPos succeeded unexpectedly, expected: 0, got: %d
\n
"
,
r
);
phwnd
=
SetFocus
(
hwndET2
);
ok
(
phwnd
!=
NULL
,
"SetFocus failed unexpectedly, expected non-zero, got NULL"
);
r
=
SetCaretPos
(
0
,
0
);
ok
(
1
==
r
,
"SetCaretPos failed unexpectedly, expected: 1, got: %d
\n
"
,
r
);
r
=
GetCaretPos
(
&
cpos
);
ok
(
1
==
r
,
"GetCaretPos failed unexpectedly, expected: 1, got: %d
\n
"
,
r
);
ok
(
cpos
.
x
==
0
&&
cpos
.
y
==
0
,
"Wrong caret position, expected: (0,0), got: (%d,%d)
\n
"
,
cpos
.
x
,
cpos
.
y
);
r
=
SetCaretPos
(
-
1
,
-
1
);
ok
(
1
==
r
,
"SetCaretPos failed unexpectedly, expected: 1, got: %d
\n
"
,
r
);
r
=
GetCaretPos
(
&
cpos
);
ok
(
1
==
r
,
"GetCaretPos failed unexpectedly, expected: 1, got: %d
\n
"
,
r
);
ok
(
cpos
.
x
==
-
1
&&
cpos
.
y
==
-
1
,
"Wrong caret position, expected: (-1,-1), got: (%d,%d)
\n
"
,
cpos
.
x
,
cpos
.
y
);
r
=
SetCaretPos
(
w
<<
1
,
h
<<
1
);
ok
(
1
==
r
,
"SetCaretPos failed unexpectedly, expected: 1, got: %d
\n
"
,
r
);
r
=
GetCaretPos
(
&
cpos
);
ok
(
1
==
r
,
"GetCaretPos failed unexpectedly, expected: 1, got: %d
\n
"
,
r
);
ok
(
cpos
.
x
==
(
w
<<
1
)
&&
cpos
.
y
==
(
h
<<
1
),
"Wrong caret position, expected: (%d,%d), got: (%d,%d)
\n
"
,
w
<<
1
,
h
<<
1
,
cpos
.
x
,
cpos
.
y
);
r
=
SetCaretPos
(
w
,
h
);
ok
(
1
==
r
,
"SetCaretPos failed unexpectedly, expected: 1, got: %d
\n
"
,
r
);
r
=
GetCaretPos
(
&
cpos
);
ok
(
1
==
r
,
"GetCaretPos failed unexpectedly, expected: 1, got: %d
\n
"
,
r
);
ok
(
cpos
.
x
==
w
&&
cpos
.
y
==
h
,
"Wrong caret position, expected: (%d,%d), got: (%d,%d)
\n
"
,
w
,
h
,
cpos
.
x
,
cpos
.
y
);
r
=
SetCaretPos
(
w
-
1
,
h
-
1
);
ok
(
1
==
r
,
"SetCaretPos failed unexpectedly, expected: 1, got: %d
\n
"
,
r
);
r
=
GetCaretPos
(
&
cpos
);
ok
(
1
==
r
,
"GetCaretPos failed unexpectedly, expected: 1, got: %d
\n
"
,
r
);
ok
(
cpos
.
x
==
(
w
-
1
)
&&
cpos
.
y
==
(
h
-
1
),
"Wrong caret position, expected: (%d,%d), got: (%d,%d)
\n
"
,
w
-
1
,
h
-
1
,
cpos
.
x
,
cpos
.
y
);
/* OK, done! */
/* OK, done! */
DestroyWindow
(
hwndET2
);
DestroyWindow
(
hwndET2
);
DestroyWindow
(
hwndMain
);
DestroyWindow
(
hwndMain
);
...
...
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