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
258dc94c
Commit
258dc94c
authored
Jan 12, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Add EM_GETLINE test.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8d8c94d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
edit.c
dlls/comctl32/tests/edit.c
+61
-0
No files found.
dlls/comctl32/tests/edit.c
View file @
258dc94c
...
@@ -558,6 +558,17 @@ static HWND create_editcontrol (DWORD style, DWORD exstyle)
...
@@ -558,6 +558,17 @@ static HWND create_editcontrol (DWORD style, DWORD exstyle)
return
handle
;
return
handle
;
}
}
static
HWND
create_editcontrolW
(
DWORD
style
,
DWORD
exstyle
)
{
static
const
WCHAR
testtextW
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
' '
,
't'
,
'e'
,
'x'
,
't'
,
0
};
HWND
handle
;
handle
=
CreateWindowExW
(
exstyle
,
WC_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
)
static
HWND
create_child_editcontrol
(
DWORD
style
,
DWORD
exstyle
)
{
{
HWND
parentWnd
;
HWND
parentWnd
;
...
@@ -2922,6 +2933,55 @@ static void test_paste(void)
...
@@ -2922,6 +2933,55 @@ static void test_paste(void)
DestroyWindow
(
hMultilineEdit
);
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
;
todo_wine_if
(
i
==
0
)
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
)
START_TEST
(
edit
)
{
{
ULONG_PTR
ctx_cookie
;
ULONG_PTR
ctx_cookie
;
...
@@ -2961,6 +3021,7 @@ START_TEST(edit)
...
@@ -2961,6 +3021,7 @@ START_TEST(edit)
test_contextmenu
();
test_contextmenu
();
test_EM_GETHANDLE
();
test_EM_GETHANDLE
();
test_paste
();
test_paste
();
test_EM_GETLINE
();
UnregisterWindowClasses
();
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