=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: ddraw/tests: Use todo_wine_if () in tests.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 17 11:15:04 CST 2016


Module: wine
Branch: master
Commit: 3e5321409258d0043b897e7552eb4cd3e96d44f4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3e5321409258d0043b897e7552eb4cd3e96d44f4

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Tue Feb 16 15:34:31 2016 +0100

ddraw/tests: Use todo_wine_if() in tests.

Signed-off-by: Frédéric Delanoy <frederic.delanoy at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ddraw/tests/d3d.c    | 10 +---------
 dlls/ddraw/tests/ddraw1.c | 10 ++--------
 dlls/ddraw/tests/ddraw2.c | 10 ++--------
 dlls/ddraw/tests/ddraw4.c | 16 +++-------------
 dlls/ddraw/tests/ddraw7.c | 26 +++++---------------------
 5 files changed, 13 insertions(+), 59 deletions(-)

diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c
index ec4197a..06f16f3 100644
--- a/dlls/ddraw/tests/d3d.c
+++ b/dlls/ddraw/tests/d3d.c
@@ -3312,17 +3312,9 @@ static void FindDevice(void)
 
         hr = IDirect3D_FindDevice(Direct3D1, &search, &result);
 
-        if (deviceGUIDs[i].todo)
-        {
-            todo_wine
-            ok(hr == D3D_OK,
-               "[%d] Expected IDirect3D1::FindDevice to return D3D_OK, got 0x%08x\n", i, hr);
-        }
-        else
-        {
+        todo_wine_if (deviceGUIDs[i].todo)
             ok(hr == D3D_OK,
                "[%d] Expected IDirect3D1::FindDevice to return D3D_OK, got 0x%08x\n", i, hr);
-        }
     }
 
     /* Curiously the color model criteria seem to be ignored. */
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 4090b26..1e1a2ff 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -7240,18 +7240,12 @@ static void test_color_fill(void)
         ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, surface %s.\n", hr, tests[i].name);
 
         hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
-        if (tests[i].format.dwFourCC)
-            todo_wine ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
-                    hr, tests[i].colorfill_hr, tests[i].name);
-        else
+        todo_wine_if (tests[i].format.dwFourCC)
             ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
                     hr, tests[i].colorfill_hr, tests[i].name);
 
         hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
-        if (tests[i].format.dwFourCC)
-            todo_wine ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
-                    hr, tests[i].colorfill_hr, tests[i].name);
-        else
+        todo_wine_if (tests[i].format.dwFourCC)
             ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
                     hr, tests[i].colorfill_hr, tests[i].name);
 
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 5c0bb52..75bdc84 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -8394,18 +8394,12 @@ static void test_color_fill(void)
         ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, surface %s.\n", hr, tests[i].name);
 
         hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
-        if (tests[i].format.dwFourCC)
-            todo_wine ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
-                    hr, tests[i].colorfill_hr, tests[i].name);
-        else
+        todo_wine_if (tests[i].format.dwFourCC)
             ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
                     hr, tests[i].colorfill_hr, tests[i].name);
 
         hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
-        if (tests[i].format.dwFourCC)
-            todo_wine ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
-                    hr, tests[i].colorfill_hr, tests[i].name);
-        else
+        todo_wine_if (tests[i].format.dwFourCC)
             ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
                     hr, tests[i].colorfill_hr, tests[i].name);
 
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 950d458..a092787 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -5201,11 +5201,7 @@ static void test_block_formats_creation(void)
                         expect_hr = D3D_OK;
 
                     hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL);
-                    if (todo)
-                        todo_wine ok(hr == expect_hr,
-                                "Got unexpected hr %#x for format %s, resource type %s, size %ux%u, expected %#x.\n",
-                                hr, formats[i].name, types[j].name, w, h, expect_hr);
-                    else
+                    todo_wine_if (todo)
                         ok(hr == expect_hr,
                                 "Got unexpected hr %#x for format %s, resource type %s, size %ux%u, expected %#x.\n",
                                 hr, formats[i].name, types[j].name, w, h, expect_hr);
@@ -9348,18 +9344,12 @@ static void test_color_fill(void)
         ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, surface %s.\n", hr, tests[i].name);
 
         hr = IDirectDrawSurface4_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
-        if (tests[i].format.dwFourCC)
-            todo_wine ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
-                    hr, tests[i].colorfill_hr, tests[i].name);
-        else
+        todo_wine_if (tests[i].format.dwFourCC)
             ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
                     hr, tests[i].colorfill_hr, tests[i].name);
 
         hr = IDirectDrawSurface4_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
-        if (tests[i].format.dwFourCC)
-            todo_wine ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
-                    hr, tests[i].colorfill_hr, tests[i].name);
-        else
+        todo_wine_if (tests[i].format.dwFourCC)
             ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
                     hr, tests[i].colorfill_hr, tests[i].name);
 
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 216ce38..d7589a8 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -4996,11 +4996,7 @@ static void test_block_formats_creation(void)
                         expect_hr = D3D_OK;
 
                     hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL);
-                    if (todo)
-                        todo_wine ok(hr == expect_hr,
-                                "Got unexpected hr %#x for format %s, resource type %s, size %ux%u, expected %#x.\n",
-                                hr, formats[i].name, types[j].name, w, h, expect_hr);
-                    else
+                    todo_wine_if (todo)
                         ok(hr == expect_hr,
                                 "Got unexpected hr %#x for format %s, resource type %s, size %ux%u, expected %#x.\n",
                                 hr, formats[i].name, types[j].name, w, h, expect_hr);
@@ -8862,10 +8858,7 @@ static void test_fog_interpolation(void)
         color = get_surface_color(rt, 0, 240);
         ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x, case %u.\n", color, i);
         color = get_surface_color(rt, 320, 240);
-        if (tests[i].todo)
-            todo_wine ok(compare_color(color, tests[i].middle_color, 2),
-                    "Got unexpected color 0x%08x, case %u.\n", color, i);
-        else
+        todo_wine_if (tests[i].todo)
             ok(compare_color(color, tests[i].middle_color, 2),
                     "Got unexpected color 0x%08x, case %u.\n", color, i);
         color = get_surface_color(rt, 639, 240);
@@ -9618,18 +9611,12 @@ static void test_color_fill(void)
         ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, surface %s.\n", hr, tests[i].name);
 
         hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
-        if (tests[i].format.dwFourCC)
-            todo_wine ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
-                    hr, tests[i].colorfill_hr, tests[i].name);
-        else
+        todo_wine_if (tests[i].format.dwFourCC)
             ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
                     hr, tests[i].colorfill_hr, tests[i].name);
 
         hr = IDirectDrawSurface7_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
-        if (tests[i].format.dwFourCC)
-            todo_wine ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
-                    hr, tests[i].colorfill_hr, tests[i].name);
-        else
+        todo_wine_if (tests[i].format.dwFourCC)
             ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n",
                     hr, tests[i].colorfill_hr, tests[i].name);
 
@@ -10737,10 +10724,7 @@ static void test_lockrect_invalid(void)
             locked_desc.dwSize = sizeof(locked_desc);
 
             hr = IDirectDrawSurface7_Lock(surface, rect, &locked_desc, DDLOCK_WAIT, NULL);
-            if (SUCCEEDED(resources[r].hr))
-                todo_wine ok(hr == resources[r].hr, "Lock returned %#x for rect [%d, %d]->[%d, %d], type %s.\n",
-                        hr, rect->left, rect->top, rect->right, rect->bottom, resources[r].name);
-            else
+            todo_wine_if (SUCCEEDED(resources[r].hr))
                 ok(hr == resources[r].hr, "Lock returned %#x for rect [%d, %d]->[%d, %d], type %s.\n",
                         hr, rect->left, rect->top, rect->right, rect->bottom, resources[r].name);
             if (SUCCEEDED(hr))




More information about the wine-cvs mailing list