[PATCH] d3dx9/test: Add D3DXCreateTextureShader tests

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Tue Aug 2 02:48:12 CDT 2016


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/d3dx9_36/tests/shader.c | 49 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c
index 4a7ae67..fe58623 100644
--- a/dlls/d3dx9_36/tests/shader.c
+++ b/dlls/d3dx9_36/tests/shader.c
@@ -6489,6 +6489,54 @@ static void test_registerset_defaults(void)
     if (wnd) DestroyWindow(wnd);
 }
 
+/*
+float4 Noise(float3 pos : POSITION, float3 size : PSIZE) : COLOR
+{
+return float4(.5, .5, .5, .5);
+}
+*/
+static const DWORD texture_noise[] = {
+    0x54580100, 0x0016fffe, 0x42415443, 0x0000001c, 0x0000001f, 0x54580100,
+    0x00000000, 0x00000000, 0x00008100, 0x0000001c, 0x4d007874, 0x6f726369,
+    0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
+    0x656c6970, 0x2e362072, 0x36392e33, 0x312e3030, 0x34383336, 0xababab00,
+    0x000afffe, 0x54494c43, 0x00000004, 0x00000000, 0x3fe00000, 0x00000000,
+    0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0024fffe,
+    0x434c5846, 0x00000004, 0x10000001, 0x00000001, 0x00000000, 0x00000001,
+    0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10000001, 0x00000001,
+    0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
+    0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
+    0x00000004, 0x00000002, 0x10000001, 0x00000001, 0x00000000, 0x00000001,
+    0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
+    0x0000ffff
+};
+
+void test_D3DXCreateTextureShader(void)
+{
+    HRESULT hr;
+    ID3DXTextureShader *shader;
+
+    hr = D3DXCreateTextureShader(NULL, NULL);
+    ok(hr == D3DERR_INVALIDCALL, "got %08x\n", hr);
+
+    hr = D3DXCreateTextureShader(NULL, &shader);
+    ok(hr == D3DERR_INVALIDCALL, "got %08x\n", hr);
+
+    hr = D3DXCreateTextureShader(shader_invalid, &shader);
+    todo_wine ok(hr == D3DXERR_INVALIDDATA, "got %08x\n", hr);
+
+    hr = D3DXCreateTextureShader(shader_zero, &shader);
+    todo_wine ok(hr == D3DXERR_INVALIDDATA, "got %08x\n", hr);
+
+    hr = D3DXCreateTextureShader(shader_empty, &shader);
+    todo_wine ok(hr == D3DXERR_INVALIDDATA, "got %08x\n", hr);
+
+    hr = D3DXCreateTextureShader(texture_noise, &shader);
+    todo_wine ok(hr == S_OK, "got %08x\n", hr);
+    if(hr == S_OK)
+        shader->lpVtbl->Release(shader);
+}
+
 START_TEST(shader)
 {
     test_get_shader_size();
@@ -6502,4 +6550,5 @@ START_TEST(shader)
     test_get_shader_constant_variables();
     test_registerset();
     test_registerset_defaults();
+    test_D3DXCreateTextureShader();
 }
-- 
1.9.1




More information about the wine-patches mailing list