From 3c12dd345d6fe6919312a7318ee03c9b4038126b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rico=20Sch=C3=BCller?= Date: Thu, 14 Oct 2010 21:03:47 +0200 Subject: [PATCH] d3dcompiler/tests: Add D3D_BLOB_DEBUG_INFO test. --- dlls/d3dcompiler_43/tests/blob.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dlls/d3dcompiler_43/tests/blob.c b/dlls/d3dcompiler_43/tests/blob.c index 1c89238f068..f0510e02856 100644 --- a/dlls/d3dcompiler_43/tests/blob.c +++ b/dlls/d3dcompiler_43/tests/blob.c @@ -255,6 +255,10 @@ static void test_get_blob_part(void) /* D3D_BLOB_ALL_SIGNATURE_BLOB */ hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_ALL_SIGNATURE_BLOB, 0, &blob); ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL); + + /* 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); } /* @@ -519,6 +523,26 @@ static void test_get_blob_part2(void) refcount = ID3D10Blob_Release(blob); ok(!refcount, "ID3DBlob has %u references left\n", refcount); + + /* D3D_BLOB_DEBUG_INFO */ + hr = D3DGetBlobPart(test_blob_part2, test_blob_part2[6], D3D_BLOB_DEBUG_INFO, 0, &blob); + ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK); + + size = ID3D10Blob_GetBufferSize(blob); + ok(size == 4055, "GetBufferSize failed, got %lu, expected %u\n", size, 4055); + + dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob)); + ok(TAG_DXBC != *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_DEBUG_INFO */ + 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); } START_TEST(blob)