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
f909d18b
Commit
f909d18b
authored
Feb 06, 2020
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/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
f5906a5c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
0 deletions
+96
-0
bmp1x1_32bpp.bmp
dlls/comctl32/tests/bmp1x1_32bpp.bmp
+0
-0
resources.h
dlls/comctl32/tests/resources.h
+1
-0
rsrc.rc
dlls/comctl32/tests/rsrc.rc
+3
-0
static.c
dlls/comctl32/tests/static.c
+92
-0
No files found.
dlls/comctl32/tests/bmp1x1_32bpp.bmp
0 → 100644
View file @
f909d18b
58 Bytes
dlls/comctl32/tests/resources.h
View file @
f909d18b
...
...
@@ -23,6 +23,7 @@
#define IDB_BITMAP_128x15 10
#define IDB_BITMAP_80x15 11
#define IDB_BITMAP_1x1_32BPP 12
#define IDS_TBADD1 16
#define IDS_TBADD2 17
...
...
dlls/comctl32/tests/rsrc.rc
View file @
f909d18b
...
...
@@ -101,6 +101,9 @@ IDB_BITMAP_128x15 BITMAP bmp128x15.bmp
/* @makedep: bmp80x15.bmp */
IDB_BITMAP_80x15 BITMAP bmp80x15.bmp
/* @makedep: bmp1x1_32bpp.bmp */
IDB_BITMAP_1x1_32BPP BITMAP bmp1x1_32bpp.bmp
IDD_PROP_PAGE_WITH_CUSTOM_DEFAULT_BUTTON DIALOG 5, 43, 227, 215
STYLE WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
...
...
dlls/comctl32/tests/static.c
View file @
f909d18b
...
...
@@ -24,6 +24,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "commctrl.h"
#include "resources.h"
#include "wine/test.h"
...
...
@@ -133,6 +134,96 @@ static void test_set_text(void)
DestroyWindow
(
hStatic
);
}
static
void
test_image
(
HBITMAP
image
,
BOOL
is_dib
,
BOOL
is_premult
)
{
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
);
if
(
is_dib
)
{
todo_wine
ok
(
bm
.
bmBits
!=
NULL
,
"bmBits is NULL
\n
"
);
if
(
bm
.
bmBits
)
{
memcpy
(
bits
,
bm
.
bmBits
,
4
);
if
(
is_premult
)
ok
(
bits
[
0
]
==
0x05
&&
bits
[
1
]
==
0x09
&&
bits
[
2
]
==
0x0e
&&
bits
[
3
]
==
0x44
,
"bits: %02x %02x %02x %02x
\n
"
,
bits
[
0
],
bits
[
1
],
bits
[
2
],
bits
[
3
]);
else
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
]);
}
}
else
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
);
if
(
is_premult
)
todo_wine
ok
(
bits
[
0
]
==
0x05
&&
bits
[
1
]
==
0x09
&&
bits
[
2
]
==
0x0e
&&
bits
[
3
]
==
0x44
,
"bits: %02x %02x %02x %02x
\n
"
,
bits
[
0
],
bits
[
1
],
bits
[
2
],
bits
[
3
]);
else
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
=
create_static
(
SS_BITMAP
);
HBITMAP
bmp1
,
bmp2
,
image
;
image
=
LoadImageW
(
GetModuleHandleW
(
NULL
),
MAKEINTRESOURCEW
(
IDB_BITMAP_1x1_32BPP
),
IMAGE_BITMAP
,
0
,
0
,
0
);
ok
(
image
!=
NULL
,
"LoadImage failed
\n
"
);
test_image
(
image
,
FALSE
,
FALSE
);
bmp1
=
(
HBITMAP
)
SendMessageW
(
hwnd
,
STM_GETIMAGE
,
IMAGE_BITMAP
,
0
);
ok
(
bmp1
==
NULL
,
"got not NULL
\n
"
);
bmp1
=
(
HBITMAP
)
SendMessageW
(
hwnd
,
STM_SETIMAGE
,
IMAGE_BITMAP
,
(
LPARAM
)
image
);
ok
(
bmp1
==
NULL
,
"got not NULL
\n
"
);
bmp1
=
(
HBITMAP
)
SendMessageW
(
hwnd
,
STM_GETIMAGE
,
IMAGE_BITMAP
,
0
);
ok
(
bmp1
!=
NULL
,
"got NULL
\n
"
);
todo_wine
ok
(
bmp1
!=
image
,
"bmp == image
\n
"
);
test_image
(
bmp1
,
TRUE
,
TRUE
);
bmp2
=
(
HBITMAP
)
SendMessageW
(
hwnd
,
STM_SETIMAGE
,
IMAGE_BITMAP
,
(
LPARAM
)
image
);
ok
(
bmp2
!=
NULL
,
"got NULL
\n
"
);
todo_wine
ok
(
bmp2
!=
image
,
"bmp == image
\n
"
);
ok
(
bmp1
==
bmp2
,
"bmp1 != bmp2
\n
"
);
test_image
(
bmp2
,
TRUE
,
TRUE
);
DestroyWindow
(
hwnd
);
test_image
(
bmp2
,
TRUE
,
TRUE
);
DeleteObject
(
image
);
}
START_TEST
(
static
)
{
static
const
char
classname
[]
=
"testclass"
;
...
...
@@ -171,6 +262,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