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
80c1508b
Commit
80c1508b
authored
Apr 29, 2008
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Make the bitmap test pass under Windows 2000.
parent
5c15cf5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
bitmap.c
dlls/gdi32/tests/bitmap.c
+19
-14
No files found.
dlls/gdi32/tests/bitmap.c
View file @
80c1508b
...
...
@@ -276,7 +276,7 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER
{
BITMAP
bm
;
DIBSECTION
ds
;
INT
ret
,
width_bytes
;
INT
ret
,
bm_width_bytes
,
dib_
width_bytes
;
BYTE
*
buf
;
ret
=
GetObject
(
hbm
,
sizeof
(
bm
),
&
bm
);
...
...
@@ -285,23 +285,25 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER
ok
(
bm
.
bmType
==
0
,
"wrong bm.bmType %d
\n
"
,
bm
.
bmType
);
ok
(
bm
.
bmWidth
==
bmih
->
biWidth
,
"wrong bm.bmWidth %d
\n
"
,
bm
.
bmWidth
);
ok
(
bm
.
bmHeight
==
bmih
->
biHeight
,
"wrong bm.bmHeight %d
\n
"
,
bm
.
bmHeight
);
width_bytes
=
DIB_GetWidthBytes
(
bm
.
bmWidth
,
bm
.
bmBitsPixel
);
ok
(
bm
.
bmWidthBytes
==
width_bytes
,
"wrong bm.bmWidthBytes %d != %d
\n
"
,
bm
.
bmWidthBytes
,
width_bytes
);
dib_width_bytes
=
DIB_GetWidthBytes
(
bm
.
bmWidth
,
bm
.
bmBitsPixel
);
bm_width_bytes
=
BITMAP_GetWidthBytes
(
bm
.
bmWidth
,
bm
.
bmBitsPixel
);
if
(
bm
.
bmWidthBytes
!=
dib_width_bytes
)
/* Win2k bug */
ok
(
bm
.
bmWidthBytes
==
bm_width_bytes
,
"wrong bm.bmWidthBytes %d != %d
\n
"
,
bm
.
bmWidthBytes
,
bm_width_bytes
);
else
ok
(
bm
.
bmWidthBytes
==
dib_width_bytes
,
"wrong bm.bmWidthBytes %d != %d
\n
"
,
bm
.
bmWidthBytes
,
dib_width_bytes
);
ok
(
bm
.
bmPlanes
==
bmih
->
biPlanes
,
"wrong bm.bmPlanes %d
\n
"
,
bm
.
bmPlanes
);
ok
(
bm
.
bmBitsPixel
==
bmih
->
biBitCount
,
"bm.bmBitsPixel %d != %d
\n
"
,
bm
.
bmBitsPixel
,
bmih
->
biBitCount
);
ok
(
bm
.
bmBits
==
bits
,
"wrong bm.bmBits %p != %p
\n
"
,
bm
.
bmBits
,
bits
);
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bm
.
bmWidthBytes
*
bm
.
bmHeight
+
4096
);
width_bytes
=
BITMAP_GetWidthBytes
(
bm
.
bmWidth
,
bm
.
bmBitsPixel
);
/* GetBitmapBits returns not 32-bit aligned data */
ret
=
GetBitmapBits
(
hbm
,
0
,
NULL
);
ok
(
ret
==
width_bytes
*
bm
.
bmHeight
,
"%d != %d
\n
"
,
ret
,
width_bytes
*
bm
.
bmHeight
);
ok
(
ret
==
bm_width_bytes
*
bm
.
bmHeight
,
"%d != %d
\n
"
,
ret
,
bm_
width_bytes
*
bm
.
bmHeight
);
memset
(
buf
,
0xAA
,
bm
.
bmWidthBytes
*
bm
.
bmHeight
+
4096
);
ret
=
GetBitmapBits
(
hbm
,
bm
.
bmWidthBytes
*
bm
.
bmHeight
+
4096
,
buf
);
ok
(
ret
==
width_bytes
*
bm
.
bmHeight
,
"%d != %d
\n
"
,
ret
,
width_bytes
*
bm
.
bmHeight
);
ok
(
ret
==
bm_width_bytes
*
bm
.
bmHeight
,
"%d != %d
\n
"
,
ret
,
bm_
width_bytes
*
bm
.
bmHeight
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
...
...
@@ -331,8 +333,9 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER
ok
(
ret
==
sizeof
(
ds
),
"wrong size %d
\n
"
,
ret
);
ok
(
ds
.
dsBm
.
bmBits
==
bits
,
"wrong bm.bmBits %p != %p
\n
"
,
ds
.
dsBm
.
bmBits
,
bits
);
ok
(
ds
.
dsBmih
.
biSizeImage
==
ds
.
dsBm
.
bmWidthBytes
*
ds
.
dsBm
.
bmHeight
,
"%u != %u
\n
"
,
ds
.
dsBmih
.
biSizeImage
,
ds
.
dsBm
.
bmWidthBytes
*
ds
.
dsBm
.
bmHeight
);
if
(
ds
.
dsBm
.
bmWidthBytes
!=
bm_width_bytes
)
/* Win2k bug */
ok
(
ds
.
dsBmih
.
biSizeImage
==
ds
.
dsBm
.
bmWidthBytes
*
ds
.
dsBm
.
bmHeight
,
"%u != %u
\n
"
,
ds
.
dsBmih
.
biSizeImage
,
ds
.
dsBm
.
bmWidthBytes
*
ds
.
dsBm
.
bmHeight
);
ok
(
bmih
->
biSizeImage
==
0
,
"%u != 0
\n
"
,
bmih
->
biSizeImage
);
ds
.
dsBmih
.
biSizeImage
=
0
;
...
...
@@ -969,11 +972,6 @@ static void test_bitmap(void)
SetLastError
(
0xdeadbeef
);
hbmp
=
CreateBitmap
(
0x7ffffff
,
1
,
1
,
1
,
NULL
);
ok
(
hbmp
!=
0
,
"CreateBitmap should not fail
\n
"
);
DeleteObject
(
hbmp
);
SetLastError
(
0xdeadbeef
);
hbmp
=
CreateBitmap
(
0x7ffffff
,
9
,
1
,
1
,
NULL
);
if
(
!
hbmp
)
{
ok
(
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
,
...
...
@@ -983,6 +981,13 @@ static void test_bitmap(void)
DeleteObject
(
hbmp
);
SetLastError
(
0xdeadbeef
);
hbmp
=
CreateBitmap
(
0x7ffffff
,
9
,
1
,
1
,
NULL
);
ok
(
!
hbmp
,
"CreateBitmap should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
/* XP */
||
GetLastError
()
==
ERROR_INVALID_PARAMETER
/* Win2k */
,
"expected ERROR_NOT_ENOUGH_MEMORY, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
hbmp
=
CreateBitmap
(
0x7ffffff
+
1
,
1
,
1
,
1
,
NULL
);
ok
(
!
hbmp
,
"CreateBitmap should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
...
...
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