From 9ac1744b8020b258885e35653eb51984ce78718f Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 18 Feb 2016 17:54:09 +1100 Subject: [PATCH] gdi32/tests: Check values returned from GetPath. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/gdi32/tests/metafile.c | 44 ++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index 6804a966fba..f464720a7c7 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -3361,6 +3361,41 @@ static void test_emf_polybezier(void) DeleteEnhMetaFile(hemf); } +static const unsigned char EMF_PATH_BITS[] = +{ + 0x01, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe6, 0xff, 0xff, 0xff, 0xe6, 0xff, 0xff, 0xff, + 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00, + 0xf8, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x07, 0x00, 0x00, 0xd3, 0x03, 0x00, 0x00, + 0xfc, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00, + 0xd3, 0xf3, 0x03, 0x00, 0x3b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, + 0x32, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, + 0x96, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, + 0x96, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, + 0x32, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, + 0x32, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x0a, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x13, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00 +}; + static void test_emf_GetPath(void) { HDC hdcMetafile; @@ -3383,14 +3418,21 @@ static void test_emf_GetPath(void) ok( ret, "LineTo error %d.\n", GetLastError()); ret = LineTo(hdcMetafile, 50, 50); ok( ret, "LineTo error %d.\n", GetLastError()); + Rectangle(hdcMetafile, 10, 10, 20, 20); EndPath(hdcMetafile); size = GetPath(hdcMetafile, NULL, NULL, 0); - todo_wine ok( size == 5, "GetPath returned %d.\n", size); + todo_wine ok( size == 9, "GetPath returned %d.\n", size); hemf = CloseEnhMetaFile(hdcMetafile); ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + if (compare_emf_bits(hemf, EMF_PATH_BITS, sizeof(EMF_PATH_BITS), "test_emf_GetPath", FALSE) != 0) + { + dump_emf_bits(hemf, "test_emf_GetPath"); + dump_emf_records(hemf, "test_emf_GetPath"); + } + DeleteEnhMetaFile(hemf); }