[GDI32_APITEST] Rewrite LPtoDP testcase (#1508)

Sorry, I had to rewrite gdi32!LPtoDP testcase. ROSTESTS-319
This commit is contained in:
Katayama Hirofumi MZ 2019-04-22 13:48:14 +09:00 committed by GitHub
parent eabae983e0
commit 3a2a99efb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,316 +1,497 @@
/* /*
* PROJECT: ReactOS api tests * PROJECT: ReactOS api tests
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
* PURPOSE: Test for ... * PURPOSE: Test for LPtoDP
* PROGRAMMERS: Katayama Hirofumi MZ * PROGRAMMERS: Katayama Hirofumi MZ
*/ */
#include "precomp.h" #include "precomp.h"
#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL) #define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
#define IGNORE 0xFACECAFE
#define CALC_VALUE_1 0xBADACE01
#define CALC_VALUE_2 0xFEEDF00D
#define CALC_VALUE_3 0xDEADCAD1
#define DISPLAY_SIZE 0xDEADBEEF
#define NEGA_DISPLAY_SIZE 0xBEEFDEAD
void Test_LPtoDP_Params() typedef struct PRESET
{ {
HDC hdc; LONG xWnd;
POINT apt[2]; LONG yWnd;
LONG cxWnd;
LONG cyWnd;
apt[0].x = 0; LONG xView;
apt[0].y = 0; LONG yView;
apt[1].x = -1000; LONG cxView;
apt[1].y = 1000; LONG cyView;
} PRESET;
SetLastError(ERROR_SUCCESS); typedef struct TEST_ENTRY
ok_int(LPtoDP(NULL, NULL, 0), 1); {
ok_err(ERROR_SUCCESS); INT lineno;
BOOL ret;
DWORD error;
ok_int(LPtoDP(NULL, NULL, -1), 1); BOOL bWndExt;
ok_err(ERROR_SUCCESS); INT nMapMode;
ok_int(LPtoDP(NULL, INVALID_POINTER, -1), 1); PRESET preset;
ok_err(ERROR_SUCCESS);
ok_int(LPtoDP(NULL, NULL, 2), 0); LONG xWndOut;
ok_err(ERROR_INVALID_PARAMETER); LONG yWndOut;
LONG cxWndOut;
LONG cyWndOut;
SetLastError(ERROR_SUCCESS); LONG xViewOut;
ok_int(LPtoDP(NULL, apt, 2), 0); LONG yViewOut;
ok_err(ERROR_INVALID_PARAMETER); LONG cxViewOut;
LONG cyViewOut;
SetLastError(ERROR_SUCCESS); POINT ptSrc;
ok_int(LPtoDP(NULL, apt, 0), 1); POINT ptDest;
ok_err(ERROR_SUCCESS); } TEST_ENTRY;
SetLastError(ERROR_SUCCESS); #define PRESET0 { 0, 0, 0, 0, 0, 0, 0, 0 }
ok_int(LPtoDP(NULL, apt, -2), 1); #define PRESET1 { 0, 0, 1, 1, 0, 0, 1, 1 }
ok_err(ERROR_SUCCESS); #define PRESET2 { 75, 0, 1, 1, 0, 0, 10, 10 }
#define PRESET3 { 0, 180, 1, 1, 120, 0, 1, 1 }
#define PRESET4 { 0, 0, 200, 1, 50, 0, 1, 1 }
#define PRESET5 { 0, 0, 1, 200, 0, 0, -100, 1 }
#define PRESET6 { 50, 0, 1, 200, 10, 0, 100, 200 }
SetLastError(ERROR_SUCCESS); static const TEST_ENTRY s_entries[] =
ok_int(LPtoDP((HDC)-4, apt, -2), 1); {
ok_err(ERROR_SUCCESS); { __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET0, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { 100, 150 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET1, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { 100, 150 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET2, 75, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { 25, 150 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET3, 0, 180, 1, 1, 120, 0, 1, 1, { 100, 150 }, { 220, -30 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET4, 0, 0, 1, 1, 50, 0, 1, 1, { 100, 150 }, { 150, 150 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET5, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { 100, 150 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET6, 50, 0, 1, 1, 10, 0, 1, 1, { 100, 150 }, { 60, 150 } },
hdc = GetDC(0); { __LINE__, TRUE, 0xDEADBEEF, FALSE, MM_ANISOTROPIC, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, IGNORE, IGNORE, { 100, 150 }, { IGNORE, IGNORE } },
SetLastError(ERROR_SUCCESS); { __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET1, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { 100, 150 } },
ok_int(LPtoDP(hdc, NULL, 2), 1); { __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET2, 75, 0, 1, 1, 0, 0, 10, 10, { 100, 150 }, { 250, 1500 } },
ok_err(ERROR_SUCCESS); { __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET3, 0, 180, 1, 1, 120, 0, 1, 1, { 100, 150 }, { 220, -30 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET4, 0, 0, 200, 1, 50, 0, 1, 1, { 100, 150 }, { 51, 150 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET5, 0, 0, 1, 200, 0, 0, -100, 1, { 100, 150 }, { -10000, 1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET6, 50, 0, 1, 200, 10, 0, 100, 200, { 100, 150 }, { 5010, 150 } },
hdc = GetDC(0); { __LINE__, TRUE, 0xDEADBEEF, FALSE, MM_ISOTROPIC, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, IGNORE, IGNORE, { 100, 150 }, { IGNORE, IGNORE } },
SetLastError(ERROR_SUCCESS); { __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET1, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { 100, 150 } },
ok_int(LPtoDP(hdc, INVALID_POINTER, 2), 1); { __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET2, 75, 0, 1, 1, 0, 0, 10, 10, { 100, 150 }, { 250, 1500 } },
ok_err(ERROR_SUCCESS); { __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET3, 0, 180, 1, 1, 120, 0, 1, 1, { 100, 150 }, { 220, -30 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET4, 0, 0, 200, 1, 50, 0, 1, 0, { 100, 150 }, { 51, 0 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET5, 0, 0, 1, 200, 0, 0, 0, 1, { 100, 150 }, { 0, 0 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET6, 50, 0, 1, 200, 10, 0, 1, 200, { 100, 150 }, { 60, 150 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
ReleaseDC(0, hdc); { __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_1 , CALC_VALUE_1 } },
};
static const size_t s_entries_count = _countof(s_entries);
static const TEST_ENTRY s_shifted_entries[] =
{
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET0, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET1, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET2, 75, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET3, 0, 180, 1, 1, 120, 0, 1, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET4, 0, 0, 1, 1, 50, 0, 1, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET5, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET6, 50, 0, 1, 1, 10, 0, 1, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, FALSE, MM_ANISOTROPIC, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, IGNORE, IGNORE, { 100, 150 }, { IGNORE, IGNORE } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET1, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET2, 75, 0, 1, 1, 0, 0, 10, 10, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET3, 0, 180, 1, 1, 120, 0, 1, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET4, 0, 0, 200, 1, 50, 0, 1, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET5, 0, 0, 1, 200, 0, 0, -100, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET6, 50, 0, 1, 200, 10, 0, 100, 200, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, FALSE, MM_ISOTROPIC, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, IGNORE, IGNORE, { 100, 150 }, { IGNORE, IGNORE } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET1, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET2, 75, 0, 1, 1, 0, 0, 10, 10, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET3, 0, 180, 1, 1, 120, 0, 1, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET4, 0, 0, 200, 1, 50, 0, 1, 0, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET5, 0, 0, 1, 200, 0, 0, 0, 1, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET6, 50, 0, 1, 200, 10, 0, 1, 200, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_2, CALC_VALUE_2 } },
};
static const size_t s_shifted_entries_count = _countof(s_shifted_entries);
static const TEST_ENTRY s_transformed_entries[] =
{
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET0, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET1, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET2, 75, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET3, 0, 180, 1, 1, 120, 0, 1, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET4, 0, 0, 1, 1, 50, 0, 1, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET5, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TEXT, PRESET6, 50, 0, 1, 1, 10, 0, 1, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, FALSE, MM_ANISOTROPIC, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, IGNORE, IGNORE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET1, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET2, 75, 0, 1, 1, 0, 0, 10, 10, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET3, 0, 180, 1, 1, 120, 0, 1, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET4, 0, 0, 200, 1, 50, 0, 1, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET5, 0, 0, 1, 200, 0, 0, -100, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ANISOTROPIC, PRESET6, 50, 0, 1, 200, 10, 0, 100, 200, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, FALSE, MM_ISOTROPIC, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, IGNORE, IGNORE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET1, 0, 0, 1, 1, 0, 0, 1, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET2, 75, 0, 1, 1, 0, 0, 10, 10, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET3, 0, 180, 1, 1, 120, 0, 1, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET4, 0, 0, 200, 1, 50, 0, 1, 0, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET5, 0, 0, 1, 200, 0, 0, 0, 1, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_ISOTROPIC, PRESET6, 50, 0, 1, 200, 10, 0, 1, 200, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOMETRIC, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIMETRIC, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_LOENGLISH, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_HIENGLISH, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET0, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET1, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET2, 75, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET3, 0, 180, IGNORE, IGNORE, 120, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET4, 0, 0, IGNORE, IGNORE, 50, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET5, 0, 0, IGNORE, IGNORE, 0, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
{ __LINE__, TRUE, 0xDEADBEEF, TRUE, MM_TWIPS, PRESET6, 50, 0, IGNORE, IGNORE, 10, 0, DISPLAY_SIZE, NEGA_DISPLAY_SIZE, { 100, 150 }, { CALC_VALUE_3, CALC_VALUE_3 } },
};
static const size_t s_transformed_entries_count = _countof(s_transformed_entries);
static void SetXForm1(XFORM *pxform)
{
pxform->eM11 = 1;
pxform->eM12 = 0;
pxform->eM21 = 0;
pxform->eM22 = 1;
pxform->eDx = 314;
pxform->eDy = -99;
} }
static void GetExtent(HDC hdc, SIZE *psizWnd, SIZE *psizView) static void SetXForm2(XFORM *pxform)
{ {
GetWindowExtEx(hdc, psizWnd); pxform->eM11 = 2;
//trace("*psizWnd: (%ld, %ld)\n", psizWnd->cx, psizWnd->cy); pxform->eM12 = 0;
pxform->eM21 = 0;
GetViewportExtEx(hdc, psizView); pxform->eM22 = 3;
//trace("*psizView: (%ld, %ld)\n", psizView->cx, psizView->cy); pxform->eDx = 0;
pxform->eDy = 0;
} }
void Test_LPtoDP() static void DoTestEntry(HDC hDC, const TEST_ENTRY *entry)
{ {
HDC hdc; POINT pt, ptWnd, ptView;
POINT apt[2]; SIZE siz, sizWnd, sizView;
XFORM xform; INT ret;
LONG lLogPixelsX, lLogPixelsY;
SIZE sizWnd, sizView;
LONG xLow, yLow, xHigh, yHigh;
hdc = CreateCompatibleDC(NULL); SetMapMode(hDC, entry->nMapMode);
lLogPixelsX = GetDeviceCaps(hdc, LOGPIXELSX);
lLogPixelsY = GetDeviceCaps(hdc, LOGPIXELSY);
trace("lLogPixelsX: %ld\n", lLogPixelsX);
trace("lLogPixelsY: %ld\n", lLogPixelsY);
//#define MULDIV(a, b, c) (((a) * (b)) / (c)) ret = SetWindowOrgEx(hDC, entry->preset.xWnd, entry->preset.yWnd, NULL);
#define MULDIV(a, b, c) MulDiv((a), (b), (c)) ok(ret == TRUE, "Line %d: SetWindowOrgEx failed\n", entry->lineno);
// MM_TEXT ret = SetWindowExtEx(hDC, entry->preset.cxWnd, entry->preset.cyWnd, NULL);
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; ok(ret == entry->bWndExt, "Line %d: SetWindowExtEx() expected %d, was %d\n", entry->lineno, entry->bWndExt, ret);
SetMapMode(hdc, MM_TEXT);
GetExtent(hdc, &sizWnd, &sizView);
ok_int(LPtoDP(hdc, apt, 2), 1);
ok_long(sizWnd.cx, 1);
ok_long(sizWnd.cy, 1);
ok_long(sizView.cx, 1);
ok_long(sizView.cy, 1);
ok_long(apt[0].x, 100);
ok_long(apt[0].y, 256);
ok_long(apt[1].x, -1000);
ok_long(apt[1].y, 1000);
// MM_LOMETRIC ret = SetViewportOrgEx(hDC, entry->preset.xView, entry->preset.yView, NULL);
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; ok(ret == TRUE, "Line %d: SetViewportOrgEx failed\n", entry->lineno);
SetMapMode(hdc, MM_LOMETRIC);
GetExtent(hdc, &sizWnd, &sizView);
ok_int(LPtoDP(hdc, apt, 2), 1);
ok_long(apt[0].x, MULDIV(100, sizView.cx, sizWnd.cx));
ok_long(apt[0].y, MULDIV(256, sizView.cy, sizWnd.cy));
ok_long(apt[1].x, MULDIV(-1000, sizView.cx, sizWnd.cx));
ok_long(apt[1].y, MULDIV(1000, sizView.cy, sizWnd.cy));
xLow = apt[0].x;
yLow = apt[0].y;
// MM_HIMETRIC ret = SetViewportExtEx(hDC, entry->preset.cxView, entry->preset.cyView, NULL);
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; ok(ret == TRUE, "Line %d: SetViewportExtEx failed\n", entry->lineno);
SetMapMode(hdc, MM_HIMETRIC);
GetExtent(hdc, &sizWnd, &sizView);
ok_int(LPtoDP(hdc, apt, 2), 1);
//ok_long(apt[0].x, MULDIV(100, sizView.cx, sizWnd.cx));
ok_long(apt[0].y, MULDIV(256, sizView.cy, sizWnd.cy));
//ok_long(apt[1].x, MULDIV(-1000, sizView.cx, sizWnd.cx));
ok_long(apt[1].y, MULDIV(1000, sizView.cy, sizWnd.cy));
xHigh = apt[0].x;
yHigh = apt[0].y;
ok(labs(xHigh) <= labs(xLow) / 9 && labs(xLow) / 11 <= labs(xHigh), "%ld, %ld\n", xLow, xHigh);
ok(labs(yHigh) <= labs(yLow) / 9 && labs(yLow) / 11 <= labs(yHigh), "%ld, %ld\n", yLow, yHigh);
// MM_LOENGLISH ok(GetWindowOrgEx(hDC, &pt) == TRUE, "Line %d: GetWindowOrgEx failed\n", entry->lineno);
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; ptWnd = pt;
SetMapMode(hdc, MM_LOENGLISH); ok(GetWindowExtEx(hDC, &siz) == TRUE, "Line %d: GetWindowExtEx failed\n", entry->lineno);
GetExtent(hdc, &sizWnd, &sizView); sizWnd = siz;
ok_int(LPtoDP(hdc, apt, 2), 1);
ok_long(apt[0].x, MULDIV(100, sizView.cx, sizWnd.cx));
ok_long(apt[0].y, MULDIV(256, sizView.cy, sizWnd.cy));
ok_long(apt[1].x, MULDIV(-1000, sizView.cx, sizWnd.cx));
ok_long(apt[1].y, MULDIV(1000, sizView.cy, sizWnd.cy));
xLow = apt[0].x;
yLow = apt[0].y;
// MM_HIENGLISH ok(pt.x == entry->xWndOut && pt.y == entry->yWndOut,
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; "Line %d: Window org expected (%ld, %ld), was (%ld, %ld)\n",
SetMapMode(hdc, MM_HIENGLISH); entry->lineno, entry->xWndOut, entry->yWndOut, pt.x, pt.y);
GetExtent(hdc, &sizWnd, &sizView);
ok_int(LPtoDP(hdc, apt, 2), 1);
ok_long(apt[0].x, MULDIV(100, sizView.cx, sizWnd.cx));
ok_long(apt[0].y, MULDIV(256, sizView.cy, sizWnd.cy));
ok_long(apt[1].x, MULDIV(-1000, sizView.cx, sizWnd.cx));
ok_long(apt[1].y, MULDIV(1000, sizView.cy, sizWnd.cy));
xHigh = apt[0].x;
yHigh = apt[0].y;
ok(labs(xHigh) <= labs(xLow) / 9 && labs(xLow) / 11 <= labs(xHigh), "%ld, %ld\n", xLow, xHigh);
ok(labs(yHigh) <= labs(yLow) / 9 && labs(yLow) / 11 <= labs(yHigh), "%ld, %ld\n", yLow, yHigh);
// MM_TWIPS if (entry->cxWndOut == DISPLAY_SIZE || entry->cxWndOut == NEGA_DISPLAY_SIZE)
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; {
SetMapMode(hdc, MM_TWIPS); LONG cx = GetDeviceCaps(hDC, HORZRES);
GetExtent(hdc, &sizWnd, &sizView); LONG cy = GetDeviceCaps(hDC, VERTRES);
ok_int(LPtoDP(hdc, apt, 2), 1); if (entry->cxWndOut == NEGA_DISPLAY_SIZE)
ok_long(apt[0].x, MULDIV(100, sizView.cx, sizWnd.cx)); cx = -cx;
ok_long(apt[0].y, MULDIV(256, sizView.cy, sizWnd.cy)); if (entry->cyWndOut == NEGA_DISPLAY_SIZE)
ok_long(apt[1].x, MULDIV(-1000, sizView.cx, sizWnd.cx)); cy = -cy;
ok_long(apt[1].y, MULDIV(1000, sizView.cy, sizWnd.cy)); ok(siz.cx == cx && siz.cy == cy,
"Line %d: Window ext expected display size (%ld, %ld), was (%ld, %ld)\n",
entry->lineno, cx, cy, siz.cx, siz.cy);
}
else if (entry->cxWndOut != IGNORE)
{
ok(siz.cx == entry->cxWndOut && siz.cy == entry->cyWndOut,
"Line %d: Window ext expected (%ld, %ld), was (%ld, %ld)\n",
entry->lineno, entry->cxWndOut, entry->cyWndOut, siz.cx, siz.cy);
}
SetGraphicsMode(hdc, GM_ADVANCED); ok(GetViewportOrgEx(hDC, &pt) == TRUE, "Line %d: GetViewportOrgEx failed\n", entry->lineno);
SetMapMode(hdc, MM_ANISOTROPIC); ptView = pt;
ok(GetViewportExtEx(hDC, &siz) == TRUE, "Line %d: GetViewportExtEx failed\n", entry->lineno);
sizView = siz;
xform.eM11 = 1.; ok(pt.x == entry->xViewOut && pt.y == entry->yViewOut,
xform.eM12 = 0.; "Line %d: Viewport org expected (%ld, %ld), was (%ld, %ld)\n",
xform.eM21 = 0.; entry->lineno, entry->xViewOut , entry->yViewOut, pt.x, pt.y);
xform.eM22 = 1.;
xform.eDx = 2.;
xform.eDy = 1.;
ok_int(SetWorldTransform(hdc, &xform), 1);
// eDx == 2, eDy == 1 if (entry->cxViewOut == DISPLAY_SIZE || entry->cxViewOut == NEGA_DISPLAY_SIZE)
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; {
GetExtent(hdc, &sizWnd, &sizView); LONG cx = GetDeviceCaps(hDC, HORZRES);
ok_int(LPtoDP(hdc, apt, 2), 1); LONG cy = GetDeviceCaps(hDC, VERTRES);
ok_long(apt[0].x, MULDIV(100 + (LONG)xform.eDx, sizView.cx, sizWnd.cx)); if (entry->cxViewOut == NEGA_DISPLAY_SIZE)
ok_long(apt[0].y, MULDIV(256 + (LONG)xform.eDy, sizView.cy, sizWnd.cy)); cx = -cx;
ok_long(apt[1].x, MULDIV(-1000 - (LONG)xform.eDx, sizView.cx, sizWnd.cx)); if (entry->cyViewOut == NEGA_DISPLAY_SIZE)
ok_long(apt[1].y, MULDIV(1000 + (LONG)xform.eDy, sizView.cy, sizWnd.cy)); cy = -cy;
ok(siz.cx == cx && siz.cy == cy,
"Line %d: Viewport ext expected display size (%ld, %ld), was (%ld, %ld)\n",
entry->lineno, cx, cy, siz.cx, siz.cy);
}
else if (entry->cxViewOut != IGNORE)
{
ok(siz.cx == entry->cxViewOut && siz.cy == entry->cyViewOut,
"Line %d: Viewport ext expected (%ld, %ld), was (%ld, %ld)\n",
entry->lineno, entry->cxViewOut, entry->cyViewOut, siz.cx, siz.cy);
}
// eM11 == 0.0000001 pt = entry->ptSrc;
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000;
xform.eM11 = 0.0000001;
xform.eDx = 0.;
xform.eDy = 0.;
ok_int(SetWorldTransform(hdc, &xform), 1);
GetExtent(hdc, &sizWnd, &sizView);
ok_int(LPtoDP(hdc, apt, 2), 1);
ok_long(apt[0].x, 0);
ok_long(apt[0].y, MULDIV(256, sizView.cy, sizWnd.cy));
ok_long(apt[1].x, 0);
ok_long(apt[1].y, MULDIV(1000, sizView.cy, sizWnd.cy));
// eM11 == 0.5 SetLastError(0xDEADBEEF);
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; ret = LPtoDP(hDC, &pt, 1);
xform.eM11 = 0.5; ok(ret == entry->ret, "Line %d: LPtoDP() expected %d, was %d\n", entry->lineno, entry->ret, ret);
xform.eDx = 0.;
xform.eDy = 0.;
ok_int(SetWorldTransform(hdc, &xform), 1);
GetExtent(hdc, &sizWnd, &sizView);
ok_int(LPtoDP(hdc, apt, 2), 1);
ok_long(apt[0].x, MULDIV(100, sizView.cx, sizWnd.cx * 2));
ok_long(apt[0].y, MULDIV(256, sizView.cy, sizWnd.cy));
ok_long(apt[1].x, MULDIV(-1000, sizView.cx, sizWnd.cx * 2));
ok_long(apt[1].y, MULDIV(1000, sizView.cy, sizWnd.cy));
// eM11 == 1.164153218404873e-10 ok(GetLastError() == entry->error, "Line %d: GetLastError() expected %ld, was %ld\n",
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; entry->lineno, entry->error, GetLastError());
xform.eM11 = 1.164153218404873e-10;
xform.eDx = 0.;
xform.eDy = 0.;
ok_int(SetWorldTransform(hdc, &xform), 1);
GetExtent(hdc, &sizWnd, &sizView);
ok_int(LPtoDP(hdc, apt, 2), 1);
ok_long(apt[0].x, 0);
ok_long(apt[0].y, MULDIV(256, sizView.cy, sizWnd.cy));
ok_long(apt[1].x, 0);
ok_long(apt[1].y, MULDIV(1000, sizView.cy, sizWnd.cy));
// eM11 == 2.328306437080797e-10 if (entry->ptDest.x == CALC_VALUE_1)
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; {
xform.eM11 = 2.328306437080797e-10; LONG x = MulDiv(entry->ptSrc.x - ptWnd.x, sizView.cx, sizWnd.cx) + ptView.x;
xform.eM22 = 1.; LONG y = MulDiv(entry->ptSrc.y - ptWnd.y, sizView.cy, sizWnd.cy) + ptView.y;
xform.eDx = 0.; // TODO: make more accurate
xform.eDy = 0.; ok(labs(pt.x - x) <= 1 && labs(pt.y - y) <= 1,
ok_int(SetWorldTransform(hdc, &xform), 1); "Line %d: Dest expected (%ld, %ld), was (%ld, %ld)\n",
GetExtent(hdc, &sizWnd, &sizView); entry->lineno, x, y, pt.x, pt.y);
ok_int(LPtoDP(hdc, apt, 2), 1); }
ok_long(apt[0].x, 0); else if (entry->ptDest.x == CALC_VALUE_2)
ok_long(apt[0].y, MULDIV(256, sizView.cy, sizWnd.cy)); {
ok_long(apt[1].x, 0); XFORM xform;
ok_long(apt[1].y, MULDIV(1000, sizView.cy, sizWnd.cy)); LONG x, y;
SetXForm1(&xform);
// eM22 == 2.328306437080797e-10 x = (LONG)((xform.eM11 * entry->ptSrc.x + xform.eM12 * entry->ptSrc.y) + xform.eDx);
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; y = (LONG)((xform.eM21 * entry->ptSrc.x + xform.eM22 * entry->ptSrc.y) + xform.eDy);
xform.eM11 = 1.; x = MulDiv(x - ptWnd.x, sizView.cx, sizWnd.cx) + ptView.x;
xform.eM22 = 2.328306437080797e-10; y = MulDiv(y - ptWnd.y, sizView.cy, sizWnd.cy) + ptView.y;
xform.eDx = 0.; // TODO: make more accurate
xform.eDy = 0.; ok(labs(pt.x - x) <= 1 && labs(pt.y - y) <= 1,
ok_int(SetWorldTransform(hdc, &xform), 1); "Line %d: Dest expected (%ld, %ld), was (%ld, %ld)\n",
GetExtent(hdc, &sizWnd, &sizView); entry->lineno, x, y, pt.x, pt.y);
ok_int(LPtoDP(hdc, apt, 2), 1); }
//ok_long(apt[0].x, MULDIV(100, sizView.cy, sizWnd.cy)); else if (entry->ptDest.x == CALC_VALUE_3)
ok_long(apt[0].y, 0); {
//ok_long(apt[1].x, MULDIV(-1000, sizView.cy, sizWnd.cy)); XFORM xform;
ok_long(apt[1].y, 0); LONG x, y;
SetXForm2(&xform);
// eM22 == 1.164153218404873e-10 x = (LONG)((xform.eM11 * entry->ptSrc.x + xform.eM12 * entry->ptSrc.y) + xform.eDx);
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; y = (LONG)((xform.eM21 * entry->ptSrc.x + xform.eM22 * entry->ptSrc.y) + xform.eDy);
xform.eM11 = 1.; x = MulDiv(x - ptWnd.x, sizView.cx, sizWnd.cx) + ptView.x;
xform.eM22 = 1.164153218404873e-10; y = MulDiv(y - ptWnd.y, sizView.cy, sizWnd.cy) + ptView.y;
xform.eDx = 0.; // TODO: make more accurate
xform.eDy = 0.; ok(labs(pt.x - x) <= 2 && labs(pt.y - y) <= 2,
ok_int(SetWorldTransform(hdc, &xform), 1); "Line %d: Dest expected (%ld, %ld), was (%ld, %ld)\n",
GetExtent(hdc, &sizWnd, &sizView); entry->lineno, x, y, pt.x, pt.y);
ok_int(LPtoDP(hdc, apt, 2), 1); }
//ok_long(apt[0].x, MULDIV(100, sizView.cy, sizWnd.cy)); else if (entry->ptDest.x != IGNORE)
ok_long(apt[0].y, 0); {
//ok_long(apt[1].x, MULDIV(-1000, sizView.cy, sizWnd.cy)); ok(pt.x == entry->ptDest.x && pt.y == entry->ptDest.y,
ok_long(apt[1].y, 0); "Line %d: Dest expected (%ld, %ld), was (%ld, %ld)\n",
entry->lineno, entry->ptDest.x, entry->ptDest.y, pt.x, pt.y);
// eM11 == 2.328306437080797e-10, eM22 == 2.328306437080797e-10 }
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000;
xform.eM11 = 2.328306437080797e-10;
xform.eM22 = 2.328306437080797e-10;
xform.eDx = 0.;
xform.eDy = 0.;
ok_int(SetWorldTransform(hdc, &xform), 1);
GetExtent(hdc, &sizWnd, &sizView);
ok_int(LPtoDP(hdc, apt, 2), 1);
ok_long(apt[0].x, 0);
ok_long(apt[0].y, 0);
ok_long(apt[1].x, 0);
ok_long(apt[1].y, 0);
// eM11 == 1.164153218404873e-10, eM22 == 1.164153218404873e-10
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000;
xform.eM11 = 1.164153218404873e-10;
xform.eM22 = 1.164153218404873e-10;
xform.eDx = 0.;
xform.eDy = 0.;
ok_int(SetWorldTransform(hdc, &xform), 1);
GetExtent(hdc, &sizWnd, &sizView);
ok_int(LPtoDP(hdc, apt, 2), 1);
ok_long(apt[0].x, 0);
ok_long(apt[0].y, 0);
ok_long(apt[1].x, 0);
ok_long(apt[1].y, 0);
// eM11 == 0.0000001
apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000;
xform.eM11 = 0.0000001;
xform.eM22 = 1.0;
ok_int(SetWorldTransform(hdc, &xform), 1);
GetExtent(hdc, &sizWnd, &sizView);
ok_int(LPtoDP(hdc, apt, 2), 1);
ok_long(apt[0].x, 0);
ok_long(apt[0].y, MULDIV(256, sizView.cy, sizWnd.cy));
ok_long(apt[1].x, 0);
ok_long(apt[1].y, MULDIV(1000, sizView.cy, sizWnd.cy));
DeleteDC(hdc);
} }
START_TEST(LPtoDP) START_TEST(LPtoDP)
{ {
Test_LPtoDP_Params(); size_t i;
Test_LPtoDP(); POINT apt[2];
XFORM xform;
HDC hDC = CreateCompatibleDC(NULL);
ok(hDC != NULL, "hDC is NULL\n");
SetLastError(0xDEADBEEF);
ok_int(LPtoDP(NULL, NULL, 0), 1);
ok_err(0xDEADBEEF);
ok_int(LPtoDP(NULL, NULL, -1), 1);
ok_err(0xDEADBEEF);
ok_int(LPtoDP(NULL, INVALID_POINTER, -1), 1);
ok_err(0xDEADBEEF);
ok_int(LPtoDP(NULL, NULL, 2), 0);
ok_err(ERROR_INVALID_PARAMETER);
SetLastError(0xDEADBEEF);
ok_int(LPtoDP(NULL, apt, 2), 0);
ok_err(ERROR_INVALID_PARAMETER);
SetLastError(0xDEADBEEF);
ok_int(LPtoDP(NULL, apt, 0), 1);
ok_err(0xDEADBEEF);
SetLastError(0xDEADBEEF);
ok_int(LPtoDP(NULL, apt, -2), 1);
ok_err(0xDEADBEEF);
SetLastError(0xDEADBEEF);
ok_int(LPtoDP((HDC)-4, apt, -2), 1);
ok_err(0xDEADBEEF);
SetLastError(0xDEADBEEF);
ok_int(LPtoDP(hDC, NULL, 2), 1);
ok_err(0xDEADBEEF);
SetLastError(0xDEADBEEF);
ok_int(LPtoDP(hDC, INVALID_POINTER, 2), 1);
ok_err(0xDEADBEEF);
SetGraphicsMode(hDC, GM_COMPATIBLE);
ModifyWorldTransform(hDC, NULL, MWT_IDENTITY);
for (i = 0; i < s_entries_count; ++i)
{
DoTestEntry(hDC, &s_entries[i]);
}
SetGraphicsMode(hDC, GM_ADVANCED);
ModifyWorldTransform(hDC, NULL, MWT_IDENTITY);
for (i = 0; i < s_entries_count; ++i)
{
DoTestEntry(hDC, &s_entries[i]);
}
SetXForm1(&xform);
SetGraphicsMode(hDC, GM_ADVANCED);
SetWorldTransform(hDC, &xform);
for (i = 0; i < s_shifted_entries_count; ++i)
{
DoTestEntry(hDC, &s_shifted_entries[i]);
}
SetXForm2(&xform);
SetGraphicsMode(hDC, GM_ADVANCED);
SetWorldTransform(hDC, &xform);
for (i = 0; i < s_transformed_entries_count; ++i)
{
DoTestEntry(hDC, &s_transformed_entries[i]);
}
DeleteDC(hDC);
} }