mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[GDI32_APITEST] Improve SetWorldTransform testcase (#1717)
Improve the testcase for gdi32!SetWorldTransform function. CORE-15554
This commit is contained in:
parent
6d238e4513
commit
595ae4c551
1 changed files with 41 additions and 20 deletions
|
@ -3,23 +3,24 @@
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* PURPOSE: Test for SetWorldTransform
|
* PURPOSE: Test for SetWorldTransform
|
||||||
* PROGRAMMERS: Timo Kreuzer
|
* PROGRAMMERS: Timo Kreuzer
|
||||||
|
* Katayama Hirofumi MZ
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
|
||||||
void Test_SetWorldTransform()
|
void Test_SetWorldTransform()
|
||||||
{
|
{
|
||||||
HDC hdcScreen, hdc;
|
HDC hdcScreen, hdc;
|
||||||
XFORM xform;
|
XFORM xform;
|
||||||
BOOL result;
|
BOOL result;
|
||||||
//PGDI_TABLE_ENTRY pEntry;
|
//PGDI_TABLE_ENTRY pEntry;
|
||||||
//DC_ATTR* pdcattr;
|
//DC_ATTR* pdcattr;
|
||||||
|
|
||||||
/* Create a DC */
|
/* Create a DC */
|
||||||
hdcScreen = GetDC(NULL);
|
hdcScreen = GetDC(NULL);
|
||||||
hdc = CreateCompatibleDC(hdcScreen);
|
hdc = CreateCompatibleDC(hdcScreen);
|
||||||
ReleaseDC(NULL, hdcScreen);
|
ReleaseDC(NULL, hdcScreen);
|
||||||
SetGraphicsMode(hdc, GM_ADVANCED);
|
SetGraphicsMode(hdc, GM_ADVANCED);
|
||||||
|
|
||||||
/* Set identity transform */
|
/* Set identity transform */
|
||||||
xform.eM11 = 1;
|
xform.eM11 = 1;
|
||||||
|
@ -70,15 +71,15 @@ void Test_SetWorldTransform()
|
||||||
result = GetWorldTransform(hdc, &xform);
|
result = GetWorldTransform(hdc, &xform);
|
||||||
ok(result == 1, "GetWorldTransform should succeed\n");
|
ok(result == 1, "GetWorldTransform should succeed\n");
|
||||||
ok(xform.eM11 == 2, "xform.eM11 should be 2\n");
|
ok(xform.eM11 == 2, "xform.eM11 should be 2\n");
|
||||||
ok(xform.eM12 == (FLOAT)3.0001, "xform.eM11 should be 3.0001\n");
|
ok(xform.eM12 == (FLOAT)3.0001, "xform.eM12 should be 3.0001\n");
|
||||||
ok(xform.eM21 == 4, "xform.eM11 should be 4\n");
|
ok(xform.eM21 == 4, "xform.eM21 should be 4\n");
|
||||||
ok(xform.eM22 == 6, "xform.eM11 should be 6\n");
|
ok(xform.eM22 == 6, "xform.eM22 should be 6\n");
|
||||||
|
|
||||||
/* Set smallest possible values */
|
/* Set smallest possible values */
|
||||||
xform.eM11 = (FLOAT)1.4e-45;
|
xform.eM11 = 1.17549435e-38f;
|
||||||
xform.eM12 = 0;
|
xform.eM12 = 0;
|
||||||
xform.eM21 = 0;
|
xform.eM21 = 0;
|
||||||
xform.eM22 = (FLOAT)1.4e-45;
|
xform.eM22 = 1.17549435e-38f;
|
||||||
ok(xform.eM11 != (FLOAT)0.0, "xform.eM11 shouldn't be 0.0\n");
|
ok(xform.eM11 != (FLOAT)0.0, "xform.eM11 shouldn't be 0.0\n");
|
||||||
ok(xform.eM22 != (FLOAT)0.0, "xform.eM22 shouldn't be 0.0\n");
|
ok(xform.eM22 != (FLOAT)0.0, "xform.eM22 shouldn't be 0.0\n");
|
||||||
ok(xform.eM11 * xform.eM22 != (FLOAT)0.0, "xform.eM12 * xform.eM21 shouldn't be 0.0\n");
|
ok(xform.eM11 * xform.eM22 != (FLOAT)0.0, "xform.eM12 * xform.eM21 shouldn't be 0.0\n");
|
||||||
|
@ -89,15 +90,35 @@ void Test_SetWorldTransform()
|
||||||
result = GetWorldTransform(hdc, &xform);
|
result = GetWorldTransform(hdc, &xform);
|
||||||
ok(result == 1, "GetWorldTransform should succeed\n");
|
ok(result == 1, "GetWorldTransform should succeed\n");
|
||||||
ok(xform.eM11 > 0, "xform.eM11 should not be 0\n");
|
ok(xform.eM11 > 0, "xform.eM11 should not be 0\n");
|
||||||
ok(xform.eM12 == 0, "xform.eM11 should be 0\n");
|
ok(xform.eM12 == 0, "xform.eM12 should be 0\n");
|
||||||
ok(xform.eM21 == 0, "xform.eM11 should be 0\n");
|
ok(xform.eM21 == 0, "xform.eM21 should be 0\n");
|
||||||
ok(xform.eM22 > 0, "xform.eM11 should not be 0\n");
|
ok(xform.eM22 > 0, "xform.eM22 should not be 0\n");
|
||||||
|
|
||||||
DeleteDC(hdc);
|
xform.eM11 = 0;
|
||||||
|
xform.eM12 = 1;
|
||||||
|
xform.eM21 = 1;
|
||||||
|
xform.eM22 = 0;
|
||||||
|
result = SetWorldTransform(hdc, &xform);
|
||||||
|
ok_int(result, 1);
|
||||||
|
|
||||||
|
xform.eM11 = 1;
|
||||||
|
xform.eM12 = 1;
|
||||||
|
xform.eM21 = 1;
|
||||||
|
xform.eM22 = 1;
|
||||||
|
result = SetWorldTransform(hdc, &xform);
|
||||||
|
ok_int(result, 0);
|
||||||
|
|
||||||
|
result = GetWorldTransform(hdc, &xform);
|
||||||
|
ok_int(result, 1);
|
||||||
|
ok(xform.eM11 == 0, "xform.eM11 should be 0\n");
|
||||||
|
ok(xform.eM12 == 1, "xform.eM12 should be 1\n");
|
||||||
|
ok(xform.eM21 == 1, "xform.eM21 should be 1\n");
|
||||||
|
ok(xform.eM22 == 0, "xform.eM22 should be 0\n");
|
||||||
|
|
||||||
|
DeleteDC(hdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST(SetWorldTransform)
|
START_TEST(SetWorldTransform)
|
||||||
{
|
{
|
||||||
Test_SetWorldTransform();
|
Test_SetWorldTransform();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue