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
3bbb208f
Commit
3bbb208f
authored
Nov 16, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add tests for small sizes of cursor bitmaps.
parent
f7a4cabb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
14 deletions
+31
-14
cursoricon.c
dlls/user32/cursoricon.c
+1
-1
cursoricon.c
dlls/user32/tests/cursoricon.c
+30
-13
No files found.
dlls/user32/cursoricon.c
View file @
3bbb208f
...
...
@@ -2116,7 +2116,7 @@ HICON WINAPI CreateIconIndirect(PICONINFO iconinfo)
width
=
bmpXor
.
bmWidth
;
height
=
bmpXor
.
bmHeight
;
if
(
bmpXor
.
bmPlanes
*
bmpXor
.
bmBitsPixel
!=
1
)
if
(
bmpXor
.
bmPlanes
*
bmpXor
.
bmBitsPixel
!=
1
||
bmpAnd
.
bmPlanes
*
bmpAnd
.
bmBitsPixel
!=
1
)
{
color
=
CreateCompatibleBitmap
(
screen_dc
,
width
,
height
);
mask
=
CreateBitmap
(
width
,
height
,
1
,
1
,
NULL
);
...
...
dlls/user32/tests/cursoricon.c
View file @
3bbb208f
...
...
@@ -696,7 +696,7 @@ static void test_initial_cursor(void)
ok
(
error
==
0xdeadbeef
,
"Last error: 0x%08x
\n
"
,
error
);
}
static
void
test_icon_info_dbg
(
HICON
hIcon
,
UINT
exp_cx
,
UINT
exp_cy
,
UINT
exp_bpp
,
int
line
)
static
void
test_icon_info_dbg
(
HICON
hIcon
,
UINT
exp_cx
,
UINT
exp_cy
,
UINT
exp_
mask_cy
,
UINT
exp_
bpp
,
int
line
)
{
ICONINFO
info
;
DWORD
ret
;
...
...
@@ -736,13 +736,13 @@ static void test_icon_info_dbg(HICON hIcon, UINT exp_cx, UINT exp_cy, UINT exp_b
ok_
(
__FILE__
,
line
)(
bmMask
.
bmBitsPixel
==
1
,
"bmMask.bmBitsPixel = %d
\n
"
,
bmMask
.
bmBitsPixel
);
ok_
(
__FILE__
,
line
)(
bmMask
.
bmWidth
==
exp_cx
,
"bmMask.bmWidth = %d
\n
"
,
bmMask
.
bmWidth
);
ok_
(
__FILE__
,
line
)(
bmMask
.
bmHeight
==
exp_cy
,
"bmMask.bmHeight = %d
\n
"
,
bmMask
.
bmHeight
);
ok_
(
__FILE__
,
line
)(
bmMask
.
bmHeight
==
exp_
mask_
cy
,
"bmMask.bmHeight = %d
\n
"
,
bmMask
.
bmHeight
);
}
else
{
ok_
(
__FILE__
,
line
)(
bmMask
.
bmBitsPixel
==
1
,
"bmMask.bmBitsPixel = %d
\n
"
,
bmMask
.
bmBitsPixel
);
ok_
(
__FILE__
,
line
)(
bmMask
.
bmWidth
==
exp_cx
,
"bmMask.bmWidth = %d
\n
"
,
bmMask
.
bmWidth
);
ok_
(
__FILE__
,
line
)(
bmMask
.
bmHeight
==
exp_
cy
*
2
,
"bmMask.bmHeight = %d
\n
"
,
bmMask
.
bmHeight
);
ok_
(
__FILE__
,
line
)(
bmMask
.
bmHeight
==
exp_
mask_cy
,
"bmMask.bmHeight = %d
\n
"
,
bmMask
.
bmHeight
);
}
if
(
pGetIconInfoExA
)
{
...
...
@@ -777,7 +777,7 @@ static void test_icon_info_dbg(HICON hIcon, UINT exp_cx, UINT exp_cy, UINT exp_b
}
}
#define test_icon_info(a,b,c,d
) test_icon_info_dbg((a),(b),(c),(d
),__LINE__)
#define test_icon_info(a,b,c,d
,e) test_icon_info_dbg((a),(b),(c),(d),(e
),__LINE__)
static
void
test_CreateIcon
(
void
)
{
...
...
@@ -789,6 +789,7 @@ static void test_CreateIcon(void)
HDC
hdc
;
void
*
bits
;
UINT
display_bpp
;
int
i
;
hdc
=
GetDC
(
0
);
display_bpp
=
GetDeviceCaps
(
hdc
,
BITSPIXEL
);
...
...
@@ -800,12 +801,12 @@ static void test_CreateIcon(void)
hIcon
=
CreateIcon
(
0
,
16
,
16
,
1
,
1
,
bmp_bits
,
bmp_bits
);
ok
(
hIcon
!=
0
,
"CreateIcon failed
\n
"
);
test_icon_info
(
hIcon
,
16
,
16
,
1
);
test_icon_info
(
hIcon
,
16
,
16
,
32
,
1
);
DestroyIcon
(
hIcon
);
hIcon
=
CreateIcon
(
0
,
16
,
16
,
1
,
display_bpp
,
bmp_bits
,
bmp_bits
);
ok
(
hIcon
!=
0
,
"CreateIcon failed
\n
"
);
test_icon_info
(
hIcon
,
16
,
16
,
display_bpp
);
test_icon_info
(
hIcon
,
16
,
16
,
16
,
display_bpp
);
DestroyIcon
(
hIcon
);
hbmMask
=
CreateBitmap
(
16
,
16
,
1
,
1
,
bmp_bits
);
...
...
@@ -840,7 +841,7 @@ static void test_CreateIcon(void)
info
.
hbmColor
=
hbmColor
;
hIcon
=
CreateIconIndirect
(
&
info
);
ok
(
hIcon
!=
0
,
"CreateIconIndirect failed
\n
"
);
test_icon_info
(
hIcon
,
16
,
16
,
display_bpp
);
test_icon_info
(
hIcon
,
16
,
16
,
16
,
display_bpp
);
DestroyIcon
(
hIcon
);
DeleteObject
(
hbmMask
);
...
...
@@ -857,11 +858,27 @@ static void test_CreateIcon(void)
SetLastError
(
0xdeadbeaf
);
hIcon
=
CreateIconIndirect
(
&
info
);
ok
(
hIcon
!=
0
,
"CreateIconIndirect failed
\n
"
);
test_icon_info
(
hIcon
,
16
,
16
,
1
);
test_icon_info
(
hIcon
,
16
,
16
,
32
,
1
);
DestroyIcon
(
hIcon
);
DeleteObject
(
hbmMask
);
DeleteObject
(
hbmColor
);
for
(
i
=
0
;
i
<=
4
;
i
++
)
{
hbmMask
=
CreateBitmap
(
1
,
i
,
1
,
1
,
bmp_bits
);
ok
(
hbmMask
!=
0
,
"CreateBitmap failed
\n
"
);
info
.
fIcon
=
TRUE
;
info
.
xHotspot
=
0
;
info
.
yHotspot
=
0
;
info
.
hbmMask
=
hbmMask
;
info
.
hbmColor
=
0
;
SetLastError
(
0xdeadbeaf
);
hIcon
=
CreateIconIndirect
(
&
info
);
ok
(
hIcon
!=
0
,
"CreateIconIndirect failed
\n
"
);
test_icon_info
(
hIcon
,
1
,
i
/
2
,
max
(
i
,
1
),
1
);
DestroyIcon
(
hIcon
);
DeleteObject
(
hbmMask
);
}
/* test creating an icon from a DIB section */
...
...
@@ -890,7 +907,7 @@ static void test_CreateIcon(void)
SetLastError
(
0xdeadbeaf
);
hIcon
=
CreateIconIndirect
(
&
info
);
ok
(
hIcon
!=
0
,
"CreateIconIndirect failed
\n
"
);
test_icon_info
(
hIcon
,
32
,
32
,
8
);
test_icon_info
(
hIcon
,
32
,
32
,
32
,
8
);
DestroyIcon
(
hIcon
);
DeleteObject
(
hbmColor
);
...
...
@@ -908,7 +925,7 @@ static void test_CreateIcon(void)
SetLastError
(
0xdeadbeaf
);
hIcon
=
CreateIconIndirect
(
&
info
);
ok
(
hIcon
!=
0
,
"CreateIconIndirect failed
\n
"
);
test_icon_info
(
hIcon
,
32
,
32
,
8
);
test_icon_info
(
hIcon
,
32
,
32
,
32
,
8
);
DestroyIcon
(
hIcon
);
DeleteObject
(
hbmColor
);
...
...
@@ -926,7 +943,7 @@ static void test_CreateIcon(void)
SetLastError
(
0xdeadbeaf
);
hIcon
=
CreateIconIndirect
(
&
info
);
ok
(
hIcon
!=
0
,
"CreateIconIndirect failed
\n
"
);
test_icon_info
(
hIcon
,
32
,
32
,
8
);
test_icon_info
(
hIcon
,
32
,
32
,
32
,
8
);
DestroyIcon
(
hIcon
);
DeleteObject
(
hbmMask
);
...
...
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