=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: gdiplus/tests: Use todo_wine_if() in tests.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Feb 16 09:54:59 CST 2016


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

Author: André Hentschel <nerv at dawncrow.de>
Date:   Mon Feb 15 23:14:36 2016 +0100

gdiplus/tests: Use todo_wine_if() in tests.

Signed-off-by: André Hentschel <nerv at dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdiplus/tests/graphicspath.c | 11 ++---------
 dlls/gdiplus/tests/image.c        | 14 ++++----------
 dlls/gdiplus/tests/metafile.c     | 22 +++++-----------------
 3 files changed, 11 insertions(+), 36 deletions(-)

diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c
index aa44911..400123c 100644
--- a/dlls/gdiplus/tests/graphicspath.c
+++ b/dlls/gdiplus/tests/graphicspath.c
@@ -87,10 +87,7 @@ static void ok_path(GpPath* path, const path_test_t *expected, INT expected_size
         return;
     }
 
-    if(todo_size) todo_wine
-        ok(size == expected_size, "Path size %d does not match expected size %d\n",
-            size, expected_size);
-    else
+    todo_wine_if (todo_size)
         ok(size == expected_size, "Path size %d does not match expected size %d\n",
             size, expected_size);
 
@@ -113,11 +110,7 @@ static void ok_path(GpPath* path, const path_test_t *expected, INT expected_size
         stringify_point_type(expected[eidx].type, ename);
         stringify_point_type(types[idx], name);
 
-        if (expected[eidx].todo || numskip) todo_wine
-            ok(match, "Expected #%d: %s (%.1f,%.1f) but got %s (%.1f,%.1f)\n", eidx,
-               ename, expected[eidx].X, expected[eidx].Y,
-               name, points[idx].X, points[idx].Y);
-        else
+        todo_wine_if (expected[eidx].todo || numskip)
             ok(match, "Expected #%d: %s (%.1f,%.1f) but got %s (%.1f,%.1f)\n", eidx,
                ename, expected[eidx].X, expected[eidx].Y,
                name, points[idx].X, points[idx].Y);
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c
index 6be4a5b..6a51714 100644
--- a/dlls/gdiplus/tests/image.c
+++ b/dlls/gdiplus/tests/image.c
@@ -55,9 +55,7 @@ static void expect_guid(REFGUID expected, REFGUID got, int line, BOOL todo)
     WideCharToMultiByte(CP_ACP, 0, bufferW, sizeof(bufferW)/sizeof(bufferW[0]), buffer, sizeof(buffer), NULL, NULL);
     StringFromGUID2(expected, bufferW, sizeof(bufferW)/sizeof(bufferW[0]));
     WideCharToMultiByte(CP_ACP, 0, bufferW, sizeof(bufferW)/sizeof(bufferW[0]), buffer2, sizeof(buffer2), NULL, NULL);
-    if(todo)
-        todo_wine ok_(__FILE__, line)(IsEqualGUID(expected, got), "Expected %s, got %s\n", buffer2, buffer);
-    else
+    todo_wine_if (todo)
         ok_(__FILE__, line)(IsEqualGUID(expected, got), "Expected %s, got %s\n", buffer2, buffer);
 }
 
@@ -4298,10 +4296,8 @@ static void test_DrawImage_scale(void)
         expect(Ok, status);
 
         match = memcmp(dst_8x1, td[i].image, sizeof(dst_8x1)) == 0;
-        if (!match && td[i].todo)
-        todo_wine ok(match, "%d: data should match\n", i);
-        else
-        ok(match, "%d: data should match\n", i);
+        todo_wine_if (!match && td[i].todo)
+            ok(match, "%d: data should match\n", i);
         if (!match)
         {
             UINT i, size = sizeof(dst_8x1);
@@ -4679,9 +4675,7 @@ static void test_supported_encoders(void)
         ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr);
 
         status = GdipSaveImageToStream((GpImage *)bm, stream, &clsid, NULL);
-        if (td[i].todo)
-            todo_wine ok(status == Ok, "GdipSaveImageToStream error %d\n", status);
-        else
+        todo_wine_if (td[i].todo)
             ok(status == Ok, "GdipSaveImageToStream error %d\n", status);
 
         IStream_Release(stream);
diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c
index a4b3f59..0c52718 100644
--- a/dlls/gdiplus/tests/metafile.c
+++ b/dlls/gdiplus/tests/metafile.c
@@ -47,11 +47,7 @@ typedef struct emfplus_check_state
 
 static void check_record(int count, const char *desc, const struct emfplus_record *expected, const struct emfplus_record *actual)
 {
-    if (expected->todo)
-        todo_wine ok(expected->record_type == actual->record_type,
-            "%s.%i: Expected record type 0x%x, got 0x%x\n", desc, count,
-            expected->record_type, actual->record_type);
-    else
+    todo_wine_if (expected->todo)
         ok(expected->record_type == actual->record_type,
             "%s.%i: Expected record type 0x%x, got 0x%x\n", desc, count,
             expected->record_type, actual->record_type);
@@ -142,9 +138,7 @@ static void check_emfplus(HENHMETAFILE hemf, const emfplus_record *expected, con
 
     EnumEnhMetaFile(0, hemf, enum_emf_proc, &state, NULL);
 
-    if (expected[state.count].todo)
-        todo_wine ok(expected[state.count].record_type == 0, "%s: Got %i records, expecting more\n", desc, state.count);
-    else
+    todo_wine_if (expected[state.count].todo)
         ok(expected[state.count].record_type == 0, "%s: Got %i records, expecting more\n", desc, state.count);
 }
 
@@ -196,9 +190,7 @@ static void check_metafile(GpMetafile *metafile, const emfplus_record *expected,
         3, src_rect, src_unit, enum_metafile_proc, &state, NULL);
     expect(Ok, stat);
 
-    if (expected[state.count].todo)
-        todo_wine ok(expected[state.count].record_type == 0, "%s: Got %i records, expecting more\n", desc, state.count);
-    else
+    todo_wine_if (expected[state.count].todo)
         ok(expected[state.count].record_type == 0, "%s: Got %i records, expecting more\n", desc, state.count);
 
     GdipDeleteGraphics(graphics);
@@ -216,17 +208,13 @@ static BOOL CALLBACK play_metafile_proc(EmfPlusRecordType record_type, unsigned
 
     if (state->expected[state->count].record_type)
     {
-        if (state->expected[state->count].playback_todo)
-            todo_wine ok(stat == Ok, "%s.%i: GdipPlayMetafileRecord failed with stat %i\n", state->desc, state->count, stat);
-        else
+        todo_wine_if (state->expected[state->count].playback_todo)
             ok(stat == Ok, "%s.%i: GdipPlayMetafileRecord failed with stat %i\n", state->desc, state->count, stat);
         state->count++;
     }
     else
     {
-        if (state->expected[state->count].playback_todo)
-            todo_wine ok(0, "%s: too many records\n", state->desc);
-        else
+        todo_wine_if (state->expected[state->count].playback_todo)
             ok(0, "%s: too many records\n", state->desc);
 
         return FALSE;




More information about the wine-cvs mailing list