Commit a08bb2f0 authored by Alexandre Julliard's avatar Alexandre Julliard

d3d9: Don't depend on the dxerr9 static library in the tests.

parent f98157f6
......@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = d3d9.dll
IMPORTS = dxerr9 user32 kernel32
IMPORTS = user32 kernel32
CTESTS = \
d3d9ex.c \
......
......@@ -23,7 +23,6 @@
#define COBJMACROS
#include <initguid.h>
#include <d3d9.h>
#include <dxerr9.h>
#include "wine/test.h"
static HMODULE d3d9_handle = 0;
......@@ -64,8 +63,8 @@ static void test_qi_base_to_ex(void)
hr = IDirect3D9_QueryInterface(d3d9, &IID_IDirect3D9Ex, (void **) &d3d9ex);
ok(hr == E_NOINTERFACE,
"IDirect3D9::QueryInterface for IID_IDirect3D9Ex returned %s, expected E_NOINTERFACE\n",
DXGetErrorString9(hr));
"IDirect3D9::QueryInterface for IID_IDirect3D9Ex returned %08x, expected E_NOINTERFACE\n",
hr);
ok(d3d9ex == NULL, "QueryInterface returned interface %p, expected NULL\n", d3d9ex);
if(d3d9ex) IDirect3D9Ex_Release(d3d9ex);
......@@ -85,8 +84,8 @@ static void test_qi_base_to_ex(void)
hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9Ex, (void **) &deviceEx);
ok(hr == E_NOINTERFACE,
"IDirect3D9Device::QueryInterface for IID_IDirect3DDevice9Ex returned %s, expected E_NOINTERFACE\n",
DXGetErrorString9(hr));
"IDirect3D9Device::QueryInterface for IID_IDirect3DDevice9Ex returned %08x, expected E_NOINTERFACE\n",
hr);
ok(deviceEx == NULL, "QueryInterface returned interface %p, expected NULL\n", deviceEx);
if(deviceEx) IDirect3DDevice9Ex_Release(deviceEx);
......@@ -109,7 +108,7 @@ static void test_qi_ex_to_base(void)
unsigned long ref;
hr = pDirect3DCreate9Ex(D3D_SDK_VERSION, &d3d9ex);
ok(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE, "Direct3DCreate9Ex returned %s\n", DXGetErrorString9(hr));
ok(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE, "Direct3DCreate9Ex returned %08x\n", hr);
if(FAILED(hr)) {
skip("Direct3D9Ex is not available\n");
goto out;
......@@ -117,8 +116,8 @@ static void test_qi_ex_to_base(void)
hr = IDirect3D9Ex_QueryInterface(d3d9ex, &IID_IDirect3D9, (void **) &d3d9);
ok(hr == D3D_OK,
"IDirect3D9Ex::QueryInterface for IID_IDirect3D9 returned %s, expected D3D_OK\n",
DXGetErrorString9(hr));
"IDirect3D9Ex::QueryInterface for IID_IDirect3D9 returned %08x, expected D3D_OK\n",
hr);
ok(d3d9 != NULL && d3d9 != (void *) 0xdeadbeef,
"QueryInterface returned interface %p, expected != NULL && != 0xdeadbeef\n", d3d9);
ref = getref((IUnknown *) d3d9ex);
......@@ -144,8 +143,8 @@ static void test_qi_ex_to_base(void)
hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9Ex, (void **) &deviceEx);
ok(hr == D3D_OK,
"IDirect3D9Device::QueryInterface for IID_IDirect3DDevice9Ex returned %s, expected D3D_OK\n",
DXGetErrorString9(hr));
"IDirect3D9Device::QueryInterface for IID_IDirect3DDevice9Ex returned %08x, expected D3D_OK\n",
hr);
ok(deviceEx != NULL && deviceEx != (void *) 0xdeadbeef,
"QueryInterface returned interface %p, expected != NULL && != 0xdeadbeef\n", deviceEx);
ref = getref((IUnknown *) device);
......@@ -164,8 +163,8 @@ static void test_qi_ex_to_base(void)
hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9Ex, (void **) &deviceEx);
ok(hr == D3D_OK,
"IDirect3D9Device::QueryInterface for IID_IDirect3DDevice9Ex returned %s, expected D3D_OK\n",
DXGetErrorString9(hr));
"IDirect3D9Device::QueryInterface for IID_IDirect3DDevice9Ex returned %08x, expected D3D_OK\n",
hr);
ok(deviceEx != NULL && deviceEx != (void *) 0xdeadbeef,
"QueryInterface returned interface %p, expected != NULL && != 0xdeadbeef\n", deviceEx);
ref = getref((IUnknown *) device);
......
......@@ -18,7 +18,6 @@
#define COBJMACROS
#include <d3d9.h>
#include <dxerr9.h>
#include "wine/test.h"
static IDirect3D9 *(WINAPI *pDirect3DCreate9)(UINT);
......@@ -96,7 +95,7 @@ static void test_query_support(IDirect3D9 *pD3d, HWND hwnd)
hr = IDirect3D9_CreateDevice( pD3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDevice );
ok(SUCCEEDED(hr) || hr == D3DERR_NOTAVAILABLE, "Failed to create IDirect3D9Device (%s)\n", DXGetErrorString9(hr));
ok(SUCCEEDED(hr) || hr == D3DERR_NOTAVAILABLE, "Failed to create IDirect3D9Device (%08x)\n", hr);
if (FAILED(hr))
{
skip("Failed to create a d3d device\n");
......@@ -107,7 +106,7 @@ static void test_query_support(IDirect3D9 *pD3d, HWND hwnd)
{
hr = IDirect3DDevice9_CreateQuery(pDevice, queries[i].type, NULL);
ok(hr == D3D_OK || D3DERR_NOTAVAILABLE,
"IDirect3DDevice9_CreateQuery returned unexpected return value %s for query %s\n", DXGetErrorString9(hr), queryName(queries[i].type));
"IDirect3DDevice9_CreateQuery returned unexpected return value %08x for query %s\n", hr, queryName(queries[i].type));
supported = (hr == D3D_OK ? TRUE : FALSE);
trace("query %s is %s\n", queryName(queries[i].type), supported ? "supported" : "not supported");
......@@ -121,7 +120,7 @@ static void test_query_support(IDirect3D9 *pD3d, HWND hwnd)
hr = IDirect3DDevice9_CreateQuery(pDevice, queries[i].type, &pQuery);
ok(hr == D3D_OK || D3DERR_NOTAVAILABLE,
"IDirect3DDevice9_CreateQuery returned unexpected return value %s for query %s\n", DXGetErrorString9(hr), queryName(queries[i].type));
"IDirect3DDevice9_CreateQuery returned unexpected return value %08x for query %s\n", hr, queryName(queries[i].type));
ok(!(supported && !pQuery), "Query %s was claimed to be supported, but can't be created\n", queryName(queries[i].type));
ok(!(!supported && pQuery), "Query %s was claimed not to be supported, but can be created\n", queryName(queries[i].type));
if(pQuery)
......@@ -156,7 +155,7 @@ static void test_occlusion_query_states(IDirect3D9 *pD3d, HWND hwnd)
hr = IDirect3D9_CreateDevice( pD3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDevice );
ok(SUCCEEDED(hr) || hr == D3DERR_NOTAVAILABLE, "Failed to create IDirect3D9Device (%s)\n", DXGetErrorString9(hr));
ok(SUCCEEDED(hr) || hr == D3DERR_NOTAVAILABLE, "Failed to create IDirect3D9Device (%08x)\n", hr);
if (FAILED(hr))
{
skip("Failed to create a d3d device\n");
......@@ -165,7 +164,7 @@ static void test_occlusion_query_states(IDirect3D9 *pD3d, HWND hwnd)
hr = IDirect3DDevice9_CreateQuery(pDevice, D3DQUERYTYPE_OCCLUSION, &pQuery);
ok(hr == D3D_OK || D3DERR_NOTAVAILABLE,
"IDirect3DDevice9_CreateQuery returned unexpected return value %s\n", DXGetErrorString9(hr));
"IDirect3DDevice9_CreateQuery returned unexpected return value %08x\n", hr);
if(!pQuery) {
skip("Occlusion queries not supported\n");
goto cleanup;
......@@ -174,72 +173,58 @@ static void test_occlusion_query_states(IDirect3D9 *pD3d, HWND hwnd)
data = HeapAlloc(GetProcessHeap(), 0, IDirect3DQuery9_GetDataSize(pQuery));
hr = IDirect3DQuery9_GetData(pQuery, NULL, 0, D3DGETDATA_FLUSH);
ok(hr == S_OK, "IDirect3DQuery9_GetData(NULL) on a new query returned %s\n",
DXGetErrorString9(hr));
ok(hr == S_OK, "IDirect3DQuery9_GetData(NULL) on a new query returned %08x\n", hr);
hr = IDirect3DQuery9_GetData(pQuery, data, IDirect3DQuery9_GetDataSize(pQuery), D3DGETDATA_FLUSH);
ok(hr == S_OK, "IDirect3DQuery9_GetData on a new query returned %s\n",
DXGetErrorString9(hr));
ok(hr == S_OK, "IDirect3DQuery9_GetData on a new query returned %08x\n", hr);
hr = IDirect3DQuery9_Issue(pQuery, D3DISSUE_END);
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DISSUE_END) on a new not yet started query returned %s\n",
DXGetErrorString9(hr));
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DISSUE_END) on a new not yet started query returned %08x\n", hr);
hr = IDirect3DQuery9_Issue(pQuery, D3DISSUE_BEGIN);
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DISSUE_BEGIN) on a new not yet started query returned %s\n",
DXGetErrorString9(hr));
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DISSUE_BEGIN) on a new not yet started query returned %08x\n", hr);
hr = IDirect3DQuery9_Issue(pQuery, D3DISSUE_BEGIN);
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DQUERY_BEGIN) on a started query returned %s\n",
DXGetErrorString9(hr));
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DQUERY_BEGIN) on a started query returned %08x\n", hr);
hr = IDirect3DQuery9_GetData(pQuery, NULL, 0, D3DGETDATA_FLUSH);
ok(hr == S_FALSE, "IDirect3DQuery9_GetData(NULL) on a started query returned %s\n",
DXGetErrorString9(hr));
ok(hr == S_FALSE, "IDirect3DQuery9_GetData(NULL) on a started query returned %08x\n", hr);
hr = IDirect3DQuery9_GetData(pQuery, data, IDirect3DQuery9_GetDataSize(pQuery), D3DGETDATA_FLUSH);
ok(hr == S_FALSE, "IDirect3DQuery9_GetData on a started query returned %s\n",
DXGetErrorString9(hr));
ok(hr == S_FALSE, "IDirect3DQuery9_GetData on a started query returned %08x\n", hr);
hr = IDirect3DDevice9_SetFVF(pDevice, D3DFVF_XYZ);
ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %s\n", DXGetErrorString9(hr));
ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %08x\n", hr);
hr = IDirect3DDevice9_BeginScene(pDevice);
ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %s\n", DXGetErrorString9(hr));
ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr);
if(SUCCEEDED(hr)) {
hr = IDirect3DDevice9_DrawPrimitiveUP(pDevice, D3DPT_POINTLIST, 1, point, 3 * sizeof(float));
ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP returned %s\n", DXGetErrorString9(hr));
ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP returned %08x\n", hr);
hr = IDirect3DDevice9_EndScene(pDevice);
ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %s\n", DXGetErrorString9(hr));
ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr);
}
hr = IDirect3DQuery9_Issue(pQuery, D3DISSUE_END);
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DISSUE_END) on a started query returned %s\n",
DXGetErrorString9(hr));
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DISSUE_END) on a started query returned %08x\n", hr);
hr = S_FALSE;
while(hr == S_FALSE && count < 500) {
hr = IDirect3DQuery9_GetData(pQuery, NULL, 0, D3DGETDATA_FLUSH);
ok(hr == S_OK || hr == S_FALSE, "IDirect3DQuery9_GetData on a ended query returned %s\n",
DXGetErrorString9(hr));
ok(hr == S_OK || hr == S_FALSE, "IDirect3DQuery9_GetData on a ended query returned %08x\n", hr);
count++;
if(hr == S_FALSE) Sleep(10);
}
ok(hr == S_OK, "Occlusion query did not finish\n");
hr = IDirect3DQuery9_GetData(pQuery, data, IDirect3DQuery9_GetDataSize(pQuery), D3DGETDATA_FLUSH);
ok(hr == S_OK, "IDirect3DQuery9_GetData on a ended query returned %s\n",
DXGetErrorString9(hr));
ok(hr == S_OK, "IDirect3DQuery9_GetData on a ended query returned %08x\n", hr);
hr = IDirect3DQuery9_GetData(pQuery, data, IDirect3DQuery9_GetDataSize(pQuery), D3DGETDATA_FLUSH);
ok(hr == S_OK, "IDirect3DQuery9_GetData a 2nd time on a ended query returned %s\n",
DXGetErrorString9(hr));
ok(hr == S_OK, "IDirect3DQuery9_GetData a 2nd time on a ended query returned %08x\n", hr);
hr = IDirect3DQuery9_Issue(pQuery, D3DISSUE_BEGIN);
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DISSUE_BEGIN) on a new not yet started query returned %s\n",
DXGetErrorString9(hr));
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DISSUE_BEGIN) on a new not yet started query returned %08x\n", hr);
hr = IDirect3DQuery9_Issue(pQuery, D3DISSUE_END);
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DISSUE_END) on a started query returned %s\n",
DXGetErrorString9(hr));
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DISSUE_END) on a started query returned %08x\n", hr);
hr = IDirect3DQuery9_Issue(pQuery, D3DISSUE_END);
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DISSUE_END) on a ended query returned %s\n",
DXGetErrorString9(hr));
ok(hr == D3D_OK, "IDirect3DQuery9_Issue(D3DISSUE_END) on a ended query returned %08x\n", hr);
cleanup:
HeapFree(GetProcessHeap(), 0, data);
......
......@@ -17,7 +17,6 @@
*/
#define COBJMACROS
#include <d3d9.h>
#include <dxerr9.h>
#include "wine/test.h"
static HWND create_window(void)
......@@ -150,7 +149,7 @@ static void test_surface_alignment(IDirect3DDevice9 *device_ptr)
hr = IDirect3DDevice9_CreateTexture(device_ptr, 64, 64, 0, 0, MAKEFOURCC('D', 'X', 'T', '1'+i),
D3DPOOL_MANAGED, &pTexture, NULL);
ok(SUCCEEDED(hr) || hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_CreateTexture: %s\n", DXGetErrorString9(hr));
ok(SUCCEEDED(hr) || hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_CreateTexture: %08x\n", hr);
if (FAILED(hr)) {
skip("DXT%d surfaces are not supported\n", i + 1);
continue;
......@@ -163,7 +162,7 @@ static void test_surface_alignment(IDirect3DDevice9 *device_ptr)
IDirect3DTexture9_GetLevelDesc(pTexture, j, &descr);
hr = IDirect3DTexture9_LockRect(pTexture, j, &rc, NULL, 0);
ok(SUCCEEDED(hr), "IDirect3DTexture9_LockRect: %s\n", DXGetErrorString9(hr));
ok(SUCCEEDED(hr), "IDirect3DTexture9_LockRect: %08x\n", hr);
IDirect3DTexture9_UnlockRect(pTexture, j);
pitch = ((descr.Width + 3) >> 2) << 3;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment