d3dcompiler_43/tests: Use CRT allocation functions.
This commit is contained in:
parent
6e45c17182
commit
c64aa0006e
2 changed files with 13 additions and 19 deletions
|
@ -1460,23 +1460,20 @@ static HRESULT WINAPI testD3DInclude_open(ID3DInclude *iface, D3D_INCLUDE_TYPE i
|
|||
|
||||
if (!strcmp(filename, "incl.vsh"))
|
||||
{
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include));
|
||||
CopyMemory(buffer, include, sizeof(include));
|
||||
buffer = strdup(include);
|
||||
*bytes = sizeof(include);
|
||||
ok(!parent_data, "Wrong parent_data value.\n");
|
||||
}
|
||||
else if (!strcmp(filename, "incl2.vsh"))
|
||||
{
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include2));
|
||||
CopyMemory(buffer, include2, sizeof(include2));
|
||||
buffer = strdup(include2);
|
||||
*bytes = sizeof(include2);
|
||||
ok(!parent_data, "Wrong parent_data value.\n");
|
||||
ok(include_type == D3D_INCLUDE_LOCAL, "Wrong include type %d.\n", include_type);
|
||||
}
|
||||
else if (!strcmp(filename, "incl3.vsh"))
|
||||
{
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include3));
|
||||
CopyMemory(buffer, include3, sizeof(include3));
|
||||
buffer = strdup(include3);
|
||||
*bytes = sizeof(include3);
|
||||
/* Also check for the correct parent_data content */
|
||||
ok(parent_data != NULL
|
||||
|
@ -1486,16 +1483,14 @@ static HRESULT WINAPI testD3DInclude_open(ID3DInclude *iface, D3D_INCLUDE_TYPE i
|
|||
}
|
||||
else if (!strcmp(filename, "incl4.vsh"))
|
||||
{
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include4));
|
||||
CopyMemory(buffer, include4, sizeof(include4));
|
||||
buffer = strdup(include4);
|
||||
*bytes = sizeof(include4);
|
||||
ok(parent_data == NULL, "Wrong parent_data value.\n");
|
||||
ok(include_type == D3D_INCLUDE_SYSTEM, "Wrong include type %d.\n", include_type);
|
||||
}
|
||||
else if (!strcmp(filename, "includes/incl.vsh"))
|
||||
{
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include));
|
||||
CopyMemory(buffer, include, sizeof(include));
|
||||
buffer = strdup(include);
|
||||
*bytes = sizeof(include);
|
||||
ok(!parent_data, "Wrong parent_data value.\n");
|
||||
}
|
||||
|
@ -1512,7 +1507,7 @@ static HRESULT WINAPI testD3DInclude_open(ID3DInclude *iface, D3D_INCLUDE_TYPE i
|
|||
|
||||
static HRESULT WINAPI testD3DInclude_close(ID3DInclude *iface, const void *data)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, (void *)data);
|
||||
free((void *)data);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
#define COBJMACROS
|
||||
#include "wine/test.h"
|
||||
#include "wine/heap.h"
|
||||
#include "d3dx9.h"
|
||||
#include "d3dcompiler.h"
|
||||
|
||||
|
@ -1515,26 +1514,26 @@ static HRESULT WINAPI test_d3dinclude_open(ID3DInclude *iface, D3D_INCLUDE_TYPE
|
|||
|
||||
if (!strcmp(filename, "include1.h"))
|
||||
{
|
||||
buffer = heap_alloc(strlen(include1));
|
||||
CopyMemory(buffer, include1, strlen(include1));
|
||||
buffer = strdup(include1);
|
||||
*bytes = strlen(include1);
|
||||
buffer[*bytes] = '$'; /* everything should still work without a null terminator */
|
||||
ok(include_type == D3D_INCLUDE_LOCAL, "Unexpected include type %d.\n", include_type);
|
||||
ok(!strncmp(include2, parent_data, strlen(include2)) || !strncmp(include3, parent_data, strlen(include3)),
|
||||
"Unexpected parent_data value.\n");
|
||||
}
|
||||
else if (!strcmp(filename, "include\\include2.h"))
|
||||
{
|
||||
buffer = heap_alloc(strlen(include2));
|
||||
CopyMemory(buffer, include2, strlen(include2));
|
||||
buffer = strdup(include2);
|
||||
*bytes = strlen(include2);
|
||||
buffer[*bytes] = '$'; /* everything should still work without a null terminator */
|
||||
ok(!parent_data, "Unexpected parent_data value.\n");
|
||||
ok(include_type == D3D_INCLUDE_LOCAL, "Unexpected include type %d.\n", include_type);
|
||||
}
|
||||
else if (!strcmp(filename, "include\\include3.h"))
|
||||
{
|
||||
buffer = heap_alloc(strlen(include3));
|
||||
CopyMemory(buffer, include3, strlen(include3));
|
||||
buffer = strdup(include3);
|
||||
*bytes = strlen(include3);
|
||||
buffer[*bytes] = '$'; /* everything should still work without a null terminator */
|
||||
ok(!parent_data, "Unexpected parent_data value.\n");
|
||||
ok(include_type == D3D_INCLUDE_LOCAL, "Unexpected include type %d.\n", include_type);
|
||||
}
|
||||
|
@ -1550,7 +1549,7 @@ static HRESULT WINAPI test_d3dinclude_open(ID3DInclude *iface, D3D_INCLUDE_TYPE
|
|||
|
||||
static HRESULT WINAPI test_d3dinclude_close(ID3DInclude *iface, const void *data)
|
||||
{
|
||||
heap_free((void *)data);
|
||||
free((void *)data);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue