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
13115d8c
Commit
13115d8c
authored
Jun 15, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Jun 15, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Add a short test for the listview.
parent
f86270a0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
0 deletions
+99
-0
.gitignore
dlls/comctl32/tests/.gitignore
+1
-0
Makefile.in
dlls/comctl32/tests/Makefile.in
+1
-0
listview.c
dlls/comctl32/tests/listview.c
+97
-0
No files found.
dlls/comctl32/tests/.gitignore
View file @
13115d8c
...
...
@@ -3,6 +3,7 @@ comboex.ok
dpa.ok
header.ok
imagelist.ok
listview.ok
monthcal.ok
mru.ok
progress.ok
...
...
dlls/comctl32/tests/Makefile.in
View file @
13115d8c
...
...
@@ -10,6 +10,7 @@ CTESTS = \
dpa.c
\
header.c
\
imagelist.c
\
listview.c
\
monthcal.c
\
mru.c
\
progress.c
\
...
...
dlls/comctl32/tests/listview.c
0 → 100644
View file @
13115d8c
/*
* ListView tests
*
* Copyright 2006 Mike McCormack for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#include <windows.h>
#include <commctrl.h>
#include "wine/test.h"
START_TEST
(
listview
)
{
HWND
hwnd
,
hwndparent
=
0
;
INITCOMMONCONTROLSEX
icc
;
DWORD
r
;
LVITEM
item
;
HIMAGELIST
himl
;
HBITMAP
hbmp
;
RECT
r1
,
r2
;
icc
.
dwICC
=
0
;
icc
.
dwSize
=
sizeof
icc
;
InitCommonControlsEx
(
&
icc
);
himl
=
ImageList_Create
(
40
,
40
,
0
,
4
,
4
);
ok
(
himl
!=
NULL
,
"failed to create imagelist
\n
"
);
hbmp
=
CreateBitmap
(
40
,
40
,
1
,
1
,
NULL
);
ok
(
hbmp
!=
NULL
,
"failed to create bitmap
\n
"
);
r
=
ImageList_Add
(
himl
,
hbmp
,
0
);
ok
(
r
==
0
,
"should be zero
\n
"
);
hwnd
=
CreateWindowEx
(
0
,
"SysListView32"
,
"foo"
,
LVS_OWNERDRAWFIXED
,
10
,
10
,
100
,
200
,
hwndparent
,
NULL
,
NULL
,
NULL
);
ok
(
hwnd
!=
NULL
,
"failed to create listview window
\n
"
);
r
=
SendMessage
(
hwnd
,
LVM_SETEXTENDEDLISTVIEWSTYLE
,
0
,
0x940
);
ok
(
r
==
0
,
"should return zero
\n
"
);
r
=
SendMessage
(
hwnd
,
LVM_SETIMAGELIST
,
0
,
(
LPARAM
)
himl
);
ok
(
r
==
0
,
"should return zero
\n
"
);
r
=
SendMessage
(
hwnd
,
LVM_SETICONSPACING
,
0
,
MAKELONG
(
100
,
50
));
/* returns dimensions */
r
=
SendMessage
(
hwnd
,
LVM_GETITEMCOUNT
,
0
,
0
);
ok
(
r
==
0
,
"should be zero items
\n
"
);
item
.
mask
=
LVIF_IMAGE
|
LVIF_TEXT
;
item
.
iItem
=
0
;
item
.
iSubItem
=
1
;
item
.
iImage
=
0
;
r
=
SendMessage
(
hwnd
,
LVM_INSERTITEM
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
==
-
1
,
"should fail
\n
"
);
item
.
iSubItem
=
0
;
item
.
pszText
=
"hello"
;
r
=
SendMessage
(
hwnd
,
LVM_INSERTITEM
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
==
0
,
"should not fail
\n
"
);
memset
(
&
r1
,
0
,
sizeof
r1
);
r1
.
left
=
LVIR_ICON
;
r
=
SendMessage
(
hwnd
,
LVM_GETITEMRECT
,
0
,
(
LPARAM
)
&
r1
);
r
=
SendMessage
(
hwnd
,
LVM_DELETEALLITEMS
,
0
,
0
);
ok
(
r
==
TRUE
,
"should not fail
\n
"
);
item
.
iSubItem
=
0
;
item
.
pszText
=
"hello"
;
r
=
SendMessage
(
hwnd
,
LVM_INSERTITEM
,
0
,
(
LPARAM
)
&
item
);
ok
(
r
==
0
,
"should not fail
\n
"
);
memset
(
&
r2
,
0
,
sizeof
r2
);
r2
.
left
=
LVIR_ICON
;
r
=
SendMessage
(
hwnd
,
LVM_GETITEMRECT
,
0
,
(
LPARAM
)
&
r2
);
ok
(
!
memcmp
(
&
r1
,
&
r2
,
sizeof
r1
),
"rectangle should be the same
\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