[PATCH v2 4/6] gdi32/tests: Test SetLayout for Windows Metafiles.

Zhiyi Zhang zzhang at codeweavers.com
Mon Apr 19 02:28:53 CDT 2021


Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
 dlls/gdi32/tests/metafile.c | 45 +++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index 545cdef69b6..f9bd5259ab9 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -5073,6 +5073,50 @@ todo_wine
     ReleaseDC(0, dc);
 }
 
+static const unsigned char MF_SETLAYOUT_BITS[] =
+{
+/*  Winedump output. Note that there is no META_SELECTOBJECT records after META_SETLAYOUT.
+ *
+ *  METAHEADER           00000012
+ *  type 1 header_size 0x12 version 0x300 size 0x22 object_count 0 max_record_size 0xa parameter_count 0
+ *     0001 0009 0300 0011 0000 0000 0005 0000
+ *     0000
+ *  META_SETLAYOUT       0000000a
+ *     0001 0000
+ *  META_EOF             00000006
+ */
+    0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x11, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x49, 0x01,
+    0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+    0x00, 0x00
+};
+
+static void test_mf_SetLayout(void)
+{
+    HMETAFILE mf;
+    HDC mf_dc;
+    int ret;
+
+    mf_dc = CreateMetaFileW(NULL);
+    ok(!!mf_dc, "CreateMetaFileW failed, error %d\n", GetLastError());
+
+    SetLayout(mf_dc, LAYOUT_RTL);
+
+    mf = CloseMetaFile(mf_dc);
+    ok(!!mf, "CloseMetaFile failed, error %d\n", GetLastError());
+
+    ret = compare_mf_bits(mf, MF_SETLAYOUT_BITS, sizeof(MF_SETLAYOUT_BITS), "mf_SetLayout");
+    todo_wine ok(!ret, "Bits mismatch\n");
+    if (ret)
+    {
+        dump_mf_bits(mf, "mf_SetLayout");
+        EnumMetaFile(0, mf, mf_enum_proc, 0);
+    }
+
+    DeleteMetaFile(mf);
+}
+
 START_TEST(metafile)
 {
     init_function_pointers();
@@ -5104,6 +5148,7 @@ START_TEST(metafile)
     test_mf_ExtTextOut_on_path();
     test_mf_clipping();
     test_mf_GetPath();
+    test_mf_SetLayout();
 
     /* For metafile conversions */
     test_mf_conversions();
-- 
2.27.0




More information about the wine-devel mailing list