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
295f8101
Commit
295f8101
authored
Jan 22, 2007
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a simple SelectObject test for bitmaps.
parent
f31b67ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
bitmap.c
dlls/gdi32/tests/bitmap.c
+59
-0
No files found.
dlls/gdi32/tests/bitmap.c
View file @
295f8101
...
...
@@ -1547,6 +1547,64 @@ todo_wine
ReleaseDC
(
0
,
hdc
);
}
static
void
test_select_object
(
void
)
{
HDC
hdc
;
HBITMAP
hbm
,
hbm_old
;
INT
planes
,
bpp
;
hdc
=
GetDC
(
0
);
ok
(
hdc
!=
0
,
"GetDC(0) failed
\n
"
);
hbm
=
CreateCompatibleBitmap
(
hdc
,
10
,
10
);
ok
(
hbm
!=
0
,
"CreateCompatibleBitmap failed
\n
"
);
hbm_old
=
SelectObject
(
hdc
,
hbm
);
ok
(
hbm_old
==
0
,
"SelectObject should fail
\n
"
);
DeleteObject
(
hbm
);
ReleaseDC
(
0
,
hdc
);
hdc
=
CreateCompatibleDC
(
0
);
ok
(
hdc
!=
0
,
"GetDC(0) failed
\n
"
);
hbm
=
CreateCompatibleBitmap
(
hdc
,
10
,
10
);
ok
(
hbm
!=
0
,
"CreateCompatibleBitmap failed
\n
"
);
hbm_old
=
SelectObject
(
hdc
,
hbm
);
ok
(
hbm_old
!=
0
,
"SelectObject failed
\n
"
);
hbm_old
=
SelectObject
(
hdc
,
hbm_old
);
ok
(
hbm_old
==
hbm
,
"SelectObject failed
\n
"
);
DeleteObject
(
hbm
);
/* test an 1-bpp bitmap */
planes
=
GetDeviceCaps
(
hdc
,
PLANES
);
bpp
=
1
;
hbm
=
CreateBitmap
(
10
,
10
,
planes
,
bpp
,
NULL
);
ok
(
hbm
!=
0
,
"CreateBitmap failed
\n
"
);
hbm_old
=
SelectObject
(
hdc
,
hbm
);
ok
(
hbm_old
!=
0
,
"SelectObject failed
\n
"
);
hbm_old
=
SelectObject
(
hdc
,
hbm_old
);
ok
(
hbm_old
==
hbm
,
"SelectObject failed
\n
"
);
DeleteObject
(
hbm
);
/* test a color bitmap that doesn't match the dc's bpp */
planes
=
GetDeviceCaps
(
hdc
,
PLANES
);
bpp
=
GetDeviceCaps
(
hdc
,
BITSPIXEL
)
==
24
?
8
:
24
;
hbm
=
CreateBitmap
(
10
,
10
,
planes
,
bpp
,
NULL
);
ok
(
hbm
!=
0
,
"CreateBitmap failed
\n
"
);
hbm_old
=
SelectObject
(
hdc
,
hbm
);
ok
(
hbm_old
==
0
,
"SelectObject should fail
\n
"
);
DeleteObject
(
hbm
);
DeleteDC
(
hdc
);
}
START_TEST
(
bitmap
)
{
is_win9x
=
GetWindowLongPtrW
(
GetDesktopWindow
(),
GWLP_WNDPROC
)
==
0
;
...
...
@@ -1562,4 +1620,5 @@ START_TEST(bitmap)
test_GetDIBits_selected_DDB
(
TRUE
);
test_GetDIBits_selected_DDB
(
FALSE
);
test_GetDIBits
();
test_select_object
();
}
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