Author: tkreuzer
Date: Sun Jan 16 20:53:48 2011
New Revision: 50404
URL:
http://svn.reactos.org/svn/reactos?rev=50404&view=rev
Log:
[GDI32_APITEST]
Add tests for DPtoLP
- More tests for CombineTransform, CreateBitmapIndirect and SelectObject
Added:
trunk/rostests/apitests/gdi32/DPtoLP.c (with props)
Modified:
trunk/rostests/apitests/gdi32/CombineTransform.c
trunk/rostests/apitests/gdi32/CreateBitmapIndirect.c
trunk/rostests/apitests/gdi32/SelectObject.c
trunk/rostests/apitests/gdi32/gdi32_apitest.rbuild
trunk/rostests/apitests/gdi32/testlist.c
Modified: trunk/rostests/apitests/gdi32/CombineTransform.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CombineTra…
==============================================================================
--- trunk/rostests/apitests/gdi32/CombineTransform.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/CombineTransform.c [iso-8859-1] Sun Jan 16 20:53:48
2011
@@ -12,10 +12,33 @@
#include <reactos/win32k/ntgdityp.h>
#include <reactos/win32k/ntgdihdl.h>
+#define ok_int(x, y) ok(x == y, "Wrong value for " #x ", expected "
#y ", got %ld\n", (long)x);
+#define ok_flt(x, y) ok(x == y, "Wrong value for " #x ", expected "
#y ", got %f\n", (double)x);
+
+#define ok_xform(xform, m11, m12, m21, m22, dx, dy) \
+ ok_flt(xform.eM11, m11); \
+ ok_flt(xform.eM12, m12); \
+ ok_flt(xform.eM21, m21); \
+ ok_flt(xform.eM22, m22); \
+ ok_flt(xform.eDx, dx); \
+ ok_flt(xform.eDy, dy);
+
void Test_CombineTransform()
{
XFORM xform1, xform2, xform3;
BOOL ret;
+
+ /* Test NULL paramters */
+ SetLastError(ERROR_SUCCESS);
+ ret = CombineTransform(&xform3, &xform1, NULL);
+ ok_int(ret, 0);
+ ret = CombineTransform(&xform3, NULL, &xform2);
+ ok_int(ret, 0);
+ ret = CombineTransform(NULL, &xform1, &xform2);
+ ok_int(ret, 0);
+ ret = CombineTransform(&xform3, &xform1, &xform2);
+ ok_int(ret, 0);
+ ok_int(GetLastError(), ERROR_SUCCESS);
/* 2 Identity matrices */
xform1.eM11 = 1.0;
@@ -27,80 +50,49 @@
xform2 = xform1;
SetLastError(ERROR_SUCCESS);
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
- ok(xform3.eM11 == 1.0, "eM11: Expected 1.0, got %f\n", xform3.eM11);
- ok(xform3.eM12 == 0, "eM11: Expected 0, got %f\n", xform3.eM12);
- ok(xform3.eM21 == 0, "eM11: Expected 0, got %f\n", xform3.eM21);
- ok(xform3.eM22 == 1.0, "eM11: Expected 1.0, got %f\n", xform3.eM22);
- ok(xform3.eDx == 0, "eM11: Expected 0, got %f\n", xform3.eDx);
- ok(xform3.eDy == 0, "eM11: Expected 0, got %f\n", xform3.eDy);
- ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+ ok_int(ret, 1);
+ ok_xform(xform3, 1.0, 0., 0., 1.0, 0., 0.);
+ ok_int(GetLastError(), ERROR_SUCCESS);
/* 2 Identity matrices with offsets */
xform1.eDx = 20.0;
xform1.eDy = -100;
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
- ok(xform3.eM11 == 1.0, "eM11: Expected 1.0, got %f\n", xform3.eM11);
- ok(xform3.eM12 == 0, "eM11: Expected 0, got %f\n", xform3.eM12);
- ok(xform3.eM21 == 0, "eM11: Expected 0, got %f\n", xform3.eM21);
- ok(xform3.eM22 == 1.0, "eM11: Expected 1.0, got %f\n", xform3.eM22);
- ok(xform3.eDx == 20.0, "eM11: Expected 20.0, got %f\n", xform3.eDx);
- ok(xform3.eDy == -100, "eM11: Expected -100, got %f\n", xform3.eDy);
+ ok_int(ret, 1);
+ ok_xform(xform3, 1.0, 0., 0., 1.0, 20.0, -100.0);
+
xform2.eDx = -60.0;
xform2.eDy = -20;
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
- ok(xform3.eDx == -40.0, "eM11: Expected 40.0, got %f\n", xform3.eDx);
- ok(xform3.eDy == -120.0, "eM11: Expected -120.0, got %f\n", xform3.eDy);
+ ok_int(ret, 1);
+ ok_flt(xform3.eDx, -40.0);
+ ok_flt(xform3.eDy, -120.0);
/* add some stretching */
xform2.eM11 = 2;
xform2.eM22 = 4;
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
- ok(xform3.eM11 == 2.0, "eM11: Expected 2.0, got %f\n", xform3.eM11);
- ok(xform3.eM12 == 0, "eM11: Expected 0, got %f\n", xform3.eM12);
- ok(xform3.eM21 == 0, "eM11: Expected 0, got %f\n", xform3.eM21);
- ok(xform3.eM22 == 4.0, "eM11: Expected 4.0, got %f\n", xform3.eM22);
- ok(xform3.eDx == -20.0, "eM11: Expected 20.0, got %f\n", xform3.eDx);
- ok(xform3.eDy == -420.0, "eM11: Expected 420.0, got %f\n", xform3.eDy);
+ ok_int(ret, 1);
+ ok_xform(xform3, 2.0, 0., 0., 4.0, -20.0, -420.0);
/* add some more stretching */
xform1.eM11 = -2.5;
xform1.eM22 = 0.5;
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
- ok(xform3.eM11 == -5.0, "eM11: Expected -5.0, got %f\n", xform3.eM11);
- ok(xform3.eM12 == 0, "eM11: Expected 0, got %f\n", xform3.eM12);
- ok(xform3.eM21 == 0, "eM11: Expected 0, got %f\n", xform3.eM21);
- ok(xform3.eM22 == 2.0, "eM11: Expected 2.0, got %f\n", xform3.eM22);
- ok(xform3.eDx == -20.0, "eM11: Expected 20.0, got %f\n", xform3.eDx);
- ok(xform3.eDy == -420.0, "eM11: Expected 420.0, got %f\n", xform3.eDy);
+ ok_int(ret, 1);
+ ok_xform(xform3, -5.0, 0., 0., 2.0, -20.0, -420.0);
xform1.eM12 = 2.0;
xform1.eM21 = -0.5;
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
- ok(xform3.eM11 == -5.0, "eM11: Expected -5.0, got %f\n", xform3.eM11);
- ok(xform3.eM12 == 8.0, "eM11: Expected 8.0, got %f\n", xform3.eM12);
- ok(xform3.eM21 == -1.0, "eM11: Expected -1.0, got %f\n", xform3.eM21);
- ok(xform3.eM22 == 2.0, "eM11: Expected 2.0, got %f\n", xform3.eM22);
- ok(xform3.eDx == -20.0, "eM11: Expected 20.0, got %f\n", xform3.eDx);
- ok(xform3.eDy == -420.0, "eM11: Expected 420.0, got %f\n", xform3.eDy);
+ ok_int(ret, 1);
+ ok_xform(xform3, -5.0, 8.0, -1.0, 2.0, -20.0, -420.0);
xform2.eM12 = 4.0;
xform2.eM21 = 6.5;
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
- ok(xform3.eM11 == 8.0, "eM11: Expected 8.0, got %f\n", xform3.eM11);
- ok(xform3.eM12 == -2.0, "eM11: Expected -2.0, got %f\n", xform3.eM12);
- ok(xform3.eM21 == 2.25, "eM11: Expected 2.25, got %f\n", xform3.eM21);
- ok(xform3.eM22 == 0.00, "eM11: Expected 0.00, got %f\n", xform3.eM22);
- ok(xform3.eDx == -670.0, "eM11: Expected -670.0, got %f\n", xform3.eDx);
- ok(xform3.eDy == -340.0, "eM11: Expected -340.0, got %f\n", xform3.eDy);
- ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
+ ok_int(ret, 1);
+ ok_xform(xform3, 8.0, -2.0, 2.25, 0.0, -670.0, -340.0);
xform1.eM11 = 1.;
xform1.eM12 = 0;
@@ -118,48 +110,63 @@
xform1.eDx = 4294967167.999999762;
ok(xform1.eDx == 4294967296.0, "float rounding error.\n");
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 0, "expected ret = 0, got %d\n", ret);
- ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+ ok_int(ret, 0);
+ ok_int(GetLastError(), ERROR_SUCCESS);
xform1.eDx = -4294967167.999999761;
ok(xform1.eDx == -4294967040.0, "float rounding error.\n");
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
+ ok_int(ret, 1);
xform1.eDx = -4294967167.999999762;
ok(xform1.eDx == -4294967296.0, "float rounding error.\n");
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 0, "expected ret = 0, got %d\n", ret);
- ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+ ok_int(ret, 0);
+ ok_int(GetLastError(), ERROR_SUCCESS);
xform1.eDx = 0;
xform1.eDy = 4294967167.999999761;
ok(xform1.eDy == 4294967040.0, "float rounding error.\n");
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
+ ok_int(ret, 1);
+
+ xform2.eDy = 1;
+ ret = CombineTransform(&xform3, &xform1, &xform2);
+ ok_int(ret, 1);
xform1.eDy = 4294967167.999999762;
ok(xform1.eDy == 4294967296.0, "float rounding error.\n");
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 0, "expected ret = 0, got %d\n", ret);
- ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+ ok_int(ret, 0);
+ ok_int(GetLastError(), ERROR_SUCCESS);
xform1.eDy = -4294967167.999999761;
ok(xform1.eDy == -4294967040.0, "float rounding error.\n");
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
+ ok_int(ret, 1);
xform1.eDy = -4294967167.999999762;
ok(xform1.eDy == -4294967296.0, "float rounding error.\n");
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 0, "expected ret = 0, got %d\n", ret);
- ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+ ok_int(ret, 0);
+ ok_int(GetLastError(), ERROR_SUCCESS);
+
+ xform2.eDy = 10000;
+ ret = CombineTransform(&xform3, &xform1, &xform2);
+ ok_int(ret, 1);
+
+ xform1.eDx = -4294967167.999999762;
+ xform1.eM11 = 1000.0;
+ xform2.eM11 = 1000.0;
+ ret = CombineTransform(&xform3, &xform1, &xform2);
+ ok_int(ret, 0);
+ ok_int(GetLastError(), ERROR_SUCCESS);
xform1.eDx = 100000.0;
xform2.eM11 = 100000.0;
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 0, "expected ret = 0, got %d\n", ret);
- ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+ ok_int(ret, 0);
+ ok_int(GetLastError(), ERROR_SUCCESS);
/* Some undefined values */
*(DWORD*)&xform1.eM11 = 0xffc00000; // (0.0F/0.0F)
@@ -171,14 +178,14 @@
xform2 = xform1;
SetLastError(ERROR_SUCCESS);
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
+ ok_int(ret, 1);
ok(*(DWORD*)&xform3.eM11 == 0xffc00000, "eM11: Expected 0xffc00000, got
0x%lx\n", *(DWORD*)&xform3.eM11);
ok(xform3.eM12 == 0, "eM12: Expected 0, got %f\n", xform3.eM12);
ok(xform3.eM21 == 0, "eM21: Expected 0, got %f\n", xform3.eM21);
ok(*(DWORD*)&xform3.eM22 == 0x7f800000, "eM22: Expected 0x7f800000, got
0x%lx\n", *(DWORD*)&xform3.eM22);
ok(xform3.eDx == 0, "eDx: Expected 0, got %f\n", xform3.eDx);
ok(xform3.eDy == 0, "eDy: Expected 0, got %f\n", xform3.eDy);
- ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+ ok_int(GetLastError(), ERROR_SUCCESS);
/* Some undefined values */
xform2.eM11 = 1.;
@@ -186,14 +193,15 @@
xform2.eM12 = 1.;
xform2.eM21 = 1.;
ret = CombineTransform(&xform3, &xform1, &xform2);
- ok(ret == 1, "expected ret = 1, got %d\n", ret);
- ok(*(DWORD*)&xform3.eM11 == 0xffc00000, "eM11: Expected 0xffc00000, got
0x%lx\n", *(DWORD*)&xform3.eM11);
- ok(*(DWORD*)&xform3.eM12 == 0xffc00000, "eM12: Expected 0xffc00000, got
0x%lx\n", *(DWORD*)&xform3.eM12);
- ok(*(DWORD*)&xform3.eM21 == 0x7f800000, "eM21: Expected 0x7f800000, got
0x%lx\n", *(DWORD*)&xform3.eM21);
- ok(*(DWORD*)&xform3.eM22 == 0x7f800000, "eM22: Expected 0x7f800000, got
0x%lx\n", *(DWORD*)&xform3.eM22);
+ ok_int(ret, 1);
+
+ ok_int(*(DWORD*)&xform3.eM11, 0xffc00000);
+ ok_int(*(DWORD*)&xform3.eM12, 0xffc00000);
+ ok_int(*(DWORD*)&xform3.eM21, 0x7f800000);
+ ok_int(*(DWORD*)&xform3.eM22, 0x7f800000);
ok(xform3.eDx == 0, "eDx: Expected 0, got %f\n", xform3.eDx);
ok(xform3.eDy == 0, "eDy: Expected 0, got %f\n", xform3.eDy);
- ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+ ok_int(GetLastError(), ERROR_SUCCESS);
}
Modified: trunk/rostests/apitests/gdi32/CreateBitmapIndirect.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CreateBitm…
==============================================================================
--- trunk/rostests/apitests/gdi32/CreateBitmapIndirect.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/CreateBitmapIndirect.c [iso-8859-1] Sun Jan 16 20:53:48
2011
@@ -59,6 +59,17 @@
win_hBmp = CreateBitmapIndirect(&win_bitmap);
ok(win_hBmp != 0, "CreateBitmapIndirect failed\n");
+ RtlZeroMemory(&win_bitmap,sizeof(BITMAP));
+ win_bitmap.bmBits = 0;
+ win_bitmap.bmBitsPixel = 8;
+ win_bitmap.bmHeight = 0xF000;
+ win_bitmap.bmPlanes = 1;
+ win_bitmap.bmType = 1;
+ win_bitmap.bmWidth = 0x8000;
+ win_bitmap.bmWidthBytes = win_bitmap.bmWidth;
+ win_hBmp = CreateBitmapIndirect(&win_bitmap);
+ ok(win_hBmp != 0, "CreateBitmapIndirect failed\n");
+
DeleteObject(win_hBmp);
}
Added: trunk/rostests/apitests/gdi32/DPtoLP.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/DPtoLP.c?r…
==============================================================================
--- trunk/rostests/apitests/gdi32/DPtoLP.c (added)
+++ trunk/rostests/apitests/gdi32/DPtoLP.c [iso-8859-1] Sun Jan 16 20:53:48 2011
@@ -1,0 +1,191 @@
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: GPL - See COPYING in the top level directory
+ * PURPOSE: Test for ...
+ * PROGRAMMERS: Timo Kreuzer
+ */
+
+#include <stdio.h>
+#include <wine/test.h>
+#include <windows.h>
+
+#define ok_int(x, y) ok(x == y, "Wrong value for " #x ", expected "
#y ", got %ld\n", (long)x);
+
+void Test_DPtoLP_Params()
+{
+ BOOL ret;
+ HDC hdc;
+ POINT apt[2];
+
+ apt[0].x = 0;
+ apt[0].y = 0;
+ apt[1].x = -1000;
+ apt[1].y = 1000;
+
+ SetLastError(ERROR_SUCCESS);
+ ret = DPtoLP(NULL, NULL, 0);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+
+ ret = DPtoLP(NULL, NULL, -1);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+
+ ret = DPtoLP(NULL, (PVOID)0x80000000, -1);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+
+ ret = DPtoLP(NULL, NULL, 2);
+ ok(ret == 0, "Expected ret == 0, got %d\n", ret);
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "Exected ERROR_INVALID_PARAMETER, got
%ld\n", GetLastError());
+
+ SetLastError(ERROR_SUCCESS);
+ ret = DPtoLP(NULL, apt, 2);
+ ok(ret == 0, "Expected ret == 0, got %d\n", ret);
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "Exected ERROR_INVALID_PARAMETER, got
%ld\n", GetLastError());
+
+ SetLastError(ERROR_SUCCESS);
+ ret = DPtoLP(NULL, apt, 0);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+
+ SetLastError(ERROR_SUCCESS);
+ ret = DPtoLP(NULL, apt, -2);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+
+ SetLastError(ERROR_SUCCESS);
+ ret = DPtoLP((HDC)-4, apt, -2);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+
+ hdc = GetDC(0);
+ SetLastError(ERROR_SUCCESS);
+ ret = DPtoLP(hdc, NULL, 2);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+
+ hdc = GetDC(0);
+ SetLastError(ERROR_SUCCESS);
+ ret = DPtoLP(hdc, (PVOID)0x80000000, 2);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n",
GetLastError());
+
+
+ ReleaseDC(0, hdc);
+}
+
+void Test_DPtoLP()
+{
+ BOOL ret;
+ HDC hdc;
+ POINT apt[2];
+ XFORM xform;
+
+ apt[0].x = 1;
+ apt[0].y = 1;
+ apt[1].x = -1000;
+ apt[1].y = 1000;
+
+ hdc = GetDC(0);
+
+ SetMapMode(hdc, MM_TEXT);
+ ret = DPtoLP(hdc, apt, 2);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok_int(apt[0].x, 1);
+ ok_int(apt[0].y, 1);
+ ok_int(apt[1].x, -1000);
+ ok_int(apt[1].y, 1000);
+
+ SetMapMode(hdc, MM_LOMETRIC);
+ ret = DPtoLP(hdc, apt, 2);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok_int(apt[0].x, 4);
+ ok_int(apt[0].y, -4);
+ ok_int(apt[1].x, -3527);
+ ok_int(apt[1].y, -3527);
+
+ SetGraphicsMode(hdc, GM_ADVANCED);
+ SetMapMode(hdc, MM_ANISOTROPIC);
+
+ xform.eM11 = 1.;
+ xform.eM12 = 0.;
+ xform.eM21 = 0.;
+ xform.eM22 = 1.;
+ xform.eDx = 4294967167.999999761;
+ xform.eDy = 1.;
+ ret = SetWorldTransform(hdc, &xform);
+ ok(ret == 1, "ret\n");
+
+ ret = DPtoLP(hdc, apt, 2);
+ ok(ret == 1, "Expected ret == 0, got %d\n", ret);
+ ok_int(apt[0].x, 526);
+ ok_int(apt[0].y, 13);
+ ok_int(apt[1].x, -11929);
+ ok_int(apt[1].y, 12440);
+
+ xform.eM11 = 10000000.;
+ ret = SetWorldTransform(hdc, &xform);
+ ret = DPtoLP(hdc, apt, 2);
+ ok(ret == 1, "Expected ret == 0, got %d\n", ret);
+ ok_int(apt[0].x, -429);
+ ok_int(apt[0].y, -47);
+ ok_int(apt[1].x, -429);
+ ok_int(apt[1].y, -43881);
+
+ xform.eM11 = 1.;
+ xform.eDx = 4294967167.999999762; // this is too big
+ ret = SetWorldTransform(hdc, &xform);
+ ok(ret == 1, "ret\n");
+ ret = DPtoLP(hdc, apt, 2);
+ ok(ret == 0, "Expected ret == 0, got %d\n", ret);
+ ok_int(apt[0].x, -429);
+ ok_int(apt[0].y, -47);
+ ok_int(apt[1].x, -429);
+ ok_int(apt[1].y, -43881);
+
+ xform.eM11 = 2.;
+ xform.eDx = 4294967167.999999762;
+ ret = SetWorldTransform(hdc, &xform);
+ ok(ret == 1, "ret\n");
+ ret = DPtoLP(hdc, apt, 2);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok_int(apt[0].x, 2147482891);
+ ok_int(apt[0].y, 165);
+ ok_int(apt[1].x, 2147482891);
+ ok_int(apt[1].y, 154782);
+
+ apt[0].x = 1;
+ apt[0].y = 1;
+ apt[1].x = -1000;
+ apt[1].y = 1000;
+
+ xform.eM11 = 10000000.;
+ ret = SetWorldTransform(hdc, &xform);
+ ok(ret == 1, "ret\n");
+ ret = DPtoLP(hdc, apt, 2);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok_int(apt[0].x, -429);
+ ok_int(apt[0].y, -5);
+ ok_int(apt[1].x, -429);
+ ok_int(apt[1].y, -3528);
+
+ xform.eM11 = 1000000.;
+ ret = SetWorldTransform(hdc, &xform);
+ ok(ret == 1, "ret\n");
+ ret = DPtoLP(hdc, apt, 2);
+ ok(ret == 1, "Expected ret == 1, got %d\n", ret);
+ ok_int(apt[0].x, -4295);
+ ok_int(apt[0].y, 17);
+ ok_int(apt[1].x, -4295);
+ ok_int(apt[1].y, 12443);
+
+ ReleaseDC(0, hdc);
+}
+
+START_TEST(DPtoLP)
+{
+ Test_DPtoLP_Params();
+ Test_DPtoLP();
+}
+
Propchange: trunk/rostests/apitests/gdi32/DPtoLP.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rostests/apitests/gdi32/SelectObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/SelectObje…
==============================================================================
--- trunk/rostests/apitests/gdi32/SelectObject.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/SelectObject.c [iso-8859-1] Sun Jan 16 20:53:48 2011
@@ -113,6 +113,13 @@
hOldObj = SelectObject(hDC, hOldObj);
RTEST(hOldObj == hNewObj);
+ /* Test invalid BITMAP */
+ hNewObj = CreateBitmap(2, 2, 1, 4, &bmBits);
+ ok(hNewObj != NULL, "CreateBitmap failed. Skipping tests.\n");
+ if (hNewObj == NULL) return;
+ hOldObj = SelectObject(hDC, hNewObj);
+ ok(hOldObj == NULL, "should fail\n");
+
/* Test CLIOBJ */
/* Test PATH */
Modified: trunk/rostests/apitests/gdi32/gdi32_apitest.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/gdi32_apit…
==============================================================================
--- trunk/rostests/apitests/gdi32/gdi32_apitest.rbuild [iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/gdi32_apitest.rbuild [iso-8859-1] Sun Jan 16 20:53:48
2011
@@ -19,6 +19,7 @@
<file>CreateFontIndirect.c</file>
<file>CreatePen.c</file>
<file>CreateRectRgn.c</file>
+ <file>DPtoLP.c</file>
<file>EngAcquireSemaphore.c</file>
<file>EngCreateSemaphore.c</file>
<file>EngDeleteSemaphore.c</file>
Modified: trunk/rostests/apitests/gdi32/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/testlist.c…
==============================================================================
--- trunk/rostests/apitests/gdi32/testlist.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/testlist.c [iso-8859-1] Sun Jan 16 20:53:48 2011
@@ -15,6 +15,7 @@
extern void func_CreateFontIndirect(void);
extern void func_CreatePen(void);
extern void func_CreateRectRgn(void);
+extern void func_DPtoLP(void);
extern void func_EngAcquireSemaphore(void);
extern void func_EngCreateSemaphore(void);
extern void func_EngDeleteSemaphore(void);
@@ -59,6 +60,7 @@
{ "CreateFontIndirect", func_CreateFontIndirect },
{ "CreatePen", func_CreatePen },
{ "CreateRectRgn", func_CreateRectRgn },
+ { "DPtoLP", func_DPtoLP },
{ "EngAcquireSemaphore", func_EngAcquireSemaphore },
{ "EngCreateSemaphore", func_EngCreateSemaphore },
{ "EngDeleteSemaphore", func_EngDeleteSemaphore },