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
b99ea513
Commit
b99ea513
authored
Oct 29, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Oct 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core/tests: Use CRT allocation functions.
parent
fd00d8e4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
d3d10core.c
dlls/d3d10core/tests/d3d10core.c
+19
-20
No files found.
dlls/d3d10core/tests/d3d10core.c
View file @
b99ea513
...
...
@@ -23,7 +23,6 @@
#define COBJMACROS
#include "initguid.h"
#include "d3d11_4.h"
#include "wine/heap.h"
#include "wine/wined3d.h"
#include "wine/test.h"
...
...
@@ -88,7 +87,7 @@ static void queue_test(void (*test)(void))
if
(
mt_test_count
>=
mt_tests_size
)
{
mt_tests_size
=
max
(
16
,
mt_tests_size
*
2
);
mt_tests
=
heap_
realloc
(
mt_tests
,
mt_tests_size
*
sizeof
(
*
mt_tests
));
mt_tests
=
realloc
(
mt_tests
,
mt_tests_size
*
sizeof
(
*
mt_tests
));
}
mt_tests
[
mt_test_count
++
].
test
=
test
;
}
...
...
@@ -126,7 +125,7 @@ static void run_queued_tests(void)
GetSystemInfo
(
&
si
);
thread_count
=
si
.
dwNumberOfProcessors
;
threads
=
heap_
calloc
(
thread_count
,
sizeof
(
*
threads
));
threads
=
calloc
(
thread_count
,
sizeof
(
*
threads
));
for
(
i
=
0
,
test_idx
=
0
;
i
<
thread_count
;
++
i
)
{
threads
[
i
]
=
CreateThread
(
NULL
,
0
,
thread_func
,
&
test_idx
,
0
,
NULL
);
...
...
@@ -137,7 +136,7 @@ static void run_queued_tests(void)
{
CloseHandle
(
threads
[
i
]);
}
heap_
free
(
threads
);
free
(
threads
);
}
static
void
set_box
(
D3D10_BOX
*
box
,
UINT
left
,
UINT
top
,
UINT
front
,
UINT
right
,
UINT
bottom
,
UINT
back
)
...
...
@@ -3249,7 +3248,7 @@ static void test_render_target_views(void)
texture_desc
.
CPUAccessFlags
=
0
;
texture_desc
.
MiscFlags
=
0
;
data
=
heap_alloc_zero
(
texture_desc
.
Width
*
texture_desc
.
Height
*
4
);
data
=
calloc
(
texture_desc
.
Width
*
texture_desc
.
Height
,
4
);
ok
(
!!
data
,
"Failed to allocate memory.
\n
"
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
++
i
)
...
...
@@ -3290,7 +3289,7 @@ static void test_render_target_views(void)
ID3D10Texture2D_Release
(
texture
);
}
heap_
free
(
data
);
free
(
data
);
release_test_context
(
&
test_context
);
}
...
...
@@ -10441,7 +10440,7 @@ static void test_resource_access(void)
data
.
SysMemPitch
=
0
;
data
.
SysMemSlicePitch
=
0
;
data
.
pSysMem
=
heap_
alloc
(
10240
);
data
.
pSysMem
=
m
alloc
(
10240
);
ok
(
!!
data
.
pSysMem
,
"Failed to allocate memory.
\n
"
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
++
i
)
...
...
@@ -10588,7 +10587,7 @@ static void test_resource_access(void)
}
}
heap_
free
((
void
*
)
data
.
pSysMem
);
free
((
void
*
)
data
.
pSysMem
);
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
);
...
...
@@ -15036,7 +15035,7 @@ static void test_buffer_srv(void)
resource_data
.
SysMemSlicePitch
=
0
;
if
(
current_buffer
->
data_offset
)
{
data
=
heap_alloc_zero
(
current_buffer
->
byte_count
);
data
=
calloc
(
1
,
current_buffer
->
byte_count
);
ok
(
!!
data
,
"Failed to allocate memory.
\n
"
);
memcpy
(
data
+
current_buffer
->
data_offset
,
current_buffer
->
data
,
current_buffer
->
byte_count
-
current_buffer
->
data_offset
);
...
...
@@ -15048,7 +15047,7 @@ static void test_buffer_srv(void)
}
hr
=
ID3D10Device_CreateBuffer
(
device
,
&
buffer_desc
,
&
resource_data
,
&
buffer
);
ok
(
SUCCEEDED
(
hr
),
"Test %u: Failed to create buffer, hr %#lx.
\n
"
,
i
,
hr
);
heap_
free
(
data
);
free
(
data
);
}
else
{
...
...
@@ -16100,7 +16099,7 @@ static void test_depth_bias(void)
rasterizer_desc
.
SlopeScaledDepthBias
=
0
.
0
f
;
rasterizer_desc
.
DepthClipEnable
=
TRUE
;
depth_values
=
heap_
calloc
(
swapchain_desc
.
height
,
sizeof
(
*
depth_values
));
depth_values
=
calloc
(
swapchain_desc
.
height
,
sizeof
(
*
depth_values
));
ok
(
!!
depth_values
,
"Failed to allocate memory.
\n
"
);
for
(
format_idx
=
0
;
format_idx
<
ARRAY_SIZE
(
formats
);
++
format_idx
)
...
...
@@ -16307,7 +16306,7 @@ static void test_depth_bias(void)
winetest_pop_context
();
}
heap_
free
(
depth_values
);
free
(
depth_values
);
release_test_context
(
&
test_context
);
}
...
...
@@ -17301,7 +17300,7 @@ static void test_generate_mips(void)
device
=
test_context
.
device
;
data
=
heap_
alloc
(
sizeof
(
*
data
)
*
32
*
32
*
32
);
data
=
m
alloc
(
sizeof
(
*
data
)
*
32
*
32
*
32
);
for
(
z
=
0
;
z
<
32
;
++
z
)
{
...
...
@@ -17328,7 +17327,7 @@ static void test_generate_mips(void)
}
}
zero_data
=
heap_alloc_zero
(
sizeof
(
*
zero_data
)
*
16
*
16
*
16
);
zero_data
=
calloc
(
16
*
16
*
16
,
sizeof
(
*
zero_data
)
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
resource_types
);
++
i
)
{
...
...
@@ -17472,8 +17471,8 @@ static void test_generate_mips(void)
if
(
is_warp_device
(
device
))
{
win_skip
(
"Creating the next texture crashes WARP on some testbot boxes.
\n
"
);
heap_
free
(
zero_data
);
heap_
free
(
data
);
free
(
zero_data
);
free
(
data
);
release_test_context
(
&
test_context
);
return
;
}
...
...
@@ -17541,8 +17540,8 @@ static void test_generate_mips(void)
ID3D10Resource_Release
(
resource
);
heap_
free
(
zero_data
);
heap_
free
(
data
);
free
(
zero_data
);
free
(
data
);
release_test_context
(
&
test_context
);
}
...
...
@@ -19069,7 +19068,7 @@ static void test_texture_compressed_3d(void)
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
/* Simply test all combinations of r0 and r1. */
texture_data
=
heap_
alloc
(
256
*
256
*
sizeof
(
UINT64
));
texture_data
=
m
alloc
(
256
*
256
*
sizeof
(
UINT64
));
for
(
r1
=
0
;
r1
<
256
;
++
r1
)
{
for
(
r0
=
0
;
r0
<
256
;
++
r0
)
...
...
@@ -19094,7 +19093,7 @@ static void test_texture_compressed_3d(void)
texture_desc
.
MiscFlags
=
0
;
hr
=
ID3D10Device_CreateTexture3D
(
device
,
&
texture_desc
,
&
resource_data
,
&
texture
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
heap_
free
(
texture_data
);
free
(
texture_data
);
hr
=
ID3D10Device_CreateShaderResourceView
(
device
,
(
ID3D10Resource
*
)
texture
,
NULL
,
&
srv
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
...
...
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