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
9cdf2a6e
Commit
9cdf2a6e
authored
May 29, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/tests: Add some tests for invalid bitmap options.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
991eb2be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
d2d1.c
dlls/d2d1/tests/d2d1.c
+45
-0
No files found.
dlls/d2d1/tests/d2d1.c
View file @
9cdf2a6e
...
@@ -11789,6 +11789,50 @@ static void test_bitmap_map(BOOL d3d11)
...
@@ -11789,6 +11789,50 @@ static void test_bitmap_map(BOOL d3d11)
release_test_context
(
&
ctx
);
release_test_context
(
&
ctx
);
}
}
static
void
test_bitmap_create
(
BOOL
d3d11
)
{
static
const
struct
{
unsigned
int
options
;
}
invalid_options
[]
=
{
{
D2D1_BITMAP_OPTIONS_CANNOT_DRAW
},
{
D2D1_BITMAP_OPTIONS_CPU_READ
},
{
D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE
},
};
D2D1_BITMAP_PROPERTIES1
bitmap_desc
;
struct
d2d1_test_context
ctx
;
ID2D1Bitmap1
*
bitmap
;
D2D1_SIZE_U
size
;
unsigned
int
i
;
HRESULT
hr
;
if
(
!
init_test_context
(
&
ctx
,
d3d11
))
return
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
invalid_options
);
++
i
)
{
winetest_push_context
(
"Test %u"
,
i
);
set_size_u
(
&
size
,
4
,
4
);
bitmap_desc
.
dpiX
=
96
.
0
f
;
bitmap_desc
.
dpiY
=
96
.
0
f
;
bitmap_desc
.
pixelFormat
.
format
=
DXGI_FORMAT_B8G8R8A8_UNORM
;
bitmap_desc
.
pixelFormat
.
alphaMode
=
D2D1_ALPHA_MODE_IGNORE
;
bitmap_desc
.
bitmapOptions
=
invalid_options
[
i
].
options
;
bitmap_desc
.
colorContext
=
NULL
;
hr
=
ID2D1DeviceContext_CreateBitmap
(
ctx
.
context
,
size
,
NULL
,
0
,
&
bitmap_desc
,
&
bitmap
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
ID2D1Bitmap1_Release
(
bitmap
);
winetest_pop_context
();
}
release_test_context
(
&
ctx
);
}
START_TEST
(
d2d1
)
START_TEST
(
d2d1
)
{
{
HMODULE
d2d1_dll
=
GetModuleHandleA
(
"d2d1.dll"
);
HMODULE
d2d1_dll
=
GetModuleHandleA
(
"d2d1.dll"
);
...
@@ -11866,6 +11910,7 @@ START_TEST(d2d1)
...
@@ -11866,6 +11910,7 @@ START_TEST(d2d1)
queue_d3d10_test
(
test_stroke_contains_point
);
queue_d3d10_test
(
test_stroke_contains_point
);
queue_test
(
test_image_bounds
);
queue_test
(
test_image_bounds
);
queue_test
(
test_bitmap_map
);
queue_test
(
test_bitmap_map
);
queue_test
(
test_bitmap_create
);
run_queued_tests
();
run_queued_tests
();
}
}
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