Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/dxgi/tests/dxgi.c | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index b5dcd5b0dea..75c989cfe0b 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -6150,6 +6150,50 @@ static void test_cursor_clipping(IUnknown *device, BOOL is_d3d12) ok(refcount == !is_d3d12, "Got unexpected refcount %u.\n", refcount); }
+static void test_factory_check_feature_support(void) +{ + IDXGIFactory5 *factory; + ULONG ref_count; + HRESULT hr; + BOOL data; + + hr = CreateDXGIFactory(&IID_IDXGIFactory5, (void**)&factory); + if (FAILED(hr)) + { + win_skip("IDXGIFactory5 is not available.\n"); + return; + } + + hr = IDXGIFactory5_CheckFeatureSupport(factory, DXGI_FEATURE_PRESENT_ALLOW_TEARING + 1, + (void *)&data, sizeof(data)); + todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr); + + /* Crash on Windows */ + if (0) + { + hr = IDXGIFactory5_CheckFeatureSupport(factory, DXGI_FEATURE_PRESENT_ALLOW_TEARING, NULL, + sizeof(data)); + ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr); + } + + hr = IDXGIFactory5_CheckFeatureSupport(factory, DXGI_FEATURE_PRESENT_ALLOW_TEARING, &data, + sizeof(data) - 1); + todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr); + + hr = IDXGIFactory5_CheckFeatureSupport(factory, DXGI_FEATURE_PRESENT_ALLOW_TEARING, &data, + sizeof(data) + 1); + todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr); + + data = (BOOL)0xdeadbeef; + hr = IDXGIFactory5_CheckFeatureSupport(factory, DXGI_FEATURE_PRESENT_ALLOW_TEARING, &data, + sizeof(data)); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + todo_wine ok(data == TRUE || data == FALSE, "Got unexpected data %#x.\n", data); + + ref_count = IDXGIFactory5_Release(factory); + ok(!ref_count, "Factory has %u references left.\n", ref_count); +} + static void run_on_d3d10(void (*test_func)(IUnknown *device, BOOL is_d3d12)) { IDXGIDevice *device; @@ -6242,6 +6286,7 @@ START_TEST(dxgi) queue_test(test_output_desc); queue_test(test_object_wrapping); queue_test(test_multi_adapter); + queue_test(test_factory_check_feature_support);
run_queued_tests();
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=69292
Your paranoid android.
=== w8adm (32 bit report) ===
dxgi: dxgi.c:4283: Test failed: Test 1: Got unexpected hr 0x87a0001.
=== w1064v1809_2scr (32 bit report) ===
dxgi: dxgi.c:2069: Test failed: Failed to get monitor info. dxgi.c:2094: Test failed: Got unexpected device name L"\\.\DISPLAY1", expected L"\5b96\77b8\17ec\499a\b458\009b". dxgi.c:2097: Test failed: Got unexpected desktop coordinates (0,0)-(1024,768), expected (0,1946640116)-(0,1946640961).
=== w1064v1809_zh_CN (32 bit report) ===
dxgi: dxgi.c:5200: Test failed: Got unexpected message 0x31f, hwnd 000A0396, wparam 0x1, lparam 0.