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
8d8c94d7
Commit
8d8c94d7
authored
Jan 12, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add EM_GETLINE test.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cefe6e8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
edit.c
dlls/user32/tests/edit.c
+64
-0
No files found.
dlls/user32/tests/edit.c
View file @
8d8c94d7
...
...
@@ -557,6 +557,18 @@ static HWND create_editcontrol (DWORD style, DWORD exstyle)
return
handle
;
}
static
HWND
create_editcontrolW
(
DWORD
style
,
DWORD
exstyle
)
{
static
const
WCHAR
testtextW
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
' '
,
't'
,
'e'
,
'x'
,
't'
,
0
};
static
const
WCHAR
editW
[]
=
{
'E'
,
'd'
,
'i'
,
't'
,
0
};
HWND
handle
;
handle
=
CreateWindowExW
(
exstyle
,
editW
,
testtextW
,
style
,
10
,
10
,
300
,
300
,
NULL
,
NULL
,
hinst
,
NULL
);
ok
(
handle
!=
NULL
,
"Failed to create Edit control.
\n
"
);
return
handle
;
}
static
HWND
create_child_editcontrol
(
DWORD
style
,
DWORD
exstyle
)
{
HWND
parentWnd
;
...
...
@@ -2936,6 +2948,57 @@ static void test_paste(void)
DestroyWindow
(
hMultilineEdit
);
}
static
void
test_EM_GETLINE
(
void
)
{
HWND
hwnd
[
2
];
int
i
;
hwnd
[
0
]
=
create_editcontrol
(
ES_AUTOHSCROLL
|
ES_AUTOVSCROLL
,
0
);
hwnd
[
1
]
=
create_editcontrolW
(
ES_AUTOHSCROLL
|
ES_AUTOVSCROLL
,
0
);
for
(
i
=
0
;
i
<
sizeof
(
hwnd
)
/
sizeof
(
hwnd
[
0
]);
i
++
)
{
static
const
WCHAR
strW
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
0
};
static
const
char
*
str
=
"text"
;
WCHAR
buffW
[
16
];
char
buff
[
16
];
int
r
;
if
(
i
==
0
)
ok
(
!
IsWindowUnicode
(
hwnd
[
i
]),
"Expected ansi window.
\n
"
);
else
ok
(
IsWindowUnicode
(
hwnd
[
i
]),
"Expected unicode window.
\n
"
);
SendMessageA
(
hwnd
[
i
],
WM_SETTEXT
,
0
,
(
LPARAM
)
str
);
memset
(
buff
,
0
,
sizeof
(
buff
));
*
(
WORD
*
)
buff
=
sizeof
(
buff
);
r
=
SendMessageA
(
hwnd
[
i
],
EM_GETLINE
,
0
,
(
LPARAM
)
buff
);
ok
(
r
==
strlen
(
str
),
"Failed to get a line %d.
\n
"
,
r
);
ok
(
!
strcmp
(
buff
,
str
),
"Unexpected line data %s.
\n
"
,
buff
);
memset
(
buff
,
0
,
sizeof
(
buff
));
*
(
WORD
*
)
buff
=
sizeof
(
buff
);
r
=
SendMessageA
(
hwnd
[
i
],
EM_GETLINE
,
1
,
(
LPARAM
)
buff
);
ok
(
r
==
strlen
(
str
),
"Failed to get a line %d.
\n
"
,
r
);
ok
(
!
strcmp
(
buff
,
str
),
"Unexpected line data %s.
\n
"
,
buff
);
memset
(
buffW
,
0
,
sizeof
(
buffW
));
*
(
WORD
*
)
buffW
=
sizeof
(
buffW
)
/
sizeof
(
buffW
[
0
]);
r
=
SendMessageW
(
hwnd
[
i
],
EM_GETLINE
,
0
,
(
LPARAM
)
buffW
);
ok
(
r
==
lstrlenW
(
strW
),
"Failed to get a line %d.
\n
"
,
r
);
ok
(
!
lstrcmpW
(
buffW
,
strW
),
"Unexpected line data %s.
\n
"
,
wine_dbgstr_w
(
buffW
));
memset
(
buffW
,
0
,
sizeof
(
buffW
));
*
(
WORD
*
)
buffW
=
sizeof
(
buffW
)
/
sizeof
(
buffW
[
0
]);
r
=
SendMessageW
(
hwnd
[
i
],
EM_GETLINE
,
1
,
(
LPARAM
)
buffW
);
ok
(
r
==
lstrlenW
(
strW
),
"Failed to get a line %d.
\n
"
,
r
);
ok
(
!
lstrcmpW
(
buffW
,
strW
),
"Unexpected line data %s.
\n
"
,
wine_dbgstr_w
(
buffW
));
DestroyWindow
(
hwnd
[
i
]);
}
}
START_TEST
(
edit
)
{
BOOL
b
;
...
...
@@ -2970,6 +3033,7 @@ START_TEST(edit)
test_contextmenu
();
test_EM_GETHANDLE
();
test_paste
();
test_EM_GETLINE
();
UnregisterWindowClasses
();
}
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