=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: dxgi/tests: Add test for creating IDXGIFactory2.

Alexandre Julliard julliard at winehq.org
Fri Jan 19 15:43:21 CST 2018


Module: wine
Branch: master
Commit: b2192ea19a1e61cef7d252336d480e83cd09e1db
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b2192ea19a1e61cef7d252336d480e83cd09e1db

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Fri Jan 19 13:30:11 2018 +0100

dxgi/tests: Add test for creating IDXGIFactory2.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dxgi/tests/device.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c
index a102ed8..89e9279 100644
--- a/dlls/dxgi/tests/device.c
+++ b/dlls/dxgi/tests/device.c
@@ -19,6 +19,7 @@
 #include <assert.h>
 #define COBJMACROS
 #include "initguid.h"
+#include "dxgi1_6.h"
 #include "d3d11.h"
 #include "wine/test.h"
 
@@ -2305,6 +2306,7 @@ static void test_create_factory(void)
 {
     IDXGIFactory1 *factory;
     IUnknown *iface;
+    ULONG refcount;
     HRESULT hr;
 
     iface = (void *)0xdeadbeef;
@@ -2333,6 +2335,17 @@ static void test_create_factory(void)
     ok(hr == E_NOINTERFACE, "Got unexpected hr %#x.\n", hr);
     ok(!iface, "Got unexpected iface %p.\n", iface);
 
+    iface = NULL;
+    hr = CreateDXGIFactory(&IID_IDXGIFactory2, (void **)&iface);
+    todo_wine
+    ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
+            "Got unexpected hr %#x.\n", hr);
+    if (SUCCEEDED(hr))
+    {
+        refcount = IUnknown_Release(iface);
+        ok(!refcount, "Factory has %u references left.\n", refcount);
+    }
+
     if (!pCreateDXGIFactory1)
     {
         win_skip("CreateDXGIFactory1 not available, skipping tests.\n");
@@ -2362,6 +2375,17 @@ static void test_create_factory(void)
     hr = pCreateDXGIFactory1(&IID_IDXGIFactory1, (void **)&iface);
     ok(SUCCEEDED(hr), "Failed to create factory with IID_IDXGIFactory1, hr %#x.\n", hr);
     IUnknown_Release(iface);
+
+    iface = NULL;
+    hr = pCreateDXGIFactory1(&IID_IDXGIFactory2, (void **)&iface);
+    todo_wine
+    ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
+            "Got unexpected hr %#x.\n", hr);
+    if (SUCCEEDED(hr))
+    {
+        refcount = IUnknown_Release(iface);
+        ok(!refcount, "Factory has %u references left.\n", refcount);
+    }
 }
 
 static void test_private_data(void)




More information about the wine-cvs mailing list