ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
April 2019
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
32 participants
240 discussions
Start a n
N
ew thread
[reactos] 01/01: [GDI32_APITEST] Add LPtoDP testcase (#1462)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8bf795ff7642831ab7427…
commit 8bf795ff7642831ab7427baadc1fe9e105e2435f Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Apr 4 10:44:52 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Apr 4 10:44:52 2019 +0900 [GDI32_APITEST] Add LPtoDP testcase (#1462) ROSTESTS-320 --- modules/rostests/apitests/gdi32/CMakeLists.txt | 1 + modules/rostests/apitests/gdi32/LPtoDP.c | 316 +++++++++++++++++++++++++ modules/rostests/apitests/gdi32/testlist.c | 2 + 3 files changed, 319 insertions(+) diff --git a/modules/rostests/apitests/gdi32/CMakeLists.txt b/modules/rostests/apitests/gdi32/CMakeLists.txt index bbeeb4fa0b..caa05d9a11 100644 --- a/modules/rostests/apitests/gdi32/CMakeLists.txt +++ b/modules/rostests/apitests/gdi32/CMakeLists.txt @@ -54,6 +54,7 @@ list(APPEND SOURCE GetTextExtentExPoint.c GetTextFace.c GetTextMetrics.c + LPtoDP.c MaskBlt.c NtGdiAddFontResource.c OffsetClipRgn.c diff --git a/modules/rostests/apitests/gdi32/LPtoDP.c b/modules/rostests/apitests/gdi32/LPtoDP.c new file mode 100644 index 0000000000..e92c0a4e4c --- /dev/null +++ b/modules/rostests/apitests/gdi32/LPtoDP.c @@ -0,0 +1,316 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPL - See COPYING in the top level directory + * PURPOSE: Test for ... + * PROGRAMMERS: Katayama Hirofumi MZ + */ + +#include "precomp.h" + +#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL) + +void Test_LPtoDP_Params() +{ + HDC hdc; + POINT apt[2]; + + apt[0].x = 0; + apt[0].y = 0; + apt[1].x = -1000; + apt[1].y = 1000; + + SetLastError(ERROR_SUCCESS); + ok_int(LPtoDP(NULL, NULL, 0), 1); + ok_err(ERROR_SUCCESS); + + ok_int(LPtoDP(NULL, NULL, -1), 1); + ok_err(ERROR_SUCCESS); + + ok_int(LPtoDP(NULL, INVALID_POINTER, -1), 1); + ok_err(ERROR_SUCCESS); + + ok_int(LPtoDP(NULL, NULL, 2), 0); + ok_err(ERROR_INVALID_PARAMETER); + + SetLastError(ERROR_SUCCESS); + ok_int(LPtoDP(NULL, apt, 2), 0); + ok_err(ERROR_INVALID_PARAMETER); + + SetLastError(ERROR_SUCCESS); + ok_int(LPtoDP(NULL, apt, 0), 1); + ok_err(ERROR_SUCCESS); + + SetLastError(ERROR_SUCCESS); + ok_int(LPtoDP(NULL, apt, -2), 1); + ok_err(ERROR_SUCCESS); + + SetLastError(ERROR_SUCCESS); + ok_int(LPtoDP((HDC)-4, apt, -2), 1); + ok_err(ERROR_SUCCESS); + + hdc = GetDC(0); + SetLastError(ERROR_SUCCESS); + ok_int(LPtoDP(hdc, NULL, 2), 1); + ok_err(ERROR_SUCCESS); + + hdc = GetDC(0); + SetLastError(ERROR_SUCCESS); + ok_int(LPtoDP(hdc, INVALID_POINTER, 2), 1); + ok_err(ERROR_SUCCESS); + + + ReleaseDC(0, hdc); +} + +static void GetExtent(HDC hdc, SIZE *psizWnd, SIZE *psizView) +{ + GetWindowExtEx(hdc, psizWnd); + //trace("*psizWnd: (%ld, %ld)\n", psizWnd->cx, psizWnd->cy); + + GetViewportExtEx(hdc, psizView); + //trace("*psizView: (%ld, %ld)\n", psizView->cx, psizView->cy); +} + +void Test_LPtoDP() +{ + HDC hdc; + POINT apt[2]; + XFORM xform; + LONG lLogPixelsX, lLogPixelsY; + SIZE sizWnd, sizView; + LONG xLow, yLow, xHigh, yHigh; + + hdc = CreateCompatibleDC(NULL); + 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)) +#define MULDIV(a, b, c) MulDiv((a), (b), (c)) + + // MM_TEXT + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + 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 + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + 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 + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + 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 + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + SetMapMode(hdc, MM_LOENGLISH); + 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_HIENGLISH + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + SetMapMode(hdc, MM_HIENGLISH); + 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 + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + SetMapMode(hdc, MM_TWIPS); + 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)); + + SetGraphicsMode(hdc, GM_ADVANCED); + SetMapMode(hdc, MM_ANISOTROPIC); + + xform.eM11 = 1.; + xform.eM12 = 0.; + xform.eM21 = 0.; + xform.eM22 = 1.; + xform.eDx = 2.; + xform.eDy = 1.; + ok_int(SetWorldTransform(hdc, &xform), 1); + + // eDx == 2, eDy == 1 + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + GetExtent(hdc, &sizWnd, &sizView); + ok_int(LPtoDP(hdc, apt, 2), 1); + ok_long(apt[0].x, MULDIV(100 + (LONG)xform.eDx, sizView.cx, sizWnd.cx)); + ok_long(apt[0].y, MULDIV(256 + (LONG)xform.eDy, sizView.cy, sizWnd.cy)); + ok_long(apt[1].x, MULDIV(-1000 - (LONG)xform.eDx, sizView.cx, sizWnd.cx)); + ok_long(apt[1].y, MULDIV(1000 + (LONG)xform.eDy, sizView.cy, sizWnd.cy)); + + // eM11 == 0.0000001 + 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 + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + xform.eM11 = 0.5; + 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 + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + 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 + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + xform.eM11 = 2.328306437080797e-10; + xform.eM22 = 1.; + 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)); + + // eM22 == 2.328306437080797e-10 + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + xform.eM11 = 1.; + 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, MULDIV(100, sizView.cy, sizWnd.cy)); + ok_long(apt[0].y, 0); + //ok_long(apt[1].x, MULDIV(-1000, sizView.cy, sizWnd.cy)); + ok_long(apt[1].y, 0); + + // eM22 == 1.164153218404873e-10 + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + xform.eM11 = 1.; + 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, MULDIV(100, sizView.cy, sizWnd.cy)); + ok_long(apt[0].y, 0); + //ok_long(apt[1].x, MULDIV(-1000, sizView.cy, sizWnd.cy)); + ok_long(apt[1].y, 0); + + // 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) +{ + Test_LPtoDP_Params(); + Test_LPtoDP(); +} diff --git a/modules/rostests/apitests/gdi32/testlist.c b/modules/rostests/apitests/gdi32/testlist.c index 8b9443629e..735621c338 100644 --- a/modules/rostests/apitests/gdi32/testlist.c +++ b/modules/rostests/apitests/gdi32/testlist.c @@ -55,6 +55,7 @@ extern void func_GetStockObject(void); extern void func_GetTextExtentExPoint(void); extern void func_GetTextFace(void); extern void func_GetTextMetrics(void); +extern void func_LPtoDP(void); extern void func_MaskBlt(void); extern void func_NtGdiAddFontResource(void); extern void func_OffsetClipRgn(void); @@ -130,6 +131,7 @@ const struct test winetest_testlist[] = { "GetTextExtentExPoint", func_GetTextExtentExPoint }, { "GetTextMetrics", func_GetTextMetrics }, { "GetTextFace", func_GetTextFace }, + { "LPtoDP", func_LPtoDP }, { "MaskBlt", func_MaskBlt }, { "NtGdiAddFontResource", func_NtGdiAddFontResource}, { "OffsetClipRgn", func_OffsetClipRgn },
5 years, 8 months
1
0
0
0
[reactos] 01/01: [ROSTESTS][GDI32_APITEST] Follow up of #1459 (#1460)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2c48ab4c0e0f521822530…
commit 2c48ab4c0e0f521822530022ac3b8bac789f24cd Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Apr 4 05:25:02 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Apr 4 05:25:02 2019 +0900 [ROSTESTS][GDI32_APITEST] Follow up of #1459 (#1460) ROSTESTS-319 --- modules/rostests/apitests/gdi32/DPtoLP.c | 89 +++++++++++++++++--------------- 1 file changed, 47 insertions(+), 42 deletions(-) diff --git a/modules/rostests/apitests/gdi32/DPtoLP.c b/modules/rostests/apitests/gdi32/DPtoLP.c index d8c2cd5dc5..48a841407c 100644 --- a/modules/rostests/apitests/gdi32/DPtoLP.c +++ b/modules/rostests/apitests/gdi32/DPtoLP.c @@ -87,6 +87,9 @@ void Test_DPtoLP() trace("lLogPixelsX: %ld\n", lLogPixelsX); trace("lLogPixelsY: %ld\n", lLogPixelsY); +//#define MULDIV(a, b, c) (((a) * (b)) / (c)) +#define MULDIV(a, b, c) MulDiv((a), (b), (c)) + // MM_TEXT apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; SetMapMode(hdc, MM_TEXT); @@ -106,10 +109,10 @@ void Test_DPtoLP() SetMapMode(hdc, MM_LOMETRIC); GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_long(apt[0].x, MulDiv(100, sizWnd.cx, sizView.cx)); - ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); - ok_long(apt[1].x, MulDiv(-1000, sizWnd.cx, sizView.cx)); - ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + ok_long(apt[0].x, MULDIV(100, sizWnd.cx, sizView.cx)); + ok_long(apt[0].y, MULDIV(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, MULDIV(-1000, sizWnd.cx, sizView.cx)); + ok_long(apt[1].y, MULDIV(1000, sizWnd.cy, sizView.cy)); xLow = apt[0].x; yLow = apt[0].y; @@ -118,10 +121,10 @@ void Test_DPtoLP() SetMapMode(hdc, MM_HIMETRIC); GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_long(apt[0].x, MulDiv(100, sizWnd.cx, sizView.cx)); - ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); - ok_long(apt[1].x, MulDiv(-1000, sizWnd.cx, sizView.cx)); - ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + ok_long(apt[0].x, MULDIV(100, sizWnd.cx, sizView.cx)); + ok_long(apt[0].y, MULDIV(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, MULDIV(-1000, sizWnd.cx, sizView.cx)); + ok_long(apt[1].y, MULDIV(1000, sizWnd.cy, sizView.cy)); xHigh = apt[0].x; yHigh = apt[0].y; ok(labs(xLow) * 9 < labs(xHigh) && labs(xHigh) < 11 * labs(xLow), "%ld, %ld\n", xLow, xHigh); @@ -132,10 +135,10 @@ void Test_DPtoLP() SetMapMode(hdc, MM_LOENGLISH); GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_long(apt[0].x, MulDiv(100, sizWnd.cx, sizView.cx)); - ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); - ok_long(apt[1].x, MulDiv(-1000, sizWnd.cx, sizView.cx)); - ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + ok_long(apt[0].x, MULDIV(100, sizWnd.cx, sizView.cx)); + ok_long(apt[0].y, MULDIV(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, MULDIV(-1000, sizWnd.cx, sizView.cx)); + ok_long(apt[1].y, MULDIV(1000, sizWnd.cy, sizView.cy)); xLow = apt[0].x; yLow = apt[0].y; @@ -144,10 +147,10 @@ void Test_DPtoLP() SetMapMode(hdc, MM_HIENGLISH); GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_long(apt[0].x, MulDiv(100, sizWnd.cx, sizView.cx)); - ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); - ok_long(apt[1].x, MulDiv(-1000, sizWnd.cx, sizView.cx)); - ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + ok_long(apt[0].x, MULDIV(100, sizWnd.cx, sizView.cx)); + ok_long(apt[0].y, MULDIV(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, MULDIV(-1000, sizWnd.cx, sizView.cx)); + ok_long(apt[1].y, MULDIV(1000, sizWnd.cy, sizView.cy)); xHigh = apt[0].x; yHigh = apt[0].y; ok(labs(xLow) * 9 < labs(xHigh) && labs(xHigh) < 11 * labs(xLow), "%ld, %ld\n", xLow, xHigh); @@ -158,10 +161,10 @@ void Test_DPtoLP() SetMapMode(hdc, MM_TWIPS); GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_long(apt[0].x, MulDiv(100, sizWnd.cx, sizView.cx)); - ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); - ok_long(apt[1].x, MulDiv(-1000, sizWnd.cx, sizView.cx)); - ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + ok_long(apt[0].x, MULDIV(100, sizWnd.cx, sizView.cx)); + ok_long(apt[0].y, MULDIV(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, MULDIV(-1000, sizWnd.cx, sizView.cx)); + ok_long(apt[1].y, MULDIV(1000, sizWnd.cy, sizView.cy)); SetGraphicsMode(hdc, GM_ADVANCED); SetMapMode(hdc, MM_ANISOTROPIC); @@ -178,10 +181,10 @@ void Test_DPtoLP() apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_long(apt[0].x, MulDiv(100, sizWnd.cx, sizView.cx) - (LONG)xform.eDx); - ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy) - (LONG)xform.eDy); - ok_long(apt[1].x, MulDiv(-1000, sizWnd.cx, sizView.cx) - (LONG)xform.eDx); - ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy) - (LONG)xform.eDy); + ok_long(apt[0].x, MULDIV(100, sizWnd.cx, sizView.cx) - (LONG)xform.eDx); + ok_long(apt[0].y, MULDIV(256, sizWnd.cy, sizView.cy) - (LONG)xform.eDy); + ok_long(apt[1].x, MULDIV(-1000, sizWnd.cx, sizView.cx) - (LONG)xform.eDx); + ok_long(apt[1].y, MULDIV(1000, sizWnd.cy, sizView.cy) - (LONG)xform.eDy); // eM11 == 10000000 apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; @@ -192,9 +195,9 @@ void Test_DPtoLP() GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); ok_long(apt[0].x, 0); - ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[0].y, MULDIV(256, sizWnd.cy, sizView.cy)); ok_long(apt[1].x, 0); - ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + ok_long(apt[1].y, MULDIV(1000, sizWnd.cy, sizView.cy)); // eM11 == 2 apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; @@ -204,10 +207,10 @@ void Test_DPtoLP() ok_int(SetWorldTransform(hdc, &xform), 1); GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_long(apt[0].x, MulDiv(100 / 2, sizWnd.cx, sizView.cx)); - ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); - ok_long(apt[1].x, MulDiv(-1000 / 2, sizWnd.cx, sizView.cx)); - ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + ok_long(apt[0].x, MULDIV(100 / 2, sizWnd.cx, sizView.cx)); + ok_long(apt[0].y, MULDIV(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, MULDIV(-1000 / 2, sizWnd.cx, sizView.cx)); + ok_long(apt[1].y, MULDIV(1000, sizWnd.cy, sizView.cy)); // eM11 == (FLOAT)0x1FFFFFFFF apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; @@ -218,9 +221,9 @@ void Test_DPtoLP() GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); ok_long(apt[0].x, 0); - //ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + //ok_long(apt[0].y, MULDIV(256, sizWnd.cy, sizView.cy)); ok_long(apt[1].x, 0); - //ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + //ok_long(apt[1].y, MULDIV(1000, sizWnd.cy, sizView.cy)); // eM11 == (FLOAT)0xFFFFFFFFU apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; @@ -232,9 +235,9 @@ void Test_DPtoLP() GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); ok_long(apt[0].x, 0); - ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[0].y, MULDIV(256, sizWnd.cy, sizView.cy)); ok_long(apt[1].x, 0); - ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + ok_long(apt[1].y, MULDIV(1000, sizWnd.cy, sizView.cy)); // eM22 == (FLOAT)0xFFFFFFFFU apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; @@ -245,9 +248,9 @@ void Test_DPtoLP() ok_int(SetWorldTransform(hdc, &xform), 1); GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - //ok_long(apt[0].x, MulDiv(100, sizWnd.cy, sizView.cy)); + //ok_long(apt[0].x, MULDIV(100, sizWnd.cy, sizView.cy)); ok_long(apt[0].y, 0); - //ok_long(apt[1].x, MulDiv(-1000, sizWnd.cy, sizView.cy)); + //ok_long(apt[1].x, MULDIV(-1000, sizWnd.cy, sizView.cy)); ok_long(apt[1].y, 0); // eM22 == (FLOAT)0x1FFFFFFFFU @@ -259,9 +262,9 @@ void Test_DPtoLP() ok_int(SetWorldTransform(hdc, &xform), 1); GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - //ok_long(apt[0].x, MulDiv(100, sizWnd.cy, sizView.cy)); + //ok_long(apt[0].x, MULDIV(100, sizWnd.cy, sizView.cy)); ok_long(apt[0].y, 0); - //ok_long(apt[1].x, MulDiv(-1000, sizWnd.cy, sizView.cy)); + //ok_long(apt[1].x, MULDIV(-1000, sizWnd.cy, sizView.cy)); ok_long(apt[1].y, 0); // eM11 == (FLOAT)0xFFFFFFFFU, eM22 == (FLOAT)0xFFFFFFFFU @@ -297,19 +300,21 @@ void Test_DPtoLP() xform.eM11 = 10000000.; xform.eM22 = 1.0; ok_int(SetWorldTransform(hdc, &xform), 1); + GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); ok_long(apt[0].x, 0); - ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[0].y, MULDIV(256, sizWnd.cy, sizView.cy)); ok_long(apt[1].x, 0); - ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + ok_long(apt[1].y, MULDIV(1000, sizWnd.cy, sizView.cy)); xform.eM11 = 1000000.; ok_int(SetWorldTransform(hdc, &xform), 1); + GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); ok_long(apt[0].x, 0); - //ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + //ok_long(apt[0].y, MULDIV(256, sizWnd.cy, sizView.cy)); ok_long(apt[1].x, 0); - //ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + //ok_long(apt[1].y, MULDIV(1000, sizWnd.cy, sizView.cy)); DeleteDC(hdc); }
5 years, 8 months
1
0
0
0
[reactos] 02/02: [SYSSETUP] Ask for common controls v6 when using v6 features
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d71712e909844a735db5c…
commit d71712e909844a735db5ce80ef2813c5ea2e6a51 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Tue Apr 2 21:25:19 2019 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Wed Apr 3 19:44:27 2019 +0200 [SYSSETUP] Ask for common controls v6 when using v6 features --- dll/win32/syssetup/syssetup.rc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dll/win32/syssetup/syssetup.rc b/dll/win32/syssetup/syssetup.rc index 17f485aa34..800d4d2ce6 100644 --- a/dll/win32/syssetup/syssetup.rc +++ b/dll/win32/syssetup/syssetup.rc @@ -10,6 +10,9 @@ #define REACTOS_STR_ORIGINAL_FILENAME "syssetup.dll" #include <reactos/version.rc> +/* Ask for common controls v6 (BCM_SETIMAGELIST) */ +#include <reactos/manifest_dll.rc> + LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL /* Bitmaps */
5 years, 8 months
1
0
0
0
[reactos] 01/02: [SYSSETUP] Add a missing break
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bae083355d440601dd5ec…
commit bae083355d440601dd5ec81fdfea7a6be7cb6251 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Tue Apr 2 21:23:58 2019 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Wed Apr 3 19:44:16 2019 +0200 [SYSSETUP] Add a missing break --- dll/cpl/timedate/timezone.c | 1 + dll/win32/syssetup/wizard.c | 3 ++- sdk/include/reactos/libs/syssetup/syssetup.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dll/cpl/timedate/timezone.c b/dll/cpl/timedate/timezone.c index d3061bbd08..95a4e33220 100644 --- a/dll/cpl/timedate/timezone.c +++ b/dll/cpl/timedate/timezone.c @@ -11,6 +11,7 @@ #include "timedate.h" +// See also sdk/include/reactos/libs/syssetup/syssetup.h typedef struct _TZ_INFO { LONG Bias; diff --git a/dll/win32/syssetup/wizard.c b/dll/win32/syssetup/wizard.c index 2d95f1cfe1..06219b941e 100644 --- a/dll/win32/syssetup/wizard.c +++ b/dll/win32/syssetup/wizard.c @@ -1645,6 +1645,7 @@ ThemePageDlgProc(HWND hwndDlg, break; } } + break; case WM_NOTIFY: switch (((LPNMHDR)lParam)->code) { @@ -2487,7 +2488,7 @@ ProcessSetupInf( L"sourcepath", &InfContext)) { - DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError()); + DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError()); return; } diff --git a/sdk/include/reactos/libs/syssetup/syssetup.h b/sdk/include/reactos/libs/syssetup/syssetup.h index a29a342bb4..ddd7bce85b 100644 --- a/sdk/include/reactos/libs/syssetup/syssetup.h +++ b/sdk/include/reactos/libs/syssetup/syssetup.h @@ -23,7 +23,7 @@ #ifndef __SYSSETUP_H_INCLUDED__ #define __SYSSETUP_H_INCLUDED__ - +// See also dll/cpl/timedate/timezone.c typedef struct _TZ_INFO { LONG Bias;
5 years, 8 months
1
0
0
0
[reactos] 01/01: [GDI32_APITEST] Improve DPtoLP testcase (#1459)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e157a5fe1c3bcbd8f7321…
commit e157a5fe1c3bcbd8f7321314f38b560a389efefa Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Apr 3 22:48:42 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Apr 3 22:48:42 2019 +0900 [GDI32_APITEST] Improve DPtoLP testcase (#1459) ROSTESTS-319 --- modules/rostests/apitests/gdi32/DPtoLP.c | 246 +++++++++++++++++++++++++------ 1 file changed, 201 insertions(+), 45 deletions(-) diff --git a/modules/rostests/apitests/gdi32/DPtoLP.c b/modules/rostests/apitests/gdi32/DPtoLP.c index d06b3754a7..d8c2cd5dc5 100644 --- a/modules/rostests/apitests/gdi32/DPtoLP.c +++ b/modules/rostests/apitests/gdi32/DPtoLP.c @@ -3,6 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * PURPOSE: Test for ... * PROGRAMMERS: Timo Kreuzer + * Katayama Hirofumi MZ */ #include "precomp.h" @@ -38,7 +39,7 @@ void Test_DPtoLP_Params() SetLastError(ERROR_SUCCESS); ok_int(DPtoLP(NULL, apt, 0), 1); - ok(GetLastError() == ERROR_SUCCESS, "Exected ERROR_SUCCESS, got %ld\n", GetLastError()); + ok_err(ERROR_SUCCESS); SetLastError(ERROR_SUCCESS); ok_int(DPtoLP(NULL, apt, -2), 1); @@ -62,36 +63,106 @@ void Test_DPtoLP_Params() ReleaseDC(0, hdc); } +static void GetExtent(HDC hdc, SIZE *psizWnd, SIZE *psizView) +{ + GetWindowExtEx(hdc, psizWnd); + //trace("*psizWnd: (%ld, %ld)\n", psizWnd->cx, psizWnd->cy); + + GetViewportExtEx(hdc, psizView); + //trace("*psizView: (%ld, %ld)\n", psizView->cx, psizView->cy); +} + void Test_DPtoLP() { HDC hdc; POINT apt[2]; XFORM xform; LONG lLogPixelsX, lLogPixelsY; + SIZE sizWnd, sizView; + LONG xLow, yLow, xHigh, yHigh; - apt[0].x = 1; - apt[0].y = 1; - apt[1].x = -1000; - apt[1].y = 1000; - - hdc = GetDC(0); + hdc = CreateCompatibleDC(NULL); lLogPixelsX = GetDeviceCaps(hdc, LOGPIXELSX); lLogPixelsY = GetDeviceCaps(hdc, LOGPIXELSY); + trace("lLogPixelsX: %ld\n", lLogPixelsX); + trace("lLogPixelsY: %ld\n", lLogPixelsY); + // MM_TEXT + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; SetMapMode(hdc, MM_TEXT); + GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_int(apt[0].x, 1); - ok_int(apt[0].y, 1); - ok_int(apt[1].x, -1000); - ok_int(apt[1].y, 1000); + 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 apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; SetMapMode(hdc, MM_LOMETRIC); + GetExtent(hdc, &sizWnd, &sizView); + ok_int(DPtoLP(hdc, apt, 2), 1); + ok_long(apt[0].x, MulDiv(100, sizWnd.cx, sizView.cx)); + ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, MulDiv(-1000, sizWnd.cx, sizView.cx)); + ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + xLow = apt[0].x; + yLow = apt[0].y; + + // MM_HIMETRIC + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + SetMapMode(hdc, MM_HIMETRIC); + GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_int(apt[0].x * lLogPixelsX, 33888 ); - ok_int(apt[0].y * lLogPixelsY, -86688 ); - ok_int(apt[1].x * lLogPixelsX, -338688 ); - ok_int(apt[1].y * lLogPixelsY, -338688 ); + ok_long(apt[0].x, MulDiv(100, sizWnd.cx, sizView.cx)); + ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, MulDiv(-1000, sizWnd.cx, sizView.cx)); + ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + xHigh = apt[0].x; + yHigh = apt[0].y; + ok(labs(xLow) * 9 < labs(xHigh) && labs(xHigh) < 11 * labs(xLow), "%ld, %ld\n", xLow, xHigh); + ok(labs(yLow) * 9 < labs(yHigh) && labs(yHigh) < 11 * labs(yLow), "%ld, %ld\n", yLow, yHigh); + + // MM_LOENGLISH + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + SetMapMode(hdc, MM_LOENGLISH); + GetExtent(hdc, &sizWnd, &sizView); + ok_int(DPtoLP(hdc, apt, 2), 1); + ok_long(apt[0].x, MulDiv(100, sizWnd.cx, sizView.cx)); + ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, MulDiv(-1000, sizWnd.cx, sizView.cx)); + ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + xLow = apt[0].x; + yLow = apt[0].y; + + // MM_HIENGLISH + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + SetMapMode(hdc, MM_HIENGLISH); + GetExtent(hdc, &sizWnd, &sizView); + ok_int(DPtoLP(hdc, apt, 2), 1); + ok_long(apt[0].x, MulDiv(100, sizWnd.cx, sizView.cx)); + ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, MulDiv(-1000, sizWnd.cx, sizView.cx)); + ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + xHigh = apt[0].x; + yHigh = apt[0].y; + ok(labs(xLow) * 9 < labs(xHigh) && labs(xHigh) < 11 * labs(xLow), "%ld, %ld\n", xLow, xHigh); + ok(labs(yLow) * 9 < labs(yHigh) && labs(yHigh) < 11 * labs(yLow), "%ld, %ld\n", yLow, yHigh); + + // MM_TWIPS + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + SetMapMode(hdc, MM_TWIPS); + GetExtent(hdc, &sizWnd, &sizView); + ok_int(DPtoLP(hdc, apt, 2), 1); + ok_long(apt[0].x, MulDiv(100, sizWnd.cx, sizView.cx)); + ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, MulDiv(-1000, sizWnd.cx, sizView.cx)); + ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + SetGraphicsMode(hdc, GM_ADVANCED); SetMapMode(hdc, MM_ANISOTROPIC); @@ -99,63 +170,148 @@ void Test_DPtoLP() xform.eM12 = 0.; xform.eM21 = 0.; xform.eM22 = 1.; - xform.eDx = (FLOAT)4294967167.999999761; + xform.eDx = 2.; xform.eDy = 1.; ok_int(SetWorldTransform(hdc, &xform), 1); + // eDx == 2, eDy == 1 apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_int(apt[0].x * lLogPixelsX, 58464 ); - ok_int(apt[0].y * lLogPixelsY, -86784 ); - ok_int(apt[1].x * lLogPixelsX, -314112 ); - ok_int(apt[1].y * lLogPixelsY, -338784 ); + ok_long(apt[0].x, MulDiv(100, sizWnd.cx, sizView.cx) - (LONG)xform.eDx); + ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy) - (LONG)xform.eDy); + ok_long(apt[1].x, MulDiv(-1000, sizWnd.cx, sizView.cx) - (LONG)xform.eDx); + ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy) - (LONG)xform.eDy); + // eM11 == 10000000 apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; xform.eM11 = 10000000.; + xform.eDx = 0.; + xform.eDy = 0.; + ok_int(SetWorldTransform(hdc, &xform), 1); + GetExtent(hdc, &sizWnd, &sizView); + ok_int(DPtoLP(hdc, apt, 2), 1); + ok_long(apt[0].x, 0); + ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, 0); + ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + + // eM11 == 2 + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + xform.eM11 = 2.; + xform.eDx = 0.; + xform.eDy = 0.; + ok_int(SetWorldTransform(hdc, &xform), 1); + GetExtent(hdc, &sizWnd, &sizView); + ok_int(DPtoLP(hdc, apt, 2), 1); + ok_long(apt[0].x, MulDiv(100 / 2, sizWnd.cx, sizView.cx)); + ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, MulDiv(-1000 / 2, sizWnd.cx, sizView.cx)); + ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + + // eM11 == (FLOAT)0x1FFFFFFFF + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + xform.eM11 = (FLOAT)0x1FFFFFFFF; + xform.eDx = 0.; + xform.eDy = 0.; ok_int(SetWorldTransform(hdc, &xform), 1); + GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_int(apt[0].x * lLogPixelsX, -41184 ); - ok_int(apt[0].y * lLogPixelsY, -86784 ); - ok_int(apt[1].x * lLogPixelsX, -41184 ); - ok_int(apt[1].y * lLogPixelsY, -338784 ); + ok_long(apt[0].x, 0); + //ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, 0); + //ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + // eM11 == (FLOAT)0xFFFFFFFFU + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + xform.eM11 = (FLOAT)0xFFFFFFFFU; + xform.eM22 = 1.; + xform.eDx = 0.; + xform.eDy = 0.; + ok_int(SetWorldTransform(hdc, &xform), 1); + GetExtent(hdc, &sizWnd, &sizView); + ok_int(DPtoLP(hdc, apt, 2), 1); + ok_long(apt[0].x, 0); + ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, 0); + ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); + + // eM22 == (FLOAT)0xFFFFFFFFU apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; xform.eM11 = 1.; - xform.eDx = (FLOAT)4294967167.999999762; // this is too big + xform.eM22 = (FLOAT)0xFFFFFFFFU; + xform.eDx = 0.; + xform.eDy = 0.; ok_int(SetWorldTransform(hdc, &xform), 1); - ok_int(DPtoLP(hdc, apt, 2), 0); - ok_int(apt[0].x, 100 ); - ok_int(apt[0].y, 256 ); - ok_int(apt[1].x, -1000 ); - ok_int(apt[1].y, 1000 ); + GetExtent(hdc, &sizWnd, &sizView); + ok_int(DPtoLP(hdc, apt, 2), 1); + //ok_long(apt[0].x, MulDiv(100, sizWnd.cy, sizView.cy)); + ok_long(apt[0].y, 0); + //ok_long(apt[1].x, MulDiv(-1000, sizWnd.cy, sizView.cy)); + ok_long(apt[1].y, 0); - xform.eM11 = 2.; - xform.eDx = (FLOAT)4294967167.999999762; + // eM22 == (FLOAT)0x1FFFFFFFFU + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + xform.eM11 = 1.; + xform.eM22 = (FLOAT)0x1FFFFFFFFU; + xform.eDx = 0.; + xform.eDy = 0.; + ok_int(SetWorldTransform(hdc, &xform), 1); + GetExtent(hdc, &sizWnd, &sizView); + ok_int(DPtoLP(hdc, apt, 2), 1); + //ok_long(apt[0].x, MulDiv(100, sizWnd.cy, sizView.cy)); + ok_long(apt[0].y, 0); + //ok_long(apt[1].x, MulDiv(-1000, sizWnd.cy, sizView.cy)); + ok_long(apt[1].y, 0); + + // eM11 == (FLOAT)0xFFFFFFFFU, eM22 == (FLOAT)0xFFFFFFFFU + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + xform.eM11 = (FLOAT)0xFFFFFFFFU; + xform.eM22 = (FLOAT)0xFFFFFFFFU; + xform.eDx = 0.; + xform.eDy = 0.; + ok_int(SetWorldTransform(hdc, &xform), 1); + GetExtent(hdc, &sizWnd, &sizView); + ok_int(DPtoLP(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 == (FLOAT)0x1FFFFFFFFU, eM22 == (FLOAT)0x1FFFFFFFFU + apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; + xform.eM11 = (FLOAT)0x1FFFFFFFFU; + xform.eM22 = (FLOAT)0x1FFFFFFFFU; + xform.eDx = 0.; + xform.eDy = 0.; ok_int(SetWorldTransform(hdc, &xform), 1); + GetExtent(hdc, &sizWnd, &sizView); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_int(apt[0].x * lLogPixelsX, 16896 ); - ok_int(apt[0].y * lLogPixelsY, -86784 ); - ok_int(apt[1].x * lLogPixelsX, -169344 ); - ok_int(apt[1].y * lLogPixelsY, -338784 ); + 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 == 10000000 apt[0].x = 100; apt[0].y = 256; apt[1].x = -1000; apt[1].y = 1000; xform.eM11 = 10000000.; + xform.eM22 = 1.0; ok_int(SetWorldTransform(hdc, &xform), 1); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_int(apt[0].x * lLogPixelsX, -41184 ); - ok_int(apt[0].y * lLogPixelsY, -86784 ); - ok_int(apt[1].x * lLogPixelsX, -41184 ); - ok_int(apt[1].y * lLogPixelsY, -338784 ); + ok_long(apt[0].x, 0); + ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, 0); + ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); xform.eM11 = 1000000.; ok_int(SetWorldTransform(hdc, &xform), 1); ok_int(DPtoLP(hdc, apt, 2), 1); - ok_int(apt[0].x * lLogPixelsX, -412320 ); - ok_int(apt[0].y * lLogPixelsY, 306048 ); - ok_int(apt[1].x * lLogPixelsX, -412320 ); - ok_int(apt[1].y * lLogPixelsY, 1195104 ); + ok_long(apt[0].x, 0); + //ok_long(apt[0].y, MulDiv(256, sizWnd.cy, sizView.cy)); + ok_long(apt[1].x, 0); + //ok_long(apt[1].y, MulDiv(1000, sizWnd.cy, sizView.cy)); - ReleaseDC(0, hdc); + DeleteDC(hdc); } START_TEST(DPtoLP)
5 years, 8 months
1
0
0
0
[reactos] 01/01: [ROSTESTS][GDI32_APITEST] Follow up of #1457 (#1458)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=234a78e09f11af9de830e…
commit 234a78e09f11af9de830e52a11e21e3719f3f29a Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Apr 3 20:42:21 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Apr 3 20:42:21 2019 +0900 [ROSTESTS][GDI32_APITEST] Follow up of #1457 (#1458) Thanks, @SergeGautherie. --- modules/rostests/apitests/gdi32/SetWindowExtEx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rostests/apitests/gdi32/SetWindowExtEx.c b/modules/rostests/apitests/gdi32/SetWindowExtEx.c index 2bed49ee50..e55c993eda 100644 --- a/modules/rostests/apitests/gdi32/SetWindowExtEx.c +++ b/modules/rostests/apitests/gdi32/SetWindowExtEx.c @@ -158,8 +158,8 @@ void Test_SetWindowExtEx() //TEST(pDC_Attr->flXform & PAGE_EXTENTS_CHANGED); /* Check the viewport from the dcattr, without going through gdi */ - //TEST(pDC_Attr->szlViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); - //TEST(pDC_Attr->szlViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); + //ok_long(pDC_Attr->szlViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + //ok_long(pDC_Attr->szlViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); /* Check the viewport with gdi, should not be the same */ GetViewportExtEx(hDC, &ViewportExt);
5 years, 8 months
1
0
0
0
[reactos] 01/01: [ROSTESTS][GDI32_APITEST] Refactor testcases (#1457)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f65a62ea5b7df0bb4a42b…
commit f65a62ea5b7df0bb4a42be29a791ba4871d2ae9b Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Apr 3 17:22:21 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Apr 3 17:22:21 2019 +0900 [ROSTESTS][GDI32_APITEST] Refactor testcases (#1457) [ROSTESTS][GDI32_APITEST] Refactor testcases --- modules/rostests/apitests/gdi32/GetRandomRgn.c | 17 +- .../rostests/apitests/gdi32/GetTextExtentExPoint.c | 33 ++-- modules/rostests/apitests/gdi32/GetTextFace.c | 34 ++-- modules/rostests/apitests/gdi32/SetMapMode.c | 129 ++++++------- modules/rostests/apitests/gdi32/SetWindowExtEx.c | 209 +++++++++++---------- 5 files changed, 213 insertions(+), 209 deletions(-) diff --git a/modules/rostests/apitests/gdi32/GetRandomRgn.c b/modules/rostests/apitests/gdi32/GetRandomRgn.c index 63eea4420a..14f7257bae 100644 --- a/modules/rostests/apitests/gdi32/GetRandomRgn.c +++ b/modules/rostests/apitests/gdi32/GetRandomRgn.c @@ -3,6 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * PURPOSE: Test for GetRandomRgn * PROGRAMMERS: Timo Kreuzer + * Katayama Hirofumi MZ */ #include "precomp.h" @@ -58,42 +59,42 @@ void Test_GetRandomRgn_Params() SetLastError(0xbadbad00); ret = GetRandomRgn(hdc, NULL, 0); ok_int(ret, 0); - ok_long(GetLastError(), 0xbadbad00); + ok_err(0xbadbad00); SetLastError(0xbadbad00); ret = GetRandomRgn(hdc, NULL, CLIPRGN); ok_int(ret, 0); - ok_long(GetLastError(), 0xbadbad00); + ok_err(0xbadbad00); SetLastError(0xbadbad00); ret = GetRandomRgn(hdc, hrgn, 0); ok_int(ret, 0); - ok_long(GetLastError(), 0xbadbad00); + ok_err(0xbadbad00); #if 0 // this is vista+ SetLastError(0xbadbad00); ret = GetRandomRgn(hdc, hrgn, 5); ok_int(ret, 1); - ok_long(GetLastError(), 0xbadbad00); + ok_err(0xbadbad00); #endif SetLastError(0xbadbad00); ret = GetRandomRgn(hdc, hrgn, 6); ok_int(ret, 0); - ok_long(GetLastError(), 0xbadbad00); + ok_err(0xbadbad00); SetLastError(0xbadbad00); ret = GetRandomRgn(hdc, hrgn, 27); ok_int(ret, 0); - ok_long(GetLastError(), 0xbadbad00); + ok_err(0xbadbad00); SetLastError(0xbadbad00); ret = GetRandomRgn(hdc, hrgn, -1); ok_int(ret, 0); - ok_long(GetLastError(), 0xbadbad00); + ok_err(0xbadbad00); SetLastError(0xbadbad00); ret = GetRandomRgn(hdc, hrgn, CLIPRGN); ok_int(ret, 0); - ok_long(GetLastError(), 0xbadbad00); + ok_err(0xbadbad00); SetLastError(0xbadbad00); ret = GetRandomRgn((HDC)0x123, hrgn, CLIPRGN); diff --git a/modules/rostests/apitests/gdi32/GetTextExtentExPoint.c b/modules/rostests/apitests/gdi32/GetTextExtentExPoint.c index 9ec44811cf..4e5cc6e40e 100644 --- a/modules/rostests/apitests/gdi32/GetTextExtentExPoint.c +++ b/modules/rostests/apitests/gdi32/GetTextExtentExPoint.c @@ -3,6 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * PURPOSE: Test for GetTextExtentExPoint * PROGRAMMERS: Timo Kreuzer + * Katayama Hirofumi MZ */ #include "precomp.h" @@ -16,36 +17,36 @@ void Test_GetTextExtentExPoint() SetLastError(0); result = GetTextExtentExPointA(GetDC(0), "test", 4, 1000, &nFit, NULL, &size); - TEST(result == 1); - TEST(nFit == 4); - TEST(GetLastError() == 0); + ok_int(result, 1); + ok_int(nFit, 4); + ok_err(0); printf("nFit = %d\n", nFit); result = GetTextExtentExPointA(GetDC(0), "test", 4, 1, &nFit, NULL, &size); - TEST(result == 1); - TEST(nFit == 0); - TEST(GetLastError() == 0); + ok_int(result, 1); + ok_int(nFit, 0); + ok_err(0); printf("nFit = %d\n", nFit); result = GetTextExtentExPointA(GetDC(0), "test", 4, 0, &nFit, NULL, &size); - TEST(result == 1); - TEST(nFit == 0); - TEST(GetLastError() == 0); + ok_int(result, 1); + ok_int(nFit, 0); + ok_err(0); result = GetTextExtentExPointA(GetDC(0), "test", 4, -1, &nFit, NULL, &size); - TEST(result == 1); - TEST(nFit == 4); - TEST(GetLastError() == 0); + ok_int(result, 1); + ok_int(nFit, 4); + ok_err(0); result = GetTextExtentExPointA(GetDC(0), "test", 4, -2, &nFit, NULL, &size); - TEST(result == 0); - TEST(GetLastError() == 87); + ok_int(result, 0); + ok_err(87); result = GetTextExtentExPointW(GetDC(0), L"test", 4, -10, &nFit, NULL, &size); - TEST(result == 1); + ok_int(result, 1); result = GetTextExtentExPointA(GetDC(0), "test", 4, -10, &nFit, NULL, &size); - TEST(result == 0); + ok_int(result, 0); } START_TEST(GetTextExtentExPoint) diff --git a/modules/rostests/apitests/gdi32/GetTextFace.c b/modules/rostests/apitests/gdi32/GetTextFace.c index 7893273511..22c1528392 100644 --- a/modules/rostests/apitests/gdi32/GetTextFace.c +++ b/modules/rostests/apitests/gdi32/GetTextFace.c @@ -32,21 +32,21 @@ void Test_GetTextFace(void) SetLastError(0xE000BEEF); ret = GetTextFaceW(hDC, 0, NULL); TEST(ret != 0); - ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError()); + ok_err(0xE000BEEF); ret2 = ret; SetLastError(0xE000BEEF); ret = GetTextFaceW(hDC, -1, NULL); TEST(ret != 0); - TEST(ret == ret2); - ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError()); + ok_int(ret, ret2); + ok_err(0xE000BEEF); ret2 = ret; SetLastError(0xE000BEEF); ret = GetTextFaceW(hDC, 10000, NULL); TEST(ret != 0); - TEST(ret == ret2); - ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError()); + ok_int(ret, ret2); + ok_err(0xE000BEEF); ret2 = ret; /* Whether the buffer is correctly filled */ @@ -54,31 +54,31 @@ void Test_GetTextFace(void) ret = GetTextFaceW(hDC, 20, Buffer); TEST(ret != 0); TEST(ret <= 20); - TEST(Buffer[ret - 1] == 0); - ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError()); + ok_int(Buffer[ret - 1], 0); + ok_err(0xE000BEEF); SetLastError(0xE000BEEF); ret = GetTextFaceW(hDC, 1, Buffer); - TEST(ret == 1); - TEST(Buffer[ret - 1] == 0); - ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError()); + ok_int(ret, 1); + ok_int(Buffer[ret - 1], 0); + ok_err(0xE000BEEF); SetLastError(0xE000BEEF); ret = GetTextFaceW(hDC, 2, Buffer); - TEST(ret == 2); - TEST(Buffer[ret - 1] == 0); - ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError()); + ok_int(ret, 2); + ok_int(Buffer[ret - 1], 0); + ok_err(0xE000BEEF); /* Whether invalid buffer sizes are correctly ignored */ SetLastError(0xE000BEEF); ret = GetTextFaceW(hDC, 0, Buffer); - TEST(ret == 0); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() == %ld\n", GetLastError()); + ok_int(ret, 0); + ok_err(ERROR_INVALID_PARAMETER); SetLastError(0xE000BEEF); ret = GetTextFaceW(hDC, -1, Buffer); - TEST(ret == 0); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() == %ld\n", GetLastError()); + ok_int(ret, 0); + ok_err(ERROR_INVALID_PARAMETER); DeleteDC(hDC); } diff --git a/modules/rostests/apitests/gdi32/SetMapMode.c b/modules/rostests/apitests/gdi32/SetMapMode.c index 004bf0c8ab..8d38250199 100644 --- a/modules/rostests/apitests/gdi32/SetMapMode.c +++ b/modules/rostests/apitests/gdi32/SetMapMode.c @@ -3,6 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * PURPOSE: Test for SetMapMode * PROGRAMMERS: Timo Kreuzer + * Katayama Hirofumi MZ */ #include "precomp.h" @@ -21,79 +22,79 @@ void Test_SetMapMode() GetViewportExtEx(hDC, &ViewportExt); ulMapMode = SetMapMode(hDC, MM_ISOTROPIC); - TEST(ulMapMode == MM_TEXT); - TEST(WindowExt.cx == 1); - TEST(WindowExt.cy == 1); - TEST(ViewportExt.cx == 1); - TEST(ViewportExt.cy == 1); + ok_long(ulMapMode, MM_TEXT); + ok_long(WindowExt.cx, 1); + ok_long(WindowExt.cy, 1); + ok_long(ViewportExt.cx, 1); + ok_long(ViewportExt.cy, 1); SetLastError(0); ulMapMode = SetMapMode(hDC, 0); - TEST(GetLastError() == 0); - TEST(ulMapMode == 0); + ok_err(0); + ok_long(ulMapMode, 0); /* Go through all valid values */ ulMapMode = SetMapMode(hDC, 1); - TEST(ulMapMode == MM_ISOTROPIC); + ok_long(ulMapMode, MM_ISOTROPIC); ulMapMode = SetMapMode(hDC, 2); - TEST(ulMapMode == 1); + ok_long(ulMapMode, 1); ulMapMode = SetMapMode(hDC, 3); - TEST(ulMapMode == 2); + ok_long(ulMapMode, 2); ulMapMode = SetMapMode(hDC, 4); - TEST(ulMapMode == 3); + ok_long(ulMapMode, 3); ulMapMode = SetMapMode(hDC, 5); - TEST(ulMapMode == 4); + ok_long(ulMapMode, 4); ulMapMode = SetMapMode(hDC, 6); - TEST(ulMapMode == 5); + ok_long(ulMapMode, 5); ulMapMode = SetMapMode(hDC, 7); - TEST(ulMapMode == 6); + ok_long(ulMapMode, 6); ulMapMode = SetMapMode(hDC, 8); - TEST(ulMapMode == 7); + ok_long(ulMapMode, 7); /* Test invalid value */ ulMapMode = SetMapMode(hDC, 9); - TEST(ulMapMode == 0); + ok_long(ulMapMode, 0); ulMapMode = SetMapMode(hDC, 10); - TEST(ulMapMode == 0); + ok_long(ulMapMode, 0); - TEST(GetLastError() == 0); + ok_err(0); /* Test NULL DC */ ulMapMode = SetMapMode((HDC)0, 2); - TEST(ulMapMode == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_long(ulMapMode, 0); + ok_err(ERROR_INVALID_PARAMETER); /* Test NULL DC and invalid mode */ ulMapMode = SetMapMode((HDC)0, 10); - TEST(ulMapMode == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_long(ulMapMode, 0); + ok_err(ERROR_INVALID_PARAMETER); /* Test invalid DC */ ulMapMode = SetMapMode((HDC)0x12345, 2); - TEST(ulMapMode == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_long(ulMapMode, 0); + ok_err(ERROR_INVALID_PARAMETER); /* Test invalid DC and invalid mode */ ulMapMode = SetMapMode((HDC)0x12345, 10); - TEST(ulMapMode == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_long(ulMapMode, 0); + ok_err(ERROR_INVALID_PARAMETER); DeleteDC(hDC); /* Test a deleted DC */ ulMapMode = SetMapMode(hDC, 2); - TEST(ulMapMode == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_long(ulMapMode, 0); + ok_err(ERROR_INVALID_PARAMETER); /* Test MM_TEXT */ hDC = CreateCompatibleDC(NULL); SetMapMode(hDC, MM_TEXT); GetWindowExtEx(hDC, &WindowExt); GetViewportExtEx(hDC, &ViewportExt); - TEST(WindowExt.cx == 1); - TEST(WindowExt.cy == 1); - TEST(ViewportExt.cx == 1); - TEST(ViewportExt.cy == 1); + ok_long(WindowExt.cx, 1); + ok_long(WindowExt.cy, 1); + ok_long(ViewportExt.cx, 1); + ok_long(ViewportExt.cy, 1); DeleteDC(hDC); /* Test MM_ISOTROPIC */ @@ -101,10 +102,10 @@ void Test_SetMapMode() SetMapMode(hDC, MM_ISOTROPIC); GetWindowExtEx(hDC, &WindowExt); GetViewportExtEx(hDC, &ViewportExt); - //TEST(WindowExt.cx == 3600); - //TEST(WindowExt.cy == 2700); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + //ok_long(WindowExt.cx, 3600); + //ok_long(WindowExt.cy, 2700); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); DeleteDC(hDC); /* Test MM_ANISOTROPIC */ @@ -112,20 +113,20 @@ void Test_SetMapMode() SetMapMode(hDC, MM_ANISOTROPIC); GetWindowExtEx(hDC, &WindowExt); GetViewportExtEx(hDC, &ViewportExt); - TEST(WindowExt.cx == 1); - TEST(WindowExt.cy == 1); - TEST(ViewportExt.cx == 1); - TEST(ViewportExt.cy == 1); + ok_long(WindowExt.cx, 1); + ok_long(WindowExt.cy, 1); + ok_long(ViewportExt.cx, 1); + ok_long(ViewportExt.cy, 1); /* set MM_ISOTROPIC first, the values will be kept */ SetMapMode(hDC, MM_ISOTROPIC); SetMapMode(hDC, MM_ANISOTROPIC); GetWindowExtEx(hDC, &WindowExt); GetViewportExtEx(hDC, &ViewportExt); - //TEST(WindowExt.cx == 3600); - //TEST(WindowExt.cy == 2700); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + //ok_long(WindowExt.cx, 3600); + //ok_long(WindowExt.cy, 2700); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); DeleteDC(hDC); /* Test MM_LOMETRIC */ @@ -133,10 +134,10 @@ void Test_SetMapMode() SetMapMode(hDC, MM_LOMETRIC); GetWindowExtEx(hDC, &WindowExt); GetViewportExtEx(hDC, &ViewportExt); - //TEST(WindowExt.cx == 3600); - //TEST(WindowExt.cy == 2700); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + //ok_long(WindowExt.cx, 3600); + //ok_long(WindowExt.cy, 2700); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); DeleteDC(hDC); /* Test MM_HIMETRIC */ @@ -144,10 +145,10 @@ void Test_SetMapMode() SetMapMode(hDC, MM_HIMETRIC); GetWindowExtEx(hDC, &WindowExt); GetViewportExtEx(hDC, &ViewportExt); - //TEST(WindowExt.cx == 36000); - //TEST(WindowExt.cy == 27000); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + //ok_long(WindowExt.cx, 36000); + //ok_long(WindowExt.cy, 27000); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); DeleteDC(hDC); /* Test MM_LOENGLISH */ @@ -155,10 +156,10 @@ void Test_SetMapMode() SetMapMode(hDC, MM_LOENGLISH); GetWindowExtEx(hDC, &WindowExt); GetViewportExtEx(hDC, &ViewportExt); - //TEST(WindowExt.cx == 1417); - //TEST(WindowExt.cy == 1063); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + //ok_long(WindowExt.cx, 1417); + //ok_long(WindowExt.cy, 1063); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); DeleteDC(hDC); /* Test MM_HIENGLISH */ @@ -166,10 +167,10 @@ void Test_SetMapMode() SetMapMode(hDC, MM_HIENGLISH); GetWindowExtEx(hDC, &WindowExt); GetViewportExtEx(hDC, &ViewportExt); - //TEST(WindowExt.cx == 14173); - //TEST(WindowExt.cy == 10630); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + //ok_long(WindowExt.cx, 14173); + //ok_long(WindowExt.cy, 10630); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); DeleteDC(hDC); /* Test MM_TWIPS */ @@ -177,10 +178,10 @@ void Test_SetMapMode() SetMapMode(hDC, MM_TWIPS); GetWindowExtEx(hDC, &WindowExt); GetViewportExtEx(hDC, &ViewportExt); - //TEST(WindowExt.cx == 20409); - //TEST(WindowExt.cy == 15307); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + //ok_long(WindowExt.cx, 20409); + //ok_long(WindowExt.cy, 15307); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); DeleteDC(hDC); } diff --git a/modules/rostests/apitests/gdi32/SetWindowExtEx.c b/modules/rostests/apitests/gdi32/SetWindowExtEx.c index b32455a2ed..2bed49ee50 100644 --- a/modules/rostests/apitests/gdi32/SetWindowExtEx.c +++ b/modules/rostests/apitests/gdi32/SetWindowExtEx.c @@ -3,6 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * PURPOSE: Test for SetWindowExtEx * PROGRAMMERS: Timo Kreuzer + * Katayama Hirofumi MZ */ #include "precomp.h" @@ -22,57 +23,57 @@ void Test_SetWindowExtEx() SetLastError(0); ret = SetWindowExtEx(0, 0, 0, NULL); ok_err(ERROR_INVALID_HANDLE); - TEST(ret == 0); + ok_int(ret, 0); SetLastError(0); ret = SetWindowExtEx((HDC)0x1234, 0, 0, NULL); ok_err(ERROR_INVALID_HANDLE); - TEST(ret == 0); + ok_int(ret, 0); SetLastError(0); ret = SetWindowExtEx((HDC)0x10000, 0, 0, NULL); ok_err(ERROR_INVALID_PARAMETER); - TEST(ret == 0); + ok_int(ret, 0); SetLastError(0); ret = SetWindowExtEx((HDC)0x210000, 0, 0, NULL); // GDILoObjType_LO_ALTDC_TYPE ok_err(ERROR_INVALID_HANDLE); - TEST(ret == 0); + ok_int(ret, 0); SetLastError(0); ret = SetWindowExtEx((HDC)0x260000, 0, 0, NULL); // GDILoObjType_LO_METAFILE16_TYPE ok_err(ERROR_INVALID_HANDLE); - TEST(ret == 0); + ok_int(ret, 0); SetLastError(0); ret = SetWindowExtEx((HDC)0x460000, 0, 0, NULL); // GDILoObjType_LO_METAFILE_TYPE ok_err(ERROR_INVALID_HANDLE); - TEST(ret == 0); + ok_int(ret, 0); SetLastError(0); ret = SetWindowExtEx((HDC)0x660000, 0, 0, NULL); // GDILoObjType_LO_METADC16_TYPE ok_err(ERROR_INVALID_HANDLE); - TEST(ret == 0); + ok_int(ret, 0); SetLastError(0); ret = SetWindowExtEx(hDC, 0, 0, NULL); ok_err(0); - TEST(ret == 1); + ok_int(ret, 1); /* Test 16 bit handle */ SetLastError(0); ret = SetWindowExtEx((HDC)((ULONG_PTR)hDC & 0xffff), 0, 0, NULL); ok_err(ERROR_INVALID_HANDLE); - TEST(ret == 0); + ok_int(ret, 0); WindowExt.cx = 1234; WindowExt.cy = 6789; SetLastError(0); ret = SetWindowExtEx(0, 0, 0, &WindowExt); ok_err(ERROR_INVALID_HANDLE); - TEST(ret == 0); - TEST(WindowExt.cx == 1234); - TEST(WindowExt.cy == 6789); + ok_int(ret, 0); + ok_long(WindowExt.cx, 1234); + ok_long(WindowExt.cy, 6789); DeleteDC(hDC); @@ -80,7 +81,7 @@ void Test_SetWindowExtEx() SetLastError(0); ret = SetWindowExtEx(hDC, 0, 0, NULL); ok_err(ERROR_INVALID_PARAMETER); - TEST(ret == 0); + ok_int(ret, 0); hDC = CreateCompatibleDC(0); ok(hDC != NULL, "CreateCompatibleDC failed. Skipping tests.\n"); @@ -92,225 +93,225 @@ void Test_SetWindowExtEx() /* Test setting 0 extents without changing the map mode (MM_TEXT) */ ret = SetWindowExtEx(hDC, 0, 0, &WindowExt); - TEST(ret == 1); - TEST(WindowExt.cx == 1); - TEST(WindowExt.cy == 1); + ok_int(ret, 1); + ok_long(WindowExt.cx, 1); + ok_long(WindowExt.cy, 1); /* Test setting proper extents without changing the map mode (MM_TEXT) */ WindowExt.cx = WindowExt.cy = 0; ret = SetWindowExtEx(hDC, 10, 20, &WindowExt); - TEST(ret == 1); - TEST(WindowExt.cx == 1); - TEST(WindowExt.cy == 1); + ok_int(ret, 1); + ok_long(WindowExt.cx, 1); + ok_long(WindowExt.cy, 1); /* Values should not be changed */ WindowExt.cx = WindowExt.cy = 0; ret = SetWindowExtEx(hDC, 40, 30, &WindowExt); - TEST(ret == 1); - TEST(WindowExt.cx == 1); - TEST(WindowExt.cy == 1); + ok_int(ret, 1); + ok_long(WindowExt.cx, 1); + ok_long(WindowExt.cy, 1); /* Check the viewport */ GetViewportExtEx(hDC, &ViewportExt); - TEST(ViewportExt.cx == 1); - TEST(ViewportExt.cy == 1); + ok_long(ViewportExt.cx, 1); + ok_long(ViewportExt.cy, 1); /* Test setting in isotropic mode with 0 extents */ SetMapMode(hDC, MM_ISOTROPIC); WindowExt.cx = WindowExt.cy = 0; ret = SetWindowExtEx(hDC, 0, 0, &WindowExt); - TEST(ret == 0); - //TEST(WindowExt.cx == 3600); - //TEST(WindowExt.cy == 2700); + ok_int(ret, 0); + //ok_long(WindowExt.cx, 3600); + //ok_long(WindowExt.cy, 2700); ret = SetWindowExtEx(hDC, 100, 0, &WindowExt); - TEST(ret == 0); + ok_int(ret, 0); ret = SetWindowExtEx(hDC, 0, 100, &WindowExt); - TEST(ret == 0); + ok_int(ret, 0); /* Test setting in isotropic mode */ ret = SetWindowExtEx(hDC, 21224, 35114, &WindowExt); - TEST(ret == 1); - //TEST(WindowExt.cx == 3600); - //TEST(WindowExt.cy == 2700); + ok_int(ret, 1); + //ok_long(WindowExt.cx, 3600); + //ok_long(WindowExt.cy, 2700); /* Values should be changed */ ret = SetWindowExtEx(hDC, 4 * GetDeviceCaps(GetDC(0), HORZRES), -4 * GetDeviceCaps(GetDC(0), VERTRES), &WindowExt); - TEST(ret == 1); - TEST(WindowExt.cx == 21224); - TEST(WindowExt.cy == 35114); + ok_int(ret, 1); + ok_long(WindowExt.cx, 21224); + ok_long(WindowExt.cy, 35114); /* Check the viewport, should be the same */ GetViewportExtEx(hDC, &ViewportExt); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); /* again isotropic mode with 1:1 res */ ret = SetWindowExtEx(hDC, 123, 123, &WindowExt); - TEST(ret == 1); - TEST(WindowExt.cx == 4 * GetDeviceCaps(GetDC(0), HORZRES)); - TEST(WindowExt.cy == -4 * GetDeviceCaps(GetDC(0), VERTRES)); + ok_int(ret, 1); + ok_long(WindowExt.cx, 4 * GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(WindowExt.cy, -4 * GetDeviceCaps(GetDC(0), VERTRES)); /* Test flXform */ //TEST(pDC_Attr->flXform & PAGE_EXTENTS_CHANGED); /* Check the viewport from the dcattr, without going through gdi */ - //TEST(pDC_Attr->szlViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - //TEST(pDC_Attr->szlViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + //TEST(pDC_Attr->szlViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + //TEST(pDC_Attr->szlViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); /* Check the viewport with gdi, should not be the same */ GetViewportExtEx(hDC, &ViewportExt); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), VERTRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), VERTRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); /* Test flXform */ //TEST(pDC_Attr->flXform & PAGE_EXTENTS_CHANGED); /* again isotropic mode with 3:1 res */ ret = SetWindowExtEx(hDC, 300, 100, &WindowExt); - TEST(ret == 1); - TEST(WindowExt.cx == 123); - TEST(WindowExt.cy == 123); + ok_int(ret, 1); + ok_long(WindowExt.cx, 123); + ok_long(WindowExt.cy, 123); /* Check the viewport now, should not be the same */ GetViewportExtEx(hDC, &ViewportExt); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), VERTRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES) / 3); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), VERTRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES) / 3); /* again isotropic mode with 1:3 res */ SetViewportExtEx(hDC, 6000, 3000, 0); ret = SetWindowExtEx(hDC, 200, 600, &WindowExt); - TEST(ret == 1); - TEST(WindowExt.cx == 300); - TEST(WindowExt.cy == 100); + ok_int(ret, 1); + ok_long(WindowExt.cx, 300); + ok_long(WindowExt.cy, 100); /* Check the viewport now, should not be the same */ GetViewportExtEx(hDC, &ViewportExt); - TEST(ViewportExt.cx == 1000); - TEST(ViewportExt.cy == 3000); + ok_long(ViewportExt.cx, 1000); + ok_long(ViewportExt.cy, 3000); /* Test setting in anisotropic mode */ SetMapMode(hDC, MM_ANISOTROPIC); ret = SetWindowExtEx(hDC, 80, 60, &WindowExt); - TEST(ret == 1); - TEST(WindowExt.cx == 200); - TEST(WindowExt.cy == 600); + ok_int(ret, 1); + ok_long(WindowExt.cx, 200); + ok_long(WindowExt.cy, 600); /* Values should be changed */ ret = SetWindowExtEx(hDC, 500, 500, &WindowExt); - TEST(ret == 1); - TEST(WindowExt.cx == 80); - TEST(WindowExt.cy == 60); + ok_int(ret, 1); + ok_long(WindowExt.cx, 80); + ok_long(WindowExt.cy, 60); /* Check the viewport */ GetViewportExtEx(hDC, &ViewportExt); - TEST(ViewportExt.cx == 1000); - TEST(ViewportExt.cy == 3000); + ok_long(ViewportExt.cx, 1000); + ok_long(ViewportExt.cy, 3000); /* Test setting in low metric mode */ SetMapMode(hDC, MM_LOMETRIC); ret = SetWindowExtEx(hDC, 120, 90, &WindowExt); - TEST(ret == 1); - //TEST(WindowExt.cx == 3600); - //TEST(WindowExt.cy == 2700); + ok_int(ret, 1); + //ok_long(WindowExt.cx, 3600); + //ok_long(WindowExt.cy, 2700); /* Values should not be changed */ WindowExt.cx = WindowExt.cy = 0; ret = SetWindowExtEx(hDC, 900, 700, &WindowExt); - TEST(ret == 1); - //TEST(WindowExt.cx == 3600); - //TEST(WindowExt.cy == 2700); + ok_int(ret, 1); + //ok_long(WindowExt.cx, 3600); + //ok_long(WindowExt.cy, 2700); /* Check the viewport */ GetViewportExtEx(hDC, &ViewportExt); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); /* Test setting in high metric mode */ SetMapMode(hDC, MM_HIMETRIC); ret = SetWindowExtEx(hDC, 120, 90, &WindowExt); - TEST(ret == 1); - //TEST(WindowExt.cx == 36000); - //TEST(WindowExt.cy == 27000); + ok_int(ret, 1); + //ok_long(WindowExt.cx, 36000); + //ok_long(WindowExt.cy, 27000); /* Values should not be changed */ WindowExt.cx = WindowExt.cy = 0; ret = SetWindowExtEx(hDC, 500, 300, &WindowExt); - TEST(ret == 1); - //TEST(WindowExt.cx == 36000); - //TEST(WindowExt.cy == 27000); + ok_int(ret, 1); + //ok_long(WindowExt.cx, 36000); + //ok_long(WindowExt.cy, 27000); /* Check the viewport */ GetViewportExtEx(hDC, &ViewportExt); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); /* Test setting in low english mode */ SetMapMode(hDC, MM_LOENGLISH); ret = SetWindowExtEx(hDC, 320, 290, &WindowExt); - TEST(ret == 1); - //TEST(WindowExt.cx == 1417); - //TEST(WindowExt.cy == 1063); + ok_int(ret, 1); + //ok_long(WindowExt.cx, 1417); + //ok_long(WindowExt.cy, 1063); /* Values should not be changed */ WindowExt.cx = WindowExt.cy = 0; ret = SetWindowExtEx(hDC, 560, 140, &WindowExt); - TEST(ret == 1); - //TEST(WindowExt.cx == 1417); - //TEST(WindowExt.cy == 1063); + ok_int(ret, 1); + //ok_long(WindowExt.cx, 1417); + //ok_long(WindowExt.cy, 1063); /* Check the viewport */ GetViewportExtEx(hDC, &ViewportExt); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); /* Test setting in high english mode */ SetMapMode(hDC, MM_HIENGLISH); ret = SetWindowExtEx(hDC, 320, 290, &WindowExt); - TEST(ret == 1); - //TEST(WindowExt.cx == 14173); - //TEST(WindowExt.cy == 10630); + ok_int(ret, 1); + //ok_long(WindowExt.cx, 14173); + //ok_long(WindowExt.cy, 10630); /* Values should not be changed */ WindowExt.cx = WindowExt.cy = 0; ret = SetWindowExtEx(hDC, 1560, 1140, &WindowExt); - TEST(ret == 1); - //TEST(WindowExt.cx == 14173); - //TEST(WindowExt.cy == 10630); + ok_int(ret, 1); + //ok_long(WindowExt.cx, 14173); + //ok_long(WindowExt.cy, 10630); /* Check the viewport */ GetViewportExtEx(hDC, &ViewportExt); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); /* Test setting in twips mode */ SetMapMode(hDC, MM_TWIPS); ret = SetWindowExtEx(hDC, 3320, 3290, &WindowExt); - TEST(ret == 1); - //TEST(WindowExt.cx == 20409); - //TEST(WindowExt.cy == 15307); + ok_int(ret, 1); + //ok_long(WindowExt.cx, 20409); + //ok_long(WindowExt.cy, 15307); /* Values should not be changed */ WindowExt.cx = WindowExt.cy = 0; ret = SetWindowExtEx(hDC, 4560, 4140, &WindowExt); - TEST(ret == 1); - //TEST(WindowExt.cx == 20409); - //TEST(WindowExt.cy == 15307); + ok_int(ret, 1); + //ok_long(WindowExt.cx, 20409); + //ok_long(WindowExt.cy, 15307); /* Check the viewport */ GetViewportExtEx(hDC, &ViewportExt); - TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); - TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), HORZRES)); + ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES)); /* test manually modifying the dcattr, should go to tests for GetViewportExtEx */ SetMapMode(hDC, MM_ISOTROPIC); ret = SetWindowExtEx(hDC, 420, 4140, &WindowExt); //pDC_Attr->szlWindowExt.cx = 0; GetViewportExtEx(hDC, &ViewportExt); - //TEST(pDC_Attr->szlWindowExt.cx == 0); - //TEST(ViewportExt.cx == 0); + //ok_long(pDC_Attr->szlWindowExt.cx, 0); + //ok_long(ViewportExt.cx, 0); DeleteDC(hDC); }
5 years, 8 months
1
0
0
0
[reactos] 01/01: [SHELL32] Fix version info in the file dialog
by Maxim Smirnov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=39c0fd5722d68caf0a235…
commit 39c0fd5722d68caf0a2356063d59a6f668d63b49 Author: Maxim Smirnov <33279413+Simi4(a)users.noreply.github.com> AuthorDate: Wed Apr 3 00:03:19 2019 +0300 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Apr 3 00:51:24 2019 +0200 [SHELL32] Fix version info in the file dialog --- dll/win32/shell32/dialogs/filedefext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/shell32/dialogs/filedefext.cpp b/dll/win32/shell32/dialogs/filedefext.cpp index d919753cdb..8abb407682 100644 --- a/dll/win32/shell32/dialogs/filedefext.cpp +++ b/dll/win32/shell32/dialogs/filedefext.cpp @@ -80,7 +80,7 @@ LPCWSTR CFileVersionInfo::GetString(LPCWSTR pwszName) if (!VerQueryValueW(m_pInfo, wszBuf, (LPVOID *)&pwszResult, &cBytes)) pwszResult = NULL; - if (!m_wLang && !m_wCode) + if (!pwszResult) { /* Try US English */ swprintf(wszBuf, L"\\StringFileInfo\\%04x%04x\\%s", MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), 1252, pwszName);
5 years, 8 months
1
0
0
0
[reactos] 01/01: [UNIATA] Fix for uninitialized Lun pointer
by Alexandr A. Telyatnikov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6d5a81013cc52ef61b98e…
commit 6d5a81013cc52ef61b98e7bc8b5ce9536d5bb1ea Author: Alexandr A. Telyatnikov <alter(a)alter.org.ua> AuthorDate: Tue Mar 26 15:56:53 2019 +0200 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Tue Apr 2 18:02:07 2019 +0200 [UNIATA] Fix for uninitialized Lun pointer This fixes crash on Intel AHCI init. CORE-15886 --- drivers/storage/ide/uniata/id_init.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/storage/ide/uniata/id_init.cpp b/drivers/storage/ide/uniata/id_init.cpp index 2eaa98e696..b9beb1bef0 100644 --- a/drivers/storage/ide/uniata/id_init.cpp +++ b/drivers/storage/ide/uniata/id_init.cpp @@ -1251,6 +1251,7 @@ for_ugly_chips: for(c=0; c<deviceExtension->NumberChannels; c++) { chan = &deviceExtension->chan[c]; + AtapiSetupLunPtrs(chan, deviceExtension, c); IsPata = FALSE; if(ChipFlags & ICH5) { KdPrint2((PRINT_PREFIX "ICH5\n"));
5 years, 8 months
1
0
0
0
[reactos] 01/01: [KERNEL32] Fix typo in kernel32.spec (#1453)
by Julien Schueller
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=23d0aead53ab09256735c…
commit 23d0aead53ab09256735c2e7fb613f1e81fdc6b3 Author: Julien Schueller <schueller(a)phimeca.com> AuthorDate: Tue Apr 2 15:48:41 2019 +0200 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Tue Apr 2 15:48:41 2019 +0200 [KERNEL32] Fix typo in kernel32.spec (#1453) --- dll/win32/kernel32/kernel32.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/kernel32/kernel32.spec b/dll/win32/kernel32/kernel32.spec index c9176d89a3..6e1506985c 100644 --- a/dll/win32/kernel32/kernel32.spec +++ b/dll/win32/kernel32/kernel32.spec @@ -360,7 +360,7 @@ @ stub -version=0x600+ GetCalendarDaysInMonth @ stub -version=0x600+ GetCalendarDifferenceInDays @ stdcall GetCalendarInfoA(long long long ptr long ptr) -@ stdcall -version=0x600+ GetCalendarInfoEx(wstr, long, wstr, long, wstr, long, ptr) +@ stdcall -version=0x600+ GetCalendarInfoEx(wstr long wstr long wstr long ptr) @ stdcall GetCalendarInfoW(long long long ptr long ptr) @ stub -version=0x600+ GetCalendarMonthsInYear @ stub -version=0x600+ GetCalendarSupportedDateRange
5 years, 8 months
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Results per page:
10
25
50
100
200