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
f40e7071
Commit
f40e7071
authored
Aug 23, 2022
by
Ziqing Hui
Committed by
Alexandre Julliard
Aug 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx10/tests: Add tests for D3DX10CreateEffectFromResource.
parent
6b9ba3e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
4 deletions
+105
-4
d3dx10.c
dlls/d3dx10_43/tests/d3dx10.c
+105
-4
No files found.
dlls/d3dx10_43/tests/d3dx10.c
View file @
f40e7071
...
...
@@ -4142,8 +4142,11 @@ static void test_create_effect_from_file(void)
static
void
test_create_effect_from_resource
(
void
)
{
static
const
WCHAR
*
test_resource_name
=
L"test.fx"
;
HMODULE
resource_module
;
ID3D10Device
*
device
;
ID3D10Effect
*
effect
;
ID3D10Blob
*
errors
;
ULONG
refcount
;
HRESULT
hr
;
...
...
@@ -4153,12 +4156,110 @@ static void test_create_effect_from_resource(void)
return
;
}
hr
=
D3DX10CreateEffectFromResourceA
(
GetModuleHandleA
(
NULL
),
"resource"
,
NULL
,
NULL
,
NULL
,
"fx_4_0"
,
0
,
0
,
device
,
NULL
,
NULL
,
&
effect
,
NULL
,
NULL
);
ok
(
hr
==
D3DX10_ERR_INVALID_DATA
,
"Unexpected hr %#lx.
\n
"
,
hr
);
/* Test NULL module. */
errors
=
(
ID3D10Blob
*
)
0xdeadbeef
;
effect
=
(
ID3D10Effect
*
)
0xdeadbeef
;
hr
=
D3DX10CreateEffectFromResourceW
(
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
device
,
NULL
,
NULL
,
&
effect
,
&
errors
,
NULL
);
ok
(
hr
==
D3DX10_ERR_INVALID_DATA
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
errors
==
(
ID3D10Blob
*
)
0xdeadbeef
,
"Got unexpected errors %p.
\n
"
,
errors
);
ok
(
effect
==
(
ID3D10Effect
*
)
0xdeadbeef
,
"Got unexpected effect %p.
\n
"
,
effect
);
errors
=
(
ID3D10Blob
*
)
0xdeadbeef
;
effect
=
(
ID3D10Effect
*
)
0xdeadbeef
;
hr
=
D3DX10CreateEffectFromResourceA
(
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
device
,
NULL
,
NULL
,
&
effect
,
&
errors
,
NULL
);
ok
(
hr
==
D3DX10_ERR_INVALID_DATA
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
errors
==
(
ID3D10Blob
*
)
0xdeadbeef
,
"Got unexpected errors %p.
\n
"
,
errors
);
ok
(
effect
==
(
ID3D10Effect
*
)
0xdeadbeef
,
"Got unexpected effect %p.
\n
"
,
effect
);
/* Test NULL resource name. */
errors
=
(
ID3D10Blob
*
)
0xdeadbeef
;
effect
=
(
ID3D10Effect
*
)
0xdeadbeef
;
hr
=
D3DX10CreateEffectFromResourceW
(
GetModuleHandleW
(
NULL
),
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
device
,
NULL
,
NULL
,
&
effect
,
&
errors
,
NULL
);
ok
(
hr
==
D3DX10_ERR_INVALID_DATA
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
errors
==
(
ID3D10Blob
*
)
0xdeadbeef
,
"Got unexpected errors %p.
\n
"
,
errors
);
ok
(
effect
==
(
ID3D10Effect
*
)
0xdeadbeef
,
"Got unexpected effect %p.
\n
"
,
effect
);
errors
=
(
ID3D10Blob
*
)
0xdeadbeef
;
effect
=
(
ID3D10Effect
*
)
0xdeadbeef
;
hr
=
D3DX10CreateEffectFromResourceA
(
GetModuleHandleA
(
NULL
),
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
device
,
NULL
,
NULL
,
&
effect
,
&
errors
,
NULL
);
ok
(
hr
==
D3DX10_ERR_INVALID_DATA
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
errors
==
(
ID3D10Blob
*
)
0xdeadbeef
,
"Got unexpected errors %p.
\n
"
,
errors
);
ok
(
effect
==
(
ID3D10Effect
*
)
0xdeadbeef
,
"Got unexpected effect %p.
\n
"
,
effect
);
/* Test non-existent resource name. */
errors
=
(
ID3D10Blob
*
)
0xdeadbeef
;
effect
=
(
ID3D10Effect
*
)
0xdeadbeef
;
hr
=
D3DX10CreateEffectFromResourceW
(
GetModuleHandleW
(
NULL
),
L"deadbeef"
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
device
,
NULL
,
NULL
,
&
effect
,
&
errors
,
NULL
);
ok
(
hr
==
D3DX10_ERR_INVALID_DATA
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
errors
==
(
ID3D10Blob
*
)
0xdeadbeef
,
"Got unexpected errors %p.
\n
"
,
errors
);
ok
(
effect
==
(
ID3D10Effect
*
)
0xdeadbeef
,
"Got unexpected effect %p.
\n
"
,
effect
);
errors
=
(
ID3D10Blob
*
)
0xdeadbeef
;
effect
=
(
ID3D10Effect
*
)
0xdeadbeef
;
hr
=
D3DX10CreateEffectFromResourceA
(
GetModuleHandleA
(
NULL
),
"deadbeef"
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
device
,
NULL
,
NULL
,
&
effect
,
&
errors
,
NULL
);
ok
(
hr
==
D3DX10_ERR_INVALID_DATA
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
errors
==
(
ID3D10Blob
*
)
0xdeadbeef
,
"Got unexpected errors %p.
\n
"
,
errors
);
ok
(
effect
==
(
ID3D10Effect
*
)
0xdeadbeef
,
"Got unexpected effect %p.
\n
"
,
effect
);
/* Test creating effect from compiled shader resource. */
if
(
strcmp
(
winetest_platform
,
"wine"
))
/* Crash on wine. */
{
resource_module
=
create_resource_module
(
test_resource_name
,
test_fx
,
sizeof
(
test_fx
));
errors
=
(
ID3D10Blob
*
)
0xdeadbeef
;
effect
=
(
ID3D10Effect
*
)
0xdeadbeef
;
hr
=
D3DX10CreateEffectFromResourceW
(
resource_module
,
test_resource_name
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
device
,
NULL
,
NULL
,
&
effect
,
&
errors
,
NULL
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
errors
,
"Got unexpected errors %p.
\n
"
,
errors
);
ok
(
!!
effect
&&
effect
!=
(
ID3D10Effect
*
)
0xdeadbeef
,
"Got unexpected effect %p.
\n
"
,
effect
);
effect
->
lpVtbl
->
Release
(
effect
);
errors
=
(
ID3D10Blob
*
)
0xdeadbeef
;
effect
=
(
ID3D10Effect
*
)
0xdeadbeef
;
hr
=
D3DX10CreateEffectFromResourceA
(
resource_module
,
get_str_a
(
test_resource_name
),
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
device
,
NULL
,
NULL
,
&
effect
,
&
errors
,
NULL
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
errors
,
"Got unexpected errors %p.
\n
"
,
errors
);
ok
(
!!
effect
&&
effect
!=
(
ID3D10Effect
*
)
0xdeadbeef
,
"Got unexpected effect %p.
\n
"
,
effect
);
effect
->
lpVtbl
->
Release
(
effect
);
delete_resource_module
(
test_resource_name
,
resource_module
);
}
/* Test creating effect from source resource. */
resource_module
=
create_resource_module
(
test_resource_name
,
test_fx_source
,
strlen
(
test_fx_source
)
+
1
);
errors
=
(
ID3D10Blob
*
)
0xdeadbeef
;
effect
=
(
ID3D10Effect
*
)
0xdeadbeef
;
hr
=
D3DX10CreateEffectFromResourceW
(
resource_module
,
test_resource_name
,
NULL
,
NULL
,
NULL
,
"fx_4_0"
,
0
,
0
,
device
,
NULL
,
NULL
,
&
effect
,
&
errors
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
errors
,
"Got unexpected errors %p.
\n
"
,
errors
);
todo_wine
ok
(
effect
&&
effect
!=
(
ID3D10Effect
*
)
0xdeadbeef
,
"Got unexpected effect %p.
\n
"
,
effect
);
if
(
hr
==
S_OK
)
effect
->
lpVtbl
->
Release
(
effect
);
errors
=
(
ID3D10Blob
*
)
0xdeadbeef
;
effect
=
(
ID3D10Effect
*
)
0xdeadbeef
;
hr
=
D3DX10CreateEffectFromResourceA
(
resource_module
,
get_str_a
(
test_resource_name
),
NULL
,
NULL
,
NULL
,
"fx_4_0"
,
0
,
0
,
device
,
NULL
,
NULL
,
&
effect
,
&
errors
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
errors
,
"Got unexpected errors %p.
\n
"
,
errors
);
todo_wine
ok
(
effect
&&
effect
!=
(
ID3D10Effect
*
)
0xdeadbeef
,
"Got unexpected effect %p.
\n
"
,
effect
);
if
(
hr
==
S_OK
)
effect
->
lpVtbl
->
Release
(
effect
);
delete_resource_module
(
test_resource_name
,
resource_module
);
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"
Unexpected refcount.
\n
"
);
ok
(
!
refcount
,
"
Got unexpected refcount %lu.
\n
"
,
refcount
);
}
static
void
test_preprocess_shader
(
void
)
...
...
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