Rémi Bernon : mf/tests: Skip todo_wine tests with a goto statement.

Alexandre Julliard julliard at winehq.org
Mon May 2 16:02:08 CDT 2022


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Apr 28 12:24:36 2022 +0200

mf/tests: Skip todo_wine tests with a goto statement.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mf/tests/mf.c | 48 +++++++++++++++++++++++-------------------------
 1 file changed, 23 insertions(+), 25 deletions(-)

diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 37520d48292..6f6213b1e26 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -6999,33 +6999,31 @@ static void test_h264_decoder(void)
     ok(output.dwStatus == 0, "got dwStatus %#lx\n", output.dwStatus);
     ok(!output.pEvents, "got pEvents %p\n", output.pEvents);
     ok(status == 0, "got status %#lx\n", status);
-    if (hr == S_OK)
-    {
-        /* Win8 and before pad the data with garbage instead of original
-         * buffer data, make sure it's consistent.  */
-        hr = IMFSample_ConvertToContiguousBuffer(output.pSample, &media_buffer);
-        ok(hr == S_OK, "ConvertToContiguousBuffer returned %#lx\n", hr);
-        hr = IMFMediaBuffer_Lock(media_buffer, &data, NULL, &length);
-        ok(hr == S_OK, "Lock returned %#lx\n", hr);
-        todo_wine
-        ok(length == nv12_frame_len, "got length %lu\n", length);
-        if (length == nv12_frame_len)
-        {
-            for (i = 0; i < actual_aperture.Area.cy; ++i)
-            {
-                memset(data + actual_width * i + actual_aperture.Area.cx, 0xcd, actual_width - actual_aperture.Area.cx);
-                memset(data + actual_width * (actual_height + i) + actual_aperture.Area.cx, 0xcd, actual_width - actual_aperture.Area.cx);
-            }
-            memset(data + actual_width * actual_aperture.Area.cy, 0xcd, (actual_height - actual_aperture.Area.cy) * actual_width);
-            memset(data + actual_width * (actual_height + actual_aperture.Area.cy / 2), 0xcd, (actual_height - actual_aperture.Area.cy) / 2 * actual_width);
-        }
-        hr = IMFMediaBuffer_Unlock(media_buffer);
-        ok(hr == S_OK, "Unlock returned %#lx\n", hr);
-        IMFMediaBuffer_Release(media_buffer);
+    if (hr != S_OK) goto skip_nv12_tests;
+
+    /* Win8 and before pad the data with garbage instead of original
+     * buffer data, make sure it's consistent.  */
+    hr = IMFSample_ConvertToContiguousBuffer(output.pSample, &media_buffer);
+    ok(hr == S_OK, "ConvertToContiguousBuffer returned %#lx\n", hr);
+    hr = IMFMediaBuffer_Lock(media_buffer, &data, NULL, &length);
+    ok(hr == S_OK, "Lock returned %#lx\n", hr);
+    ok(length == nv12_frame_len, "got length %lu\n", length);
 
-        if (length == nv12_frame_len)
-            check_sample(output.pSample, nv12_frame_data, output_file);
+    for (i = 0; i < actual_aperture.Area.cy; ++i)
+    {
+        memset(data + actual_width * i + actual_aperture.Area.cx, 0xcd, actual_width - actual_aperture.Area.cx);
+        memset(data + actual_width * (actual_height + i) + actual_aperture.Area.cx, 0xcd, actual_width - actual_aperture.Area.cx);
     }
+    memset(data + actual_width * actual_aperture.Area.cy, 0xcd, (actual_height - actual_aperture.Area.cy) * actual_width);
+    memset(data + actual_width * (actual_height + actual_aperture.Area.cy / 2), 0xcd, (actual_height - actual_aperture.Area.cy) / 2 * actual_width);
+
+    hr = IMFMediaBuffer_Unlock(media_buffer);
+    ok(hr == S_OK, "Unlock returned %#lx\n", hr);
+    IMFMediaBuffer_Release(media_buffer);
+
+    check_sample(output.pSample, nv12_frame_data, output_file);
+
+skip_nv12_tests:
     ret = IMFSample_Release(output.pSample);
     ok(ret == 0, "Release returned %lu\n", ret);
 




More information about the wine-cvs mailing list