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
f5906a5c
Commit
f5906a5c
authored
Feb 06, 2020
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add some tests for Static/SS_BITMAP control.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5d6f0de3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
0 deletions
+63
-0
bmp1x1_32bpp.bmp
dlls/user32/tests/bmp1x1_32bpp.bmp
+0
-0
resource.rc
dlls/user32/tests/resource.rc
+3
-0
static.c
dlls/user32/tests/static.c
+60
-0
No files found.
dlls/user32/tests/bmp1x1_32bpp.bmp
0 → 100644
View file @
f5906a5c
58 Bytes
dlls/user32/tests/resource.rc
View file @
f5906a5c
...
...
@@ -249,6 +249,9 @@ FONT 8, "MS Shell Dlg"
/* @makedep: test_mono.bmp */
100 BITMAP test_mono.bmp
/* @makedep: bmp1x1_32bpp.bmp */
101 BITMAP bmp1x1_32bpp.bmp
1 MENU
{
POPUP "&File"
...
...
dlls/user32/tests/static.c
View file @
f5906a5c
...
...
@@ -130,6 +130,65 @@ static void test_set_text(void)
DestroyWindow
(
hStatic
);
}
static
void
test_image
(
HBITMAP
image
)
{
BITMAP
bm
;
HDC
hdc
;
BITMAPINFO
info
;
BYTE
bits
[
4
];
GetObjectW
(
image
,
sizeof
(
bm
),
&
bm
);
ok
(
bm
.
bmWidth
==
1
,
"got %d
\n
"
,
bm
.
bmWidth
);
ok
(
bm
.
bmHeight
==
1
,
"got %d
\n
"
,
bm
.
bmHeight
);
ok
(
bm
.
bmBitsPixel
==
32
,
"got %d
\n
"
,
bm
.
bmBitsPixel
);
ok
(
bm
.
bmBits
==
NULL
,
"bmBits is not NULL
\n
"
);
info
.
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
info
.
bmiHeader
.
biWidth
=
bm
.
bmWidth
;
info
.
bmiHeader
.
biHeight
=
bm
.
bmHeight
;
info
.
bmiHeader
.
biPlanes
=
1
;
info
.
bmiHeader
.
biBitCount
=
32
;
info
.
bmiHeader
.
biCompression
=
BI_RGB
;
info
.
bmiHeader
.
biSizeImage
=
4
;
info
.
bmiHeader
.
biXPelsPerMeter
=
0
;
info
.
bmiHeader
.
biYPelsPerMeter
=
0
;
info
.
bmiHeader
.
biClrUsed
=
0
;
info
.
bmiHeader
.
biClrImportant
=
0
;
hdc
=
CreateCompatibleDC
(
0
);
GetDIBits
(
hdc
,
image
,
0
,
bm
.
bmHeight
,
bits
,
&
info
,
DIB_RGB_COLORS
);
DeleteDC
(
hdc
);
ok
(
bits
[
0
]
==
0x11
&&
bits
[
1
]
==
0x22
&&
bits
[
2
]
==
0x33
&&
bits
[
3
]
==
0x44
,
"bits: %02x %02x %02x %02x
\n
"
,
bits
[
0
],
bits
[
1
],
bits
[
2
],
bits
[
3
]);
}
static
void
test_set_image
(
void
)
{
HWND
hwnd
=
build_static
(
SS_BITMAP
);
HBITMAP
bmp
,
image
;
image
=
LoadImageW
(
GetModuleHandleW
(
NULL
),
MAKEINTRESOURCEW
(
101
),
IMAGE_BITMAP
,
0
,
0
,
0
);
ok
(
image
!=
NULL
,
"LoadImage failed
\n
"
);
test_image
(
image
);
bmp
=
(
HBITMAP
)
SendMessageW
(
hwnd
,
STM_SETIMAGE
,
IMAGE_BITMAP
,
(
LPARAM
)
image
);
ok
(
bmp
==
NULL
,
"got not NULL
\n
"
);
bmp
=
(
HBITMAP
)
SendMessageW
(
hwnd
,
STM_GETIMAGE
,
IMAGE_BITMAP
,
0
);
ok
(
bmp
!=
NULL
,
"got NULL
\n
"
);
ok
(
bmp
==
image
,
"bmp != image
\n
"
);
bmp
=
(
HBITMAP
)
SendMessageW
(
hwnd
,
STM_SETIMAGE
,
IMAGE_BITMAP
,
(
LPARAM
)
image
);
ok
(
bmp
!=
NULL
,
"got NULL
\n
"
);
ok
(
bmp
==
image
,
"bmp != image
\n
"
);
test_image
(
image
);
DestroyWindow
(
hwnd
);
DeleteObject
(
image
);
}
START_TEST
(
static
)
{
static
const
char
szClassName
[]
=
"testclass"
;
...
...
@@ -162,6 +221,7 @@ START_TEST(static)
test_updates
(
SS_ETCHEDHORZ
,
TODO_COUNT
);
test_updates
(
SS_ETCHEDVERT
,
TODO_COUNT
);
test_set_text
();
test_set_image
();
DestroyWindow
(
hMainWnd
);
}
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