[PATCH 3/9] d3d11/tests: Extend queries tests.
Józef Kucia
jkucia at codeweavers.com
Fri Feb 3 07:08:44 CST 2017
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
dlls/d3d11/tests/d3d11.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index b4f4eef..c63a6d9 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -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(×tamp, 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, ×tamp, 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(×tamp, 0xff, sizeof(timestamp));
hr = ID3D11DeviceContext_GetData(context, timestamp_query, ×tamp, 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);
--
2.10.2
More information about the wine-patches
mailing list