mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 00:43:21 +00:00
[GDIPLUS_WINETEST]
* Sync with Wine 1.7.27. CORE-8540 svn path=/trunk/; revision=64341
This commit is contained in:
parent
8baa38664d
commit
ef23e522aa
|
@ -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 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 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 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 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)
|
static void set_rect_empty(RectF *rc)
|
||||||
{
|
{
|
||||||
|
@ -809,17 +806,23 @@ static void test_font_substitution(void)
|
||||||
lf.lfWeight = 0;
|
lf.lfWeight = 0;
|
||||||
lf.lfCharSet = 0;
|
lf.lfCharSet = 0;
|
||||||
lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist");
|
lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist");
|
||||||
|
font = NULL;
|
||||||
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */
|
ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */
|
||||||
"expected NotTrueTypeFont, got %d\n", status);
|
"expected NotTrueTypeFont, got %d\n", status);
|
||||||
|
/* FIXME: remove when wine is fixed */
|
||||||
|
if (font) GdipDeleteFont(font);
|
||||||
|
|
||||||
/* empty FaceName */
|
/* empty FaceName */
|
||||||
lf.lfFaceName[0] = 0;
|
lf.lfFaceName[0] = 0;
|
||||||
|
font = NULL;
|
||||||
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */
|
ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */
|
||||||
"expected NotTrueTypeFont, got %d\n", status);
|
"expected NotTrueTypeFont, got %d\n", status);
|
||||||
|
/* FIXME: remove when wine is fixed */
|
||||||
|
if (font) GdipDeleteFont(font);
|
||||||
|
|
||||||
GdipDeleteGraphics(graphics);
|
GdipDeleteGraphics(graphics);
|
||||||
DeleteDC(hdc);
|
DeleteDC(hdc);
|
||||||
|
|
|
@ -98,7 +98,7 @@ static REAL units_scale(GpUnit from, GpUnit to, REAL dpi)
|
||||||
return pixels_to_units(pixels, to, dpi);
|
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;
|
GpStatus status;
|
||||||
union
|
union
|
||||||
|
@ -123,11 +123,8 @@ static GpGraphics *create_graphics(REAL res_x, REAL res_y, GpUnit unit, REAL sca
|
||||||
|
|
||||||
status = GdipGetImageGraphicsContext(u.image, &graphics);
|
status = GdipGetImageGraphicsContext(u.image, &graphics);
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
/* image is intentionally leaked to make sure that there is no
|
|
||||||
side effects after its destruction.
|
*image = u.image;
|
||||||
status = GdipDisposeImage(u.image);
|
|
||||||
expect(Ok, status);
|
|
||||||
*/
|
|
||||||
|
|
||||||
status = GdipGetDpiX(graphics, &res);
|
status = GdipGetDpiX(graphics, &res);
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
|
@ -3527,7 +3524,9 @@ static void test_GdipMeasureString(void)
|
||||||
|
|
||||||
for (i = 0; i < sizeof(td)/sizeof(td[0]); 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].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;
|
lf.lfHeight = 0xdeadbeef;
|
||||||
status = GdipGetLogFontW(font, graphics, &lf);
|
status = GdipGetLogFontW(font, graphics, &lf);
|
||||||
|
@ -3578,6 +3577,9 @@ todo_wine
|
||||||
|
|
||||||
status = GdipDeleteGraphics(graphics);
|
status = GdipDeleteGraphics(graphics);
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
|
|
||||||
|
status = GdipDisposeImage(image);
|
||||||
|
expect(Ok, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
GdipDeleteFont(font);
|
GdipDeleteFont(font);
|
||||||
|
@ -3601,8 +3603,9 @@ todo_wine
|
||||||
for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
|
for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
|
||||||
{
|
{
|
||||||
REAL unit_scale;
|
REAL unit_scale;
|
||||||
|
GpImage *image;
|
||||||
|
|
||||||
graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].page_scale);
|
graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].page_scale, &image);
|
||||||
|
|
||||||
lf.lfHeight = 0xdeadbeef;
|
lf.lfHeight = 0xdeadbeef;
|
||||||
status = GdipGetLogFontW(font, graphics, &lf);
|
status = GdipGetLogFontW(font, graphics, &lf);
|
||||||
|
@ -3672,6 +3675,9 @@ todo_wine
|
||||||
|
|
||||||
status = GdipDeleteGraphics(graphics);
|
status = GdipDeleteGraphics(graphics);
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
|
|
||||||
|
status = GdipDisposeImage(image);
|
||||||
|
expect(Ok, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
GdipDeleteFont(font);
|
GdipDeleteFont(font);
|
||||||
|
@ -3709,12 +3715,13 @@ static void test_transform(void)
|
||||||
};
|
};
|
||||||
GpStatus status;
|
GpStatus status;
|
||||||
GpGraphics *graphics;
|
GpGraphics *graphics;
|
||||||
|
GpImage *image;
|
||||||
GpPointF ptf[2];
|
GpPointF ptf[2];
|
||||||
UINT i;
|
UINT i;
|
||||||
|
|
||||||
for (i = 0; i < sizeof(td)/sizeof(td[0]); 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].X = td[i].in[0].X;
|
||||||
ptf[0].Y = td[i].in[0].Y;
|
ptf[0].Y = td[i].in[0].Y;
|
||||||
ptf[1].X = td[i].in[1].X;
|
ptf[1].X = td[i].in[1].X;
|
||||||
|
@ -3733,6 +3740,8 @@ static void test_transform(void)
|
||||||
expectf(td[i].in[1].Y, ptf[1].Y);
|
expectf(td[i].in[1].Y, ptf[1].Y);
|
||||||
status = GdipDeleteGraphics(graphics);
|
status = GdipDeleteGraphics(graphics);
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
|
status = GdipDisposeImage(image);
|
||||||
|
expect(Ok, status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -381,24 +381,48 @@ static void test_GdipImageGetFrameDimensionsCount(void)
|
||||||
static void test_LoadingImages(void)
|
static void test_LoadingImages(void)
|
||||||
{
|
{
|
||||||
GpStatus stat;
|
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);
|
stat = GdipCreateBitmapFromFile(0, 0);
|
||||||
expect(InvalidParameter, stat);
|
expect(InvalidParameter, stat);
|
||||||
|
|
||||||
stat = GdipCreateBitmapFromFile(0, (GpBitmap**)0xdeadbeef);
|
bm = (GpBitmap *)0xdeadbeef;
|
||||||
|
stat = GdipCreateBitmapFromFile(0, &bm);
|
||||||
expect(InvalidParameter, stat);
|
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);
|
stat = GdipLoadImageFromFile(0, 0);
|
||||||
expect(InvalidParameter, stat);
|
expect(InvalidParameter, stat);
|
||||||
|
|
||||||
stat = GdipLoadImageFromFile(0, (GpImage**)0xdeadbeef);
|
img = (GpImage *)0xdeadbeef;
|
||||||
|
stat = GdipLoadImageFromFile(0, &img);
|
||||||
expect(InvalidParameter, stat);
|
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);
|
stat = GdipLoadImageFromFileICM(0, 0);
|
||||||
expect(InvalidParameter, stat);
|
expect(InvalidParameter, stat);
|
||||||
|
|
||||||
stat = GdipLoadImageFromFileICM(0, (GpImage**)0xdeadbeef);
|
img = (GpImage *)0xdeadbeef;
|
||||||
|
stat = GdipLoadImageFromFileICM(0, &img);
|
||||||
expect(InvalidParameter, stat);
|
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)
|
static void test_SavingImages(void)
|
||||||
|
|
Loading…
Reference in a new issue