Author: akhaldi Date: Sat Sep 27 12:59:19 2014 New Revision: 64341
URL: http://svn.reactos.org/svn/reactos?rev=64341&view=rev Log: [GDIPLUS_WINETEST] * Sync with Wine 1.7.27. CORE-8540
Modified: trunk/rostests/winetests/gdiplus/font.c trunk/rostests/winetests/gdiplus/graphics.c trunk/rostests/winetests/gdiplus/image.c
Modified: trunk/rostests/winetests/gdiplus/font.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/font.c?r... ============================================================================== --- trunk/rostests/winetests/gdiplus/font.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/font.c [iso-8859-1] Sat Sep 27 12:59:19 2014 @@ -39,11 +39,8 @@
static const WCHAR nonexistent[] = {'T','h','i','s','F','o','n','t','s','h','o','u','l','d','N','o','t','E','x','i','s','t','\0'}; static const WCHAR MSSansSerif[] = {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}; -static const WCHAR MicrosoftSansSerif[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'}; static const WCHAR TimesNewRoman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n','\0'}; -static const WCHAR CourierNew[] = {'C','o','u','r','i','e','r',' ','N','e','w','\0'}; static const WCHAR Tahoma[] = {'T','a','h','o','m','a',0}; -static const WCHAR LiberationSerif[] = {'L','i','b','e','r','a','t','i','o','n',' ','S','e','r','i','f',0};
static void set_rect_empty(RectF *rc) { @@ -809,17 +806,23 @@ lf.lfWeight = 0; lf.lfCharSet = 0; lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist"); + font = NULL; status = GdipCreateFontFromLogfontA(hdc, &lf, &font); todo_wine ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */ "expected NotTrueTypeFont, got %d\n", status); + /* FIXME: remove when wine is fixed */ + if (font) GdipDeleteFont(font);
/* empty FaceName */ lf.lfFaceName[0] = 0; + font = NULL; status = GdipCreateFontFromLogfontA(hdc, &lf, &font); todo_wine ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */ "expected NotTrueTypeFont, got %d\n", status); + /* FIXME: remove when wine is fixed */ + if (font) GdipDeleteFont(font);
GdipDeleteGraphics(graphics); DeleteDC(hdc);
Modified: trunk/rostests/winetests/gdiplus/graphics.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/graphics... ============================================================================== --- trunk/rostests/winetests/gdiplus/graphics.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/graphics.c [iso-8859-1] Sat Sep 27 12:59:19 2014 @@ -98,7 +98,7 @@ return pixels_to_units(pixels, to, dpi); }
-static GpGraphics *create_graphics(REAL res_x, REAL res_y, GpUnit unit, REAL scale) +static GpGraphics *create_graphics(REAL res_x, REAL res_y, GpUnit unit, REAL scale, GpImage **image) { GpStatus status; union @@ -123,11 +123,8 @@
status = GdipGetImageGraphicsContext(u.image, &graphics); expect(Ok, status); - /* image is intentionally leaked to make sure that there is no - side effects after its destruction. - status = GdipDisposeImage(u.image); - expect(Ok, status); - */ + + *image = u.image;
status = GdipGetDpiX(graphics, &res); expect(Ok, status); @@ -3527,7 +3524,9 @@
for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { - graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].page_scale); + GpImage *image; + + graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].page_scale, &image);
lf.lfHeight = 0xdeadbeef; status = GdipGetLogFontW(font, graphics, &lf); @@ -3578,6 +3577,9 @@
status = GdipDeleteGraphics(graphics); expect(Ok, status); + + status = GdipDisposeImage(image); + expect(Ok, status); }
GdipDeleteFont(font); @@ -3601,8 +3603,9 @@ for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { REAL unit_scale; - - graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].page_scale); + GpImage *image; + + graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].page_scale, &image);
lf.lfHeight = 0xdeadbeef; status = GdipGetLogFontW(font, graphics, &lf); @@ -3671,6 +3674,9 @@ expectf_(100.0, height, 1.1);
status = GdipDeleteGraphics(graphics); + expect(Ok, status); + + status = GdipDisposeImage(image); expect(Ok, status); }
@@ -3709,12 +3715,13 @@ }; GpStatus status; GpGraphics *graphics; + GpImage *image; GpPointF ptf[2]; UINT i;
for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { - graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].scale); + graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].scale, &image); ptf[0].X = td[i].in[0].X; ptf[0].Y = td[i].in[0].Y; ptf[1].X = td[i].in[1].X; @@ -3732,6 +3739,8 @@ expectf(td[i].in[1].X, ptf[1].X); expectf(td[i].in[1].Y, ptf[1].Y); status = GdipDeleteGraphics(graphics); + expect(Ok, status); + status = GdipDisposeImage(image); expect(Ok, status); } }
Modified: trunk/rostests/winetests/gdiplus/image.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/image.c?... ============================================================================== --- trunk/rostests/winetests/gdiplus/image.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/image.c [iso-8859-1] Sat Sep 27 12:59:19 2014 @@ -381,24 +381,48 @@ static void test_LoadingImages(void) { GpStatus stat; + GpBitmap *bm; + GpImage *img; + static const WCHAR nonexistentW[] = {'n','o','n','e','x','i','s','t','e','n','t',0};
stat = GdipCreateBitmapFromFile(0, 0); expect(InvalidParameter, stat);
- stat = GdipCreateBitmapFromFile(0, (GpBitmap**)0xdeadbeef); - expect(InvalidParameter, stat); + bm = (GpBitmap *)0xdeadbeef; + stat = GdipCreateBitmapFromFile(0, &bm); + expect(InvalidParameter, stat); + ok(bm == (GpBitmap *)0xdeadbeef, "returned %p\n", bm); + + bm = (GpBitmap *)0xdeadbeef; + stat = GdipCreateBitmapFromFile(nonexistentW, &bm); + todo_wine expect(InvalidParameter, stat); + ok(!bm, "returned %p\n", bm);
stat = GdipLoadImageFromFile(0, 0); expect(InvalidParameter, stat);
- stat = GdipLoadImageFromFile(0, (GpImage**)0xdeadbeef); - expect(InvalidParameter, stat); + img = (GpImage *)0xdeadbeef; + stat = GdipLoadImageFromFile(0, &img); + expect(InvalidParameter, stat); + ok(img == (GpImage *)0xdeadbeef, "returned %p\n", img); + + img = (GpImage *)0xdeadbeef; + stat = GdipLoadImageFromFile(nonexistentW, &img); + todo_wine expect(OutOfMemory, stat); + ok(!img, "returned %p\n", img);
stat = GdipLoadImageFromFileICM(0, 0); expect(InvalidParameter, stat);
- stat = GdipLoadImageFromFileICM(0, (GpImage**)0xdeadbeef); - expect(InvalidParameter, stat); + img = (GpImage *)0xdeadbeef; + stat = GdipLoadImageFromFileICM(0, &img); + expect(InvalidParameter, stat); + ok(img == (GpImage *)0xdeadbeef, "returned %p\n", img); + + img = (GpImage *)0xdeadbeef; + stat = GdipLoadImageFromFileICM(nonexistentW, &img); + todo_wine expect(OutOfMemory, stat); + ok(!img, "returned %p\n", img); }
static void test_SavingImages(void)