Rico Schüller : d3dcompiler/tests: Add D3D_BLOB_LEGACY_SHADER test.

Alexandre Julliard julliard at winehq.org
Fri Oct 15 10:40:26 CDT 2010


Module: wine
Branch: master
Commit: c5d601c199df7183741795f1dd6f5882b7fda4ea
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c5d601c199df7183741795f1dd6f5882b7fda4ea

Author: Rico Schüller <kgbricola at web.de>
Date:   Thu Oct 14 21:03:51 2010 +0200

d3dcompiler/tests: Add D3D_BLOB_LEGACY_SHADER test.

---

 dlls/d3dcompiler_43/tests/blob.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/dlls/d3dcompiler_43/tests/blob.c b/dlls/d3dcompiler_43/tests/blob.c
index f0510e0..216afd4 100644
--- a/dlls/d3dcompiler_43/tests/blob.c
+++ b/dlls/d3dcompiler_43/tests/blob.c
@@ -259,6 +259,26 @@ static void test_get_blob_part(void)
     /* D3D_BLOB_DEBUG_INFO */
     hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_DEBUG_INFO, 0, &blob);
     ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
+
+    /* D3D_BLOB_LEGACY_SHADER */
+    hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_LEGACY_SHADER, 0, &blob);
+    ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
+
+    size = ID3D10Blob_GetBufferSize(blob);
+    ok(size == 92, "GetBufferSize failed, got %lu, expected %u\n", size, 92);
+
+    dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
+    ok(test_blob_part[0] != *dword, "DXBC failed got %#x.\n", *dword);
+
+    for (i = 0; i < sizeof(parts) / sizeof(parts[0]); i++)
+    {
+        /* There isn't a full DXBC blob returned for D3D_BLOB_LEGACY_SHADER */
+        hr = D3DGetBlobPart(dword, size, parts[i], 0, &blob2);
+        ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
+    }
+
+    refcount = ID3D10Blob_Release(blob);
+    ok(!refcount, "ID3DBlob has %u references left\n", refcount);
 }
 
 /*
@@ -543,6 +563,10 @@ static void test_get_blob_part2(void)
 
     refcount = ID3D10Blob_Release(blob);
     ok(!refcount, "ID3DBlob has %u references left\n", refcount);
+
+    /* D3D_BLOB_LEGACY_SHADER */
+    hr = D3DGetBlobPart(test_blob_part2, test_blob_part2[6], D3D_BLOB_LEGACY_SHADER, 0, &blob);
+    ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
 }
 
 START_TEST(blob)




More information about the wine-cvs mailing list