Commit 2728569d authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d10core/tests: Extend test_create_predicate().

parent bd1bb06d
...@@ -1788,25 +1788,41 @@ static void test_create_rasterizer_state(void) ...@@ -1788,25 +1788,41 @@ static void test_create_rasterizer_state(void)
static void test_create_predicate(void) static void test_create_predicate(void)
{ {
static const D3D10_QUERY other_queries[] =
{
D3D10_QUERY_EVENT,
D3D10_QUERY_OCCLUSION,
D3D10_QUERY_TIMESTAMP,
D3D10_QUERY_TIMESTAMP_DISJOINT,
D3D10_QUERY_PIPELINE_STATISTICS,
D3D10_QUERY_SO_STATISTICS,
};
ULONG refcount, expected_refcount; ULONG refcount, expected_refcount;
D3D10_QUERY_DESC query_desc; D3D10_QUERY_DESC query_desc;
ID3D10Predicate *predicate; ID3D10Predicate *predicate;
ID3D10Device *device, *tmp; ID3D10Device *device, *tmp;
IUnknown *iface;
unsigned int i;
HRESULT hr; HRESULT hr;
if (!(device = create_device())) if (!(device = create_device()))
{ {
skip("Failed to create device, skipping tests.\n"); skip("Failed to create device.\n");
return; return;
} }
hr = ID3D10Device_CreatePredicate(device, NULL, &predicate); hr = ID3D10Device_CreatePredicate(device, NULL, &predicate);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
query_desc.Query = D3D10_QUERY_OCCLUSION;
query_desc.MiscFlags = 0; query_desc.MiscFlags = 0;
for (i = 0; i < sizeof(other_queries) / sizeof(*other_queries); ++i)
{
query_desc.Query = other_queries[i];
hr = ID3D10Device_CreatePredicate(device, &query_desc, &predicate); hr = ID3D10Device_CreatePredicate(device, &query_desc, &predicate);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); ok(hr == E_INVALIDARG, "Got unexpected hr %#x for query type %u.\n", hr, other_queries[i]);
}
query_desc.Query = D3D10_QUERY_OCCLUSION_PREDICATE; query_desc.Query = D3D10_QUERY_OCCLUSION_PREDICATE;
expected_refcount = get_refcount((IUnknown *)device) + 1; expected_refcount = get_refcount((IUnknown *)device) + 1;
...@@ -1821,6 +1837,10 @@ static void test_create_predicate(void) ...@@ -1821,6 +1837,10 @@ static void test_create_predicate(void)
refcount = get_refcount((IUnknown *)device); refcount = get_refcount((IUnknown *)device);
ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount);
ID3D10Device_Release(tmp); ID3D10Device_Release(tmp);
hr = ID3D10Predicate_QueryInterface(predicate, &IID_ID3D11Predicate, (void **)&iface);
ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
"Predicate should implement ID3D11Predicate.\n");
if (SUCCEEDED(hr)) IUnknown_Release(iface);
ID3D10Predicate_Release(predicate); ID3D10Predicate_Release(predicate);
query_desc.Query = D3D10_QUERY_SO_OVERFLOW_PREDICATE; query_desc.Query = D3D10_QUERY_SO_OVERFLOW_PREDICATE;
......
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