Author: cwittich
Date: Sun Jun 7 14:10:52 2009
New Revision: 41323
URL:
http://svn.reactos.org/svn/reactos?rev=41323&view=rev
Log:
sync gdiplus_winetest with wine 1.1.23
Modified:
trunk/rostests/winetests/gdiplus/graphics.c
Modified: trunk/rostests/winetests/gdiplus/graphics.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/graphic…
==============================================================================
--- trunk/rostests/winetests/gdiplus/graphics.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/gdiplus/graphics.c [iso-8859-1] Sun Jun 7 14:10:52 2009
@@ -22,8 +22,10 @@
#include "gdiplus.h"
#include "wingdi.h"
#include "wine/test.h"
+#include <math.h>
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n",
expected, got)
+#define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f,
got %.2f\n", expected, got)
#define TABLE_LEN (23)
static void test_constructor_destructor(void)
@@ -767,16 +769,11 @@
GpStatus status;
GpGraphics *graphics = NULL;
HDC hdc = GetDC(0);
- GpPointF ptf[5];
- INT i;
-
- status = GdipCreateFromHDC(hdc, &graphics);
- expect(Ok, status);
-
- for(i = 0; i < 5; i++){
- ptf[i].X = 200.0 + i * 50.0 * (i % 2);
- ptf[i].Y = 200.0 + i * 50.0 * !(i % 2);
- }
+ GpPointF ptf[2];
+ GpPoint pt[2];
+
+ status = GdipCreateFromHDC(hdc, &graphics);
+ expect(Ok, status);
/* NULL arguments */
status = GdipTransformPoints(NULL, CoordinateSpacePage, CoordinateSpaceWorld, NULL,
0);
@@ -787,6 +784,101 @@
expect(InvalidParameter, status);
status = GdipTransformPoints(graphics, CoordinateSpacePage, CoordinateSpaceWorld,
ptf, -1);
expect(InvalidParameter, status);
+
+ ptf[0].X = 1.0;
+ ptf[0].Y = 0.0;
+ ptf[1].X = 0.0;
+ ptf[1].Y = 1.0;
+ status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld,
ptf, 2);
+ expect(Ok, status);
+ expectf(1.0, ptf[0].X);
+ expectf(0.0, ptf[0].Y);
+ expectf(0.0, ptf[1].X);
+ expectf(1.0, ptf[1].Y);
+
+ status = GdipTranslateWorldTransform(graphics, 5.0, 5.0, MatrixOrderAppend);
+ expect(Ok, status);
+ status = GdipSetPageUnit(graphics, UnitPixel);
+ expect(Ok, status);
+ status = GdipSetPageScale(graphics, 3.0);
+ expect(Ok, status);
+
+ ptf[0].X = 1.0;
+ ptf[0].Y = 0.0;
+ ptf[1].X = 0.0;
+ ptf[1].Y = 1.0;
+ status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld,
ptf, 2);
+ expect(Ok, status);
+ expectf(18.0, ptf[0].X);
+ expectf(15.0, ptf[0].Y);
+ expectf(15.0, ptf[1].X);
+ expectf(18.0, ptf[1].Y);
+
+ ptf[0].X = 1.0;
+ ptf[0].Y = 0.0;
+ ptf[1].X = 0.0;
+ ptf[1].Y = 1.0;
+ status = GdipTransformPoints(graphics, CoordinateSpacePage, CoordinateSpaceWorld,
ptf, 2);
+ expect(Ok, status);
+ expectf(6.0, ptf[0].X);
+ expectf(5.0, ptf[0].Y);
+ expectf(5.0, ptf[1].X);
+ expectf(6.0, ptf[1].Y);
+
+ ptf[0].X = 1.0;
+ ptf[0].Y = 0.0;
+ ptf[1].X = 0.0;
+ ptf[1].Y = 1.0;
+ status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpacePage,
ptf, 2);
+ expect(Ok, status);
+ expectf(3.0, ptf[0].X);
+ expectf(0.0, ptf[0].Y);
+ expectf(0.0, ptf[1].X);
+ expectf(3.0, ptf[1].Y);
+
+ ptf[0].X = 18.0;
+ ptf[0].Y = 15.0;
+ ptf[1].X = 15.0;
+ ptf[1].Y = 18.0;
+ status = GdipTransformPoints(graphics, CoordinateSpaceWorld, CoordinateSpaceDevice,
ptf, 2);
+ expect(Ok, status);
+ expectf(1.0, ptf[0].X);
+ expectf(0.0, ptf[0].Y);
+ expectf(0.0, ptf[1].X);
+ expectf(1.0, ptf[1].Y);
+
+ ptf[0].X = 6.0;
+ ptf[0].Y = 5.0;
+ ptf[1].X = 5.0;
+ ptf[1].Y = 6.0;
+ status = GdipTransformPoints(graphics, CoordinateSpaceWorld, CoordinateSpacePage,
ptf, 2);
+ expect(Ok, status);
+ expectf(1.0, ptf[0].X);
+ expectf(0.0, ptf[0].Y);
+ expectf(0.0, ptf[1].X);
+ expectf(1.0, ptf[1].Y);
+
+ ptf[0].X = 3.0;
+ ptf[0].Y = 0.0;
+ ptf[1].X = 0.0;
+ ptf[1].Y = 3.0;
+ status = GdipTransformPoints(graphics, CoordinateSpacePage, CoordinateSpaceDevice,
ptf, 2);
+ expect(Ok, status);
+ expectf(1.0, ptf[0].X);
+ expectf(0.0, ptf[0].Y);
+ expectf(0.0, ptf[1].X);
+ expectf(1.0, ptf[1].Y);
+
+ pt[0].X = 1;
+ pt[0].Y = 0;
+ pt[1].X = 0;
+ pt[1].Y = 1;
+ status = GdipTransformPointsI(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld,
pt, 2);
+ expect(Ok, status);
+ expect(18, pt[0].X);
+ expect(15, pt[0].Y);
+ expect(15, pt[1].X);
+ expect(18, pt[1].Y);
GdipDeleteGraphics(graphics);
ReleaseDC(0, hdc);