diff --git a/dlls/d3dcompiler_43/tests/blob.c b/dlls/d3dcompiler_43/tests/blob.c index 95982be0f97..1c89238f068 100644 --- a/dlls/d3dcompiler_43/tests/blob.c +++ b/dlls/d3dcompiler_43/tests/blob.c @@ -251,6 +251,10 @@ static void test_get_blob_part(void) /* D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB */ hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB, 0, &blob); ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL); + + /* 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); } /* @@ -478,6 +482,43 @@ static void test_get_blob_part2(void) refcount = ID3D10Blob_Release(blob); ok(!refcount, "ID3DBlob has %u references left\n", refcount); + + /* D3D_BLOB_ALL_SIGNATURE_BLOB */ + hr = D3DGetBlobPart(test_blob_part2, test_blob_part2[6], D3D_BLOB_ALL_SIGNATURE_BLOB, 0, &blob); + ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK); + + size = ID3D10Blob_GetBufferSize(blob); + ok(size == 344, "GetBufferSize failed, got %lu, expected %u\n", size, 344); + + dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob)); + ok(TAG_DXBC == *dword, "DXBC got %#x, expected %#x.\n", *dword, TAG_DXBC); + ok(TAG_ISGN == *(dword+11), "ISGN got %#x, expected %#x.\n", *(dword+11), TAG_ISGN); + ok(TAG_OSGN == *(dword+24), "OSGN got %#x, expected %#x.\n", *(dword+24), TAG_OSGN); + ok(TAG_PCSG == *(dword+37), "PCSG got %#x, expected %#x.\n", *(dword+37), TAG_PCSG); + + for (i = 0; i < sizeof(parts) / sizeof(parts[0]); i++) + { + hr = D3DGetBlobPart(dword, size, parts[i], 0, &blob2); + + if (parts[i] == D3D_BLOB_ALL_SIGNATURE_BLOB + || parts[i] == D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB + || parts[i] == D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB + || parts[i] == D3D_BLOB_INPUT_SIGNATURE_BLOB + || parts[i] == D3D_BLOB_OUTPUT_SIGNATURE_BLOB) + { + ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK); + + refcount = ID3D10Blob_Release(blob2); + ok(!refcount, "ID3DBlob has %u references left\n", refcount); + } + else + { + 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)