Commit 7e024ea9 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d11/tests: Extend queries tests.

parent cde106d2
......@@ -4733,10 +4733,13 @@ static void test_occlusion_query(void)
data_size = ID3D11Asynchronous_GetDataSize(query);
ok(data_size == sizeof(data), "Got unexpected data size %u.\n", data_size);
memset(&data, 0xff, sizeof(data));
hr = ID3D11DeviceContext_GetData(context, query, NULL, 0, 0);
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(data), 0);
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
todo_wine ok(data.dword[0] == 0xffffffff && data.dword[1] == 0xffffffff,
"Data was modified 0x%08x%08x.\n", data.dword[1], data.dword[0]);
ID3D11DeviceContext_End(context, query);
ID3D11DeviceContext_Begin(context, query);
......@@ -4897,8 +4900,27 @@ static void test_timestamp_query(void)
data_size = ID3D11Asynchronous_GetDataSize(timestamp_disjoint_query);
ok(data_size == sizeof(disjoint), "Got unexpected data size %u.\n", data_size);
disjoint.Frequency = 0xdeadbeef;
disjoint.Disjoint = 0xdeadbeef;
hr = ID3D11DeviceContext_GetData(context, timestamp_disjoint_query, NULL, 0, 0);
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_GetData(context, timestamp_disjoint_query, &disjoint, sizeof(disjoint), 0);
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
todo_wine ok(disjoint.Frequency == 0xdeadbeef, "Frequency data was modified.\n");
todo_wine ok(disjoint.Disjoint == 0xdeadbeef, "Disjoint data was modified.\n");
/* Test a TIMESTAMP_DISJOINT query. */
ID3D11DeviceContext_Begin(context, timestamp_disjoint_query);
disjoint.Frequency = 0xdeadbeef;
disjoint.Disjoint = 0xdeadbeef;
hr = ID3D11DeviceContext_GetData(context, timestamp_disjoint_query, NULL, 0, 0);
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_GetData(context, timestamp_disjoint_query, &disjoint, sizeof(disjoint), 0);
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
ok(disjoint.Frequency == 0xdeadbeef, "Frequency data was modified.\n");
ok(disjoint.Disjoint == 0xdeadbeef, "Disjoint data was modified.\n");
ID3D11DeviceContext_End(context, timestamp_disjoint_query);
for (i = 0; i < 500; ++i)
{
......@@ -4937,16 +4959,20 @@ static void test_timestamp_query(void)
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(!memcmp(&disjoint, &prev_disjoint, sizeof(disjoint)), "Disjoint data mismatch.\n");
memset(&timestamp, 0xff, sizeof(timestamp));
hr = ID3D11DeviceContext_GetData(context, timestamp_query, NULL, 0, 0);
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_GetData(context, timestamp_query, &timestamp, sizeof(timestamp), 0);
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
todo_wine ok(timestamp == ~(UINT64)0, "Timestamp data was modified.\n");
/* Test a TIMESTAMP query inside a TIMESTAMP_DISJOINT query. */
ID3D11DeviceContext_Begin(context, timestamp_disjoint_query);
memset(&timestamp, 0xff, sizeof(timestamp));
hr = ID3D11DeviceContext_GetData(context, timestamp_query, &timestamp, sizeof(timestamp), 0);
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
todo_wine ok(timestamp == ~(UINT64)0, "Timestamp data was modified.\n");
draw_color_quad(&test_context, &red);
......
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