[GDIPLUS_WINETEST]

* Sync with Wine 1.7.1.

svn path=/trunk/; revision=60205
This commit is contained in:
Amine Khaldi 2013-09-19 15:10:36 +00:00
parent 6df5eb8a4a
commit 2f49b8458c
6 changed files with 1104 additions and 40 deletions

View file

@ -17,7 +17,6 @@ list(APPEND SOURCE
testlist.c)
add_executable(gdiplus_winetest ${SOURCE})
target_link_libraries(gdiplus_winetest wine)
set_module_type(gdiplus_winetest win32cui)
add_importlibs(gdiplus_winetest gdiplus user32 gdi32 ole32 msvcrt kernel32 ntdll)
add_importlibs(gdiplus_winetest gdiplus user32 gdi32 ole32 msvcrt kernel32)
add_cd_file(TARGET gdiplus_winetest DESTINATION reactos/bin FOR all)

View file

@ -180,12 +180,45 @@ static void test_scale(void)
expect(InvalidParameter, stat);
stat = GdipGetCustomLineCapWidthScale(custom, NULL);
expect(InvalidParameter, stat);
/* valid args */
stat = GdipSetCustomLineCapWidthScale(NULL, 2.0);
expect(InvalidParameter, stat);
/* valid args: read default */
scale = (REAL)0xdeadbeef;
stat = GdipGetCustomLineCapWidthScale(custom, &scale);
expect(Ok, stat);
expectf(1.0, scale);
/* set and read back some scale values: there is no limit for the scale */
stat = GdipSetCustomLineCapWidthScale(custom, 2.5);
expect(Ok, stat);
scale = (REAL)0xdeadbeef;
stat = GdipGetCustomLineCapWidthScale(custom, &scale);
expect(Ok, stat);
expectf(2.5, scale);
stat = GdipSetCustomLineCapWidthScale(custom, 42.0);
expect(Ok, stat);
scale = (REAL)0xdeadbeef;
stat = GdipGetCustomLineCapWidthScale(custom, &scale);
expect(Ok, stat);
expectf(42.0, scale);
stat = GdipSetCustomLineCapWidthScale(custom, 3000.0);
expect(Ok, stat);
scale = (REAL)0xdeadbeef;
stat = GdipGetCustomLineCapWidthScale(custom, &scale);
expect(Ok, stat);
expectf(3000.0, scale);
stat = GdipSetCustomLineCapWidthScale(custom, 0.0);
expect(Ok, stat);
scale = (REAL)0xdeadbeef;
stat = GdipGetCustomLineCapWidthScale(custom, &scale);
expect(Ok, stat);
expectf(0.0, scale);
GdipDeleteCustomLineCap(custom);
GdipDeletePath(path);
}

View file

@ -888,26 +888,21 @@ todo_wine
expect(Ok, status);
expectf(0.0, bounds.X);
expectf(0.0, bounds.Y);
todo_wine
expectf(height, bounds.Height);
expectf_(height, bounds.Height, 1.0);
set_rect_empty(&bounds);
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
DriverStringOptionsCmapLookup, NULL, &bounds);
expect(Ok, status);
expectf(0.0, bounds.X);
todo_wine
expectf_(-100.0, bounds.Y, 0.05);
todo_wine
expectf(height, bounds.Height);
expectf_(height, bounds.Height, 0.5);
set_rect_empty(&bounds);
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
DriverStringOptionsCmapLookup, matrix, &bounds);
expect(Ok, status);
expectf(0.0, bounds.X);
todo_wine
expectf_(-100.0, bounds.Y, 0.05);
todo_wine
expectf(height, bounds.Height);
expectf_(height, bounds.Height, 0.5);
/* scale matrix */
status = GdipScaleMatrix(matrix, 2.0, 3.0, MatrixOrderAppend);
@ -937,17 +932,14 @@ todo_wine
expect(Ok, status);
expectf(0.0, bounds.X);
expectf(0.0, bounds.Y);
todo_wine
expectf(height, bounds.Height);
expectf_(height, bounds.Height, 0.05);
set_rect_empty(&bounds);
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
DriverStringOptionsCmapLookup, NULL, &bounds);
expect(Ok, status);
expectf(0.0, bounds.X);
todo_wine
expectf_(-100.0, bounds.Y, 0.05);
todo_wine
expectf(height, bounds.Height);
expectf_(height, bounds.Height, 0.2);
set_rect_empty(&bounds);
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
DriverStringOptionsCmapLookup, matrix, &bounds);
@ -986,17 +978,14 @@ todo_wine
expect(Ok, status);
expectf(0.0, bounds.X);
expectf(0.0, bounds.Y);
todo_wine
expectf(height, bounds.Height);
expectf_(height, bounds.Height, 0.05);
set_rect_empty(&bounds);
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
DriverStringOptionsCmapLookup, NULL, &bounds);
expect(Ok, status);
expectf(0.0, bounds.X);
todo_wine
expectf_(-100.0, bounds.Y, 0.05);
todo_wine
expectf(height, bounds.Height);
expectf_(height, bounds.Height, 0.2);
set_rect_empty(&bounds);
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
DriverStringOptionsCmapLookup, matrix, &bounds);
@ -1037,17 +1026,14 @@ todo_wine
expect(Ok, status);
expectf(0.0, bounds.X);
expectf(0.0, bounds.Y);
todo_wine
expectf(height, bounds.Height);
expectf_(height, bounds.Height, 0.2);
set_rect_empty(&bounds);
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
DriverStringOptionsCmapLookup, NULL, &bounds);
expect(Ok, status);
expectf(0.0, bounds.X);
todo_wine
expectf_(-100.0, bounds.Y, 0.05);
todo_wine
expectf(height, bounds.Height);
expectf_(-100.0, bounds.Y, 0.2);
expectf_(height, bounds.Height, 0.2);
set_rect_empty(&bounds);
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
DriverStringOptionsCmapLookup, matrix, &bounds);
@ -1088,17 +1074,14 @@ todo_wine
expect(Ok, status);
expectf(0.0, bounds.X);
expectf(0.0, bounds.Y);
todo_wine
expectf(height, bounds.Height);
expectf_(height, bounds.Height, 0.1);
set_rect_empty(&bounds);
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
DriverStringOptionsCmapLookup, NULL, &bounds);
expect(Ok, status);
expectf(0.0, bounds.X);
todo_wine
expectf_(-100.0, bounds.Y, 0.05);
todo_wine
expectf(height, bounds.Height);
expectf_(-100.0, bounds.Y, 0.2);
expectf_(height, bounds.Height, 0.2);
set_rect_empty(&bounds);
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
DriverStringOptionsCmapLookup, matrix, &bounds);

File diff suppressed because it is too large Load diff

View file

@ -2219,6 +2219,17 @@ static void test_colormatrix(void)
expect(Ok, stat);
ok(color_match(0xeeff40cc, color, 3), "expected 0xeeff40cc, got 0x%08x\n", color);
stat = GdipResetImageAttributes(imageattr, ColorAdjustTypeDefault);
expect(Ok, stat);
stat = GdipDrawImageRectRectI(graphics, (GpImage*)bitmap1, 0,0,1,1, 0,0,1,1,
UnitPixel, imageattr, NULL, NULL);
expect(Ok, stat);
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color);
expect(Ok, stat);
ok(color_match(0xff40ccee, color, 1), "Expected ff40ccee, got %.8x\n", color);
GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap1);
GdipDisposeImage((GpImage*)bitmap2);
@ -2281,6 +2292,17 @@ static void test_gamma(void)
expect(Ok, stat);
ok(color_match(0xff20ffff, color, 1), "Expected ff20ffff, got %.8x\n", color);
stat = GdipResetImageAttributes(imageattr, ColorAdjustTypeDefault);
expect(Ok, stat);
stat = GdipDrawImageRectRectI(graphics, (GpImage*)bitmap1, 0,0,1,1, 0,0,1,1,
UnitPixel, imageattr, NULL, NULL);
expect(Ok, stat);
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color);
expect(Ok, stat);
ok(color_match(0xff80ffff, color, 1), "Expected ff80ffff, got %.8x\n", color);
GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap1);
GdipDisposeImage((GpImage*)bitmap2);
@ -2612,6 +2634,17 @@ static void test_remaptable(void)
expect(Ok, stat);
ok(color_match(0xffff00ff, color, 1), "Expected ffff00ff, got %.8x\n", color);
stat = GdipResetImageAttributes(imageattr, ColorAdjustTypeDefault);
expect(Ok, stat);
stat = GdipDrawImageRectRectI(graphics, (GpImage*)bitmap1, 0,0,1,1, 0,0,1,1,
UnitPixel, imageattr, NULL, NULL);
expect(Ok, stat);
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color);
expect(Ok, stat);
ok(color_match(0xff00ff00, color, 1), "Expected ff00ff00, got %.8x\n", color);
GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap1);
GdipDisposeImage((GpImage*)bitmap2);
@ -2669,19 +2702,43 @@ static void test_colorkey(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color);
expect(Ok, stat);
ok(color_match(0x00000000, color, 1), "Expected ffff00ff, got %.8x\n", color);
ok(color_match(0x00000000, color, 1), "Expected 00000000, got %.8x\n", color);
stat = GdipBitmapGetPixel(bitmap2, 0, 1, &color);
expect(Ok, stat);
ok(color_match(0x00000000, color, 1), "Expected ffff00ff, got %.8x\n", color);
ok(color_match(0x00000000, color, 1), "Expected 00000000, got %.8x\n", color);
stat = GdipBitmapGetPixel(bitmap2, 1, 0, &color);
expect(Ok, stat);
ok(color_match(0x00000000, color, 1), "Expected ffff00ff, got %.8x\n", color);
ok(color_match(0x00000000, color, 1), "Expected 00000000, got %.8x\n", color);
stat = GdipBitmapGetPixel(bitmap2, 1, 1, &color);
expect(Ok, stat);
ok(color_match(0xffffffff, color, 1), "Expected ffff00ff, got %.8x\n", color);
ok(color_match(0xffffffff, color, 1), "Expected ffffffff, got %.8x\n", color);
stat = GdipResetImageAttributes(imageattr, ColorAdjustTypeDefault);
expect(Ok, stat);
stat = GdipDrawImageRectRectI(graphics, (GpImage*)bitmap1, 0,0,2,2, 0,0,2,2,
UnitPixel, imageattr, NULL, NULL);
expect(Ok, stat);
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color);
expect(Ok, stat);
ok(color_match(0x20405060, color, 1), "Expected 20405060, got %.8x\n", color);
stat = GdipBitmapGetPixel(bitmap2, 0, 1, &color);
expect(Ok, stat);
ok(color_match(0x40506070, color, 1), "Expected 40506070, got %.8x\n", color);
stat = GdipBitmapGetPixel(bitmap2, 1, 0, &color);
expect(Ok, stat);
ok(color_match(0x60708090, color, 1), "Expected 60708090, got %.8x\n", color);
stat = GdipBitmapGetPixel(bitmap2, 1, 1, &color);
expect(Ok, stat);
ok(color_match(0xffffffff, color, 1), "Expected ffffffff, got %.8x\n", color);
GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap1);

View file

@ -1,7 +1,7 @@
/* Automatically generated file; DO NOT EDIT!! */
#define STANDALONE
#include "wine/test.h"
#include <wine/test.h>
extern void func_brush(void);
extern void func_customlinecap(void);