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
2025
January
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
January 2019
----- 2025 -----
January 2025
----- 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
31 participants
300 discussions
Start a n
N
ew thread
[reactos] 01/01: [APITESTS][WIN32KNT_APITEST] Improve NtGdiEngCreatePalette testcase (#1284)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d4505e4a7fcac9ad19770…
commit d4505e4a7fcac9ad19770001bd7c688591527ff4 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Jan 22 23:01:08 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Jan 22 23:01:08 2019 +0900 [APITESTS][WIN32KNT_APITEST] Improve NtGdiEngCreatePalette testcase (#1284) Use ok and ok_long and ok_ptr macros instead of obsolete TEST macros. --- .../rostests/apitests/win32nt/ntgdi/NtGdiEngCreatePalette.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiEngCreatePalette.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiEngCreatePalette.c index 29087ecff0..0606311ff6 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiEngCreatePalette.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiEngCreatePalette.c @@ -15,12 +15,11 @@ START_TEST(NtGdiEngCreatePalette) hPal = NtGdiEngCreatePalette(PAL_RGB, 3, Colors, 0xff000000, 0x00ff0000, 0x0000ff00); - TEST(hPal != 0); - TEST(GDI_HANDLE_GET_TYPE(hPal) == GDI_OBJECT_TYPE_PALETTE); + ok(hPal != NULL, "hPal was NULL.\n"); + ok_int((int)GDI_HANDLE_GET_TYPE(hPal), (int)GDI_OBJECT_TYPE_PALETTE); pEntry = &GdiHandleTable[GDI_HANDLE_GET_INDEX(hPal)]; - TEST(pEntry->einfo.pobj != NULL); - TEST(pEntry->ObjectOwner.ulObj == GetCurrentProcessId()); - TEST(pEntry->pUser == 0); + ok(pEntry->einfo.pobj != NULL, "pEntry->einfo.pobj was NULL.\n"); + ok_long(pEntry->ObjectOwner.ulObj, GetCurrentProcessId()); + ok_ptr(pEntry->pUser, NULL); //TEST(pEntry->Type == (((UINT)hPal >> 16) | GDI_OBJECT_TYPE_PALETTE)); - }
6 years
1
0
0
0
[reactos] 01/01: [APITESTS][WIN32KNT_APITEST] Improve NtGdiDoPalette testcase (#1283)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3bc47ebe417bbf7a55993…
commit 3bc47ebe417bbf7a559936bd8e616b28b4f1ea6c Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Jan 22 21:20:49 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Jan 22 21:20:49 2019 +0900 [APITESTS][WIN32KNT_APITEST] Improve NtGdiDoPalette testcase (#1283) Use ok, ok_int and ok_long macros instead of RTEST macros. --- .../apitests/win32nt/ntgdi/NtGdiDoPalette.c | 131 ++++++++++----------- 1 file changed, 64 insertions(+), 67 deletions(-) diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiDoPalette.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiDoPalette.c index ea13ed6334..c8887ffd17 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiDoPalette.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiDoPalette.c @@ -39,69 +39,69 @@ Test_NtGdiDoPalette_GdiPalAnimate(void) /* Test stock palette */ SetLastError(ERROR_SUCCESS); - RTEST(NtGdiDoPalette(GetStockObject(DEFAULT_PALETTE), 0, 1, palEntries, GdiPalAnimate, FALSE) == 0); - RTEST(GetLastError() == ERROR_SUCCESS); + ok_long(NtGdiDoPalette(GetStockObject(DEFAULT_PALETTE), 0, 1, palEntries, GdiPalAnimate, FALSE), 0); + ok_long(GetLastError(), ERROR_SUCCESS); /* Test pEntries = NULL */ hPal = CreateTestPalette(); - RTEST(NtGdiDoPalette(hPal, 0, 1, NULL, GdiPalAnimate, TRUE) == 0); - RTEST(NtGdiDoPalette(hPal, 0, 1, NULL, GdiPalAnimate, FALSE) == 0); + ok_long(NtGdiDoPalette(hPal, 0, 1, NULL, GdiPalAnimate, TRUE), 0); + ok_long(NtGdiDoPalette(hPal, 0, 1, NULL, GdiPalAnimate, FALSE), 0); DeleteObject(hPal); /* Test PC_RESERVED */ hPal = CreateTestPalette(); - RTEST(NtGdiDoPalette(hPal, 0, 5, palEntries, GdiPalAnimate, TRUE) == 2); + ok_long(NtGdiDoPalette(hPal, 0, 5, palEntries, GdiPalAnimate, TRUE), 2); DeleteObject(hPal); hPal = CreateTestPalette(); - RTEST(NtGdiDoPalette(hPal, 1, 5, palEntries, GdiPalAnimate, TRUE) == 2); + ok_long(NtGdiDoPalette(hPal, 1, 5, palEntries, GdiPalAnimate, TRUE), 2); DeleteObject(hPal); hPal = CreateTestPalette(); - RTEST(NtGdiDoPalette(hPal, 2, 5, palEntries, GdiPalAnimate, TRUE) == 1); + ok_long(NtGdiDoPalette(hPal, 2, 5, palEntries, GdiPalAnimate, TRUE), 1); DeleteObject(hPal); hPal = CreateTestPalette(); - RTEST(NtGdiDoPalette(hPal, 3, 5, palEntries, GdiPalAnimate, TRUE) == 1); + ok_long(NtGdiDoPalette(hPal, 3, 5, palEntries, GdiPalAnimate, TRUE), 1); DeleteObject(hPal); hPal = CreateTestPalette(); - RTEST(NtGdiDoPalette(hPal, 4, 5, palEntries, GdiPalAnimate, TRUE) == 0); + ok_long(NtGdiDoPalette(hPal, 4, 5, palEntries, GdiPalAnimate, TRUE), 0); DeleteObject(hPal); hPal = CreateTestPalette(); - RTEST(NtGdiDoPalette(hPal, 5, 5, palEntries, GdiPalAnimate, TRUE) == 0); + ok_long(NtGdiDoPalette(hPal, 5, 5, palEntries, GdiPalAnimate, TRUE), 0); DeleteObject(hPal); hPal = CreateTestPalette(); - RTEST(NtGdiDoPalette(hPal, 0, 5, palEntries, GdiPalAnimate, FALSE) == 2); + ok_long(NtGdiDoPalette(hPal, 0, 5, palEntries, GdiPalAnimate, FALSE), 2); DeleteObject(hPal); hPal = CreateTestPalette(); - RTEST(NtGdiDoPalette(hPal, 3, 5, palEntries, GdiPalAnimate, FALSE) == 1); + ok_long(NtGdiDoPalette(hPal, 3, 5, palEntries, GdiPalAnimate, FALSE), 1); DeleteObject(hPal); /* Test if entries are set correctly */ hPal = CreateTestPalette(); NtGdiDoPalette(hPal, 0, 5, palEntries, GdiPalAnimate, TRUE); NtGdiDoPalette(hPal, 0, 5, palEntries2, GdiPalGetEntries, FALSE); - RTEST(palEntries2[0].peRed == 1); - RTEST(palEntries2[0].peGreen == 2); - RTEST(palEntries2[0].peBlue == 3); - RTEST(palEntries2[0].peFlags == 0); - RTEST(palEntries2[1].peRed == palEntries[1].peRed); - RTEST(palEntries2[1].peGreen == palEntries[1].peGreen); - RTEST(palEntries2[1].peBlue == palEntries[1].peBlue); - RTEST(palEntries2[1].peFlags == palEntries[1].peFlags); - RTEST(palEntries2[2].peRed == 11); - RTEST(palEntries2[2].peGreen == 55); - RTEST(palEntries2[2].peBlue == 77); - TEST(palEntries2[2].peFlags == PC_EXPLICIT); - RTEST(palEntries2[3].peRed == palEntries[3].peRed); - RTEST(palEntries2[3].peGreen == palEntries[3].peGreen); - RTEST(palEntries2[3].peBlue == palEntries[3].peBlue); - RTEST(palEntries2[3].peFlags == palEntries[3].peFlags); + ok_int(palEntries2[0].peRed, 1); + ok_int(palEntries2[0].peGreen, 2); + ok_int(palEntries2[0].peBlue, 3); + ok_int(palEntries2[0].peFlags, 0); + ok_int(palEntries2[1].peRed, palEntries[1].peRed); + ok_int(palEntries2[1].peGreen, palEntries[1].peGreen); + ok_int(palEntries2[1].peBlue, palEntries[1].peBlue); + ok_int(palEntries2[1].peFlags, palEntries[1].peFlags); + ok_int(palEntries2[2].peRed, 11); + ok_int(palEntries2[2].peGreen, 55); + ok_int(palEntries2[2].peBlue, 77); + ok_int(palEntries2[2].peFlags, PC_EXPLICIT); + ok_int(palEntries2[3].peRed, palEntries[3].peRed); + ok_int(palEntries2[3].peGreen, palEntries[3].peGreen); + ok_int(palEntries2[3].peBlue, palEntries[3].peBlue); + ok_int(palEntries2[3].peFlags, palEntries[3].peFlags); DeleteObject(hPal); } @@ -123,44 +123,44 @@ Test_NtGdiDoPalette_GdiPalSetEntries(void) /* Test invalid handle */ SetLastError(ERROR_SUCCESS); - RTEST(NtGdiDoPalette((HPALETTE)23, 0, 1, palEntries, GdiPalSetEntries, TRUE) == 0); - RTEST(GetLastError() == ERROR_SUCCESS); + ok_long(NtGdiDoPalette((HPALETTE)23, 0, 1, palEntries, GdiPalSetEntries, TRUE), 0); + ok_long(GetLastError(), ERROR_SUCCESS); /* Test system palette */ - RTEST(NtGdiDoPalette(GetStockObject(DEFAULT_PALETTE), 0, 1, palEntries, GdiPalSetEntries, TRUE) == 0); - RTEST(GetLastError() == ERROR_SUCCESS); - - RTEST(NtGdiDoPalette(hPal, 0, 1, palEntries, GdiPalSetEntries, TRUE) == 1); - RTEST(NtGdiDoPalette(hPal, 0, 2, palEntries, GdiPalSetEntries, TRUE) == 2); - RTEST(NtGdiDoPalette(hPal, 0, 3, palEntries, GdiPalSetEntries, TRUE) == 3); - RTEST(NtGdiDoPalette(hPal, 0, 5, palEntries, GdiPalSetEntries, TRUE) == 5); - RTEST(NtGdiDoPalette(hPal, 0, 6, palEntries, GdiPalSetEntries, TRUE) == 5); - RTEST(NtGdiDoPalette(hPal, 3, 6, palEntries, GdiPalSetEntries, TRUE) == 2); -// TEST(NtGdiDoPalette(hPal, 4, 23247, palEntries, GdiPalSetEntries, TRUE) == 0); - - /* Test bInbound == FALSE */ + ok_long(NtGdiDoPalette(GetStockObject(DEFAULT_PALETTE), 0, 1, palEntries, GdiPalSetEntries, TRUE), 0); + ok_long(GetLastError(), ERROR_SUCCESS); + + ok_long(NtGdiDoPalette(hPal, 0, 1, palEntries, GdiPalSetEntries, TRUE), 1); + ok_long(NtGdiDoPalette(hPal, 0, 2, palEntries, GdiPalSetEntries, TRUE), 2); + ok_long(NtGdiDoPalette(hPal, 0, 3, palEntries, GdiPalSetEntries, TRUE), 3); + ok_long(NtGdiDoPalette(hPal, 0, 5, palEntries, GdiPalSetEntries, TRUE), 5); + ok_long(NtGdiDoPalette(hPal, 0, 6, palEntries, GdiPalSetEntries, TRUE), 5); + ok_long(NtGdiDoPalette(hPal, 3, 6, palEntries, GdiPalSetEntries, TRUE), 2); +// TEST(NtGdiDoPalette(hPal, 4, 23247, palEntries, GdiPalSetEntries, TRUE), 0); + + /* Test bInbound, FALSE */ NtGdiDoPalette(hPal, 0, 5, palEntries, GdiPalSetEntries, TRUE); ZeroMemory(palEntries2, sizeof(palEntries2)); - RTEST(NtGdiDoPalette(hPal, 0, 5, palEntries2, GdiPalSetEntries, FALSE) == 5); + ok_long(NtGdiDoPalette(hPal, 0, 5, palEntries2, GdiPalSetEntries, FALSE), 5); /* we should get the old values returned in our buffer! */ - TEST(memcmp(palEntries2, palEntries, sizeof(palEntries)) == 0); + ok_int(memcmp(palEntries2, palEntries, sizeof(palEntries)), 0); /* check what we have in our palette now */ ZeroMemory(palEntries2, sizeof(palEntries2)); - RTEST(NtGdiDoPalette(hPal, 0, 5, palEntries2, GdiPalGetEntries, FALSE) == 5); - TEST(memcmp(palEntries2, palEntries, sizeof(palEntries)) == 0); + ok_long(NtGdiDoPalette(hPal, 0, 5, palEntries2, GdiPalGetEntries, FALSE), 5); + ok_int(memcmp(palEntries2, palEntries, sizeof(palEntries)), 0); - RTEST(NtGdiDoPalette(hPal, 0, 4, palEntries2, GdiPalSetEntries, TRUE) == 4); - RTEST(GetLastError() == ERROR_SUCCESS); + ok_long(NtGdiDoPalette(hPal, 0, 4, palEntries2, GdiPalSetEntries, TRUE), 4); + ok_long(GetLastError(), ERROR_SUCCESS); /* Test if entries are set correctly */ hPal = CreateTestPalette(); NtGdiDoPalette(hPal, 0, 5, palEntries, GdiPalSetEntries, TRUE); NtGdiDoPalette(hPal, 0, 5, palEntries2, GdiPalGetEntries, FALSE); - RTEST(palEntries2[0].peRed == 0); - RTEST(palEntries2[0].peGreen == 0); - RTEST(palEntries2[0].peBlue == 0); - RTEST(palEntries2[0].peFlags == 0); + ok_int(palEntries2[0].peRed, 0); + ok_int(palEntries2[0].peGreen, 0); + ok_int(palEntries2[0].peBlue, 0); + ok_int(palEntries2[0].peFlags, 0); /* Test that the buffer was not changed */ @@ -168,11 +168,11 @@ Test_NtGdiDoPalette_GdiPalSetEntries(void) /* Test with palette selected into dc */ hDC = CreateCompatibleDC(NULL); hOldPal = SelectPalette(hDC, hPal, 0); - RTEST(NtGdiDoPalette(hPal, 0, 4, palEntries, GdiPalSetEntries, TRUE) == 4); + ok_long(NtGdiDoPalette(hPal, 0, 4, palEntries, GdiPalSetEntries, TRUE), 4); SelectPalette(hDC, hOldPal, 0); /* Test pEntries = NULL */ - RTEST(NtGdiDoPalette(hPal, 0, 1, NULL, GdiPalGetEntries, TRUE) == 0); + ok_long(NtGdiDoPalette(hPal, 0, 1, NULL, GdiPalGetEntries, TRUE), 0); } @@ -184,12 +184,12 @@ Test_NtGdiDoPalette_GdiPalGetEntries(void) hPal = CreateTestPalette(); /* Test pEntries = NULL */ - RTEST(NtGdiDoPalette(hPal, 0, 1, NULL, GdiPalGetEntries, TRUE) == 0); - RTEST(NtGdiDoPalette(hPal, 0, 1, NULL, GdiPalGetEntries, FALSE) == 5); - RTEST(NtGdiDoPalette(hPal, 2, 1, NULL, GdiPalGetEntries, FALSE) == 5); - RTEST(NtGdiDoPalette(hPal, 20, 1, NULL, GdiPalGetEntries, FALSE) == 5); - RTEST(NtGdiDoPalette(hPal, -20, 1, NULL, GdiPalGetEntries, FALSE) == 5); - RTEST(NtGdiDoPalette(hPal, 2, 0, NULL, GdiPalGetEntries, FALSE) == 5); + ok_long(NtGdiDoPalette(hPal, 0, 1, NULL, GdiPalGetEntries, TRUE), 0); + ok_long(NtGdiDoPalette(hPal, 0, 1, NULL, GdiPalGetEntries, FALSE), 5); + ok_long(NtGdiDoPalette(hPal, 2, 1, NULL, GdiPalGetEntries, FALSE), 5); + ok_long(NtGdiDoPalette(hPal, 20, 1, NULL, GdiPalGetEntries, FALSE), 5); + ok_long(NtGdiDoPalette(hPal, -20, 1, NULL, GdiPalGetEntries, FALSE), 5); + ok_long(NtGdiDoPalette(hPal, 2, 0, NULL, GdiPalGetEntries, FALSE), 5); // Test flags 0xf0 @@ -222,7 +222,7 @@ Test_NtGdiDoPalette_SetDIBColorTable(void) } bmi; hdc = CreateCompatibleDC(0); - ASSERT(hdc != NULL); + ok(hdc != NULL, "hdc was NULL.\n"); bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmi.bmiHeader.biWidth = 10; @@ -245,12 +245,11 @@ Test_NtGdiDoPalette_SetDIBColorTable(void) bmi.bmiColors[7] = 0xE0E0E0; bmi.bmiColors[8] = 0xffffff; hbmp = CreateDIBSection(hdc, (BITMAPINFO*)&bmi, DIB_PAL_COLORS, (PVOID*)&pjBits, NULL, 0); - ASSERT(hbmp); - ASSERT(pjBits); + ok(hbmp != NULL, "hbmp was NULL.\n"); + ok(pjBits != NULL, "pjBits was NULL.\n"); SelectObject(hdc, hbmp); - pjBits[0] = 8; pjBits[1] = 1; pjBits[2] = 2; @@ -265,7 +264,7 @@ Test_NtGdiDoPalette_SetDIBColorTable(void) bmi.bmiColors[2] = 0xC0C0C0; bmi.bmiColors[1] = 0xE0E0E0; bmi.bmiColors[0] = 0xffffff; - TEST(NtGdiDoPalette(hdc, 0, 9, &bmi.bmiColors, GdiPalSetColorTable, FALSE) == 9); + ok_long(NtGdiDoPalette(hdc, 0, 9, &bmi.bmiColors, GdiPalSetColorTable, FALSE), 9); SetDCPenColor(hdc, 0xE0E0E0); SetDCBrushColor(hdc, 0x202020); @@ -275,7 +274,6 @@ Test_NtGdiDoPalette_SetDIBColorTable(void) DeleteObject(hbmp); } - START_TEST(NtGdiDoPalette) { Test_NtGdiDoPalette_GdiPalAnimate(); @@ -284,5 +282,4 @@ START_TEST(NtGdiDoPalette) Test_NtGdiDoPalette_GetSystemPalette(); Test_NtGdiDoPalette_GetBIBColorTable(); Test_NtGdiDoPalette_SetDIBColorTable(); - }
6 years
1
0
0
0
[reactos] 01/01: [APITESTS][WIN32KNT_APITEST] Improve NtGdiDeleteObjectApp testcase (#1282)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7c847f26e7a660b7faaa3…
commit 7c847f26e7a660b7faaa3a7345eb5815a4cc3ec2 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Jan 22 21:17:58 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Jan 22 21:17:58 2019 +0900 [APITESTS][WIN32KNT_APITEST] Improve NtGdiDeleteObjectApp testcase (#1282) Use ok, ok_int and ok_long macros instead of obsolete TEST macros. --- .../apitests/win32nt/ntgdi/NtGdiDeleteObjectApp.c | 108 ++++++++++----------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiDeleteObjectApp.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiDeleteObjectApp.c index 99fb9bcb41..fcc4041eb8 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiDeleteObjectApp.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiDeleteObjectApp.c @@ -16,108 +16,108 @@ START_TEST(NtGdiDeleteObjectApp) /* Try to delete 0 */ SetLastError(0); - TEST(NtGdiDeleteObjectApp(0) == 0); - TEST(GetLastError() == 0); + ok_int(NtGdiDeleteObjectApp(0), 0); + ok_long(GetLastError(), 0); /* Try to delete something with a stockbit */ SetLastError(0); - TEST(NtGdiDeleteObjectApp((PVOID)(GDI_HANDLE_STOCK_MASK | 0x1234)) == 1); - TEST(GetLastError() == 0); + ok_int(NtGdiDeleteObjectApp((PVOID)(GDI_HANDLE_STOCK_MASK | 0x1234)), 1); + ok_long(GetLastError(), 0); /* Delete a compatible DC */ SetLastError(0); hdc = CreateCompatibleDC(NULL); - ASSERT(GdiIsHandleValid(hdc) == 1); - TEST(NtGdiDeleteObjectApp(hdc) == 1); - TEST(GetLastError() == 0); - TEST(GdiIsHandleValid(hdc) == 0); + ok_int(GdiIsHandleValid(hdc), 1); + ok_int(NtGdiDeleteObjectApp(hdc), 1); + ok_long(GetLastError(), 0); + ok_int(GdiIsHandleValid(hdc), 0); /* Delete a display DC */ SetLastError(0); hdc = CreateDC("DISPLAY", NULL, NULL, NULL); - ASSERT(GdiIsHandleValid(hdc) == 1); - TEST((hpen=SelectObject(hdc, GetStockObject(WHITE_PEN))) != NULL); + ok_int(GdiIsHandleValid(hdc), 1); + ok((hpen=SelectObject(hdc, GetStockObject(WHITE_PEN))) != NULL, "hpen was NULL.\n"); SelectObject(hdc, hpen); - TEST(NtGdiDeleteObjectApp(hdc) != 0); - TEST(GetLastError() == 0); - TEST(GdiIsHandleValid(hdc) == 1); - TEST(SelectObject(hdc, GetStockObject(WHITE_PEN)) == NULL); - TESTX(GetLastError() == ERROR_INVALID_PARAMETER, "GetLasterror returned 0x%08x\n", (unsigned int)GetLastError()); + ok(NtGdiDeleteObjectApp(hdc) != 0, "NtGdiDeleteObjectApp(hdc) was zero.\n"); + ok_long(GetLastError(), 0); + ok_int(GdiIsHandleValid(hdc), 1); + ok_ptr(SelectObject(hdc, GetStockObject(WHITE_PEN)), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Once more */ SetLastError(0); hdc = GetDC(0); - ASSERT(GdiIsHandleValid(hdc) == 1); - TEST(NtGdiDeleteObjectApp(hdc) != 0); - TEST(GetLastError() == 0); - TEST(GdiIsHandleValid(hdc) == 1); - TEST(SelectObject(hdc, GetStockObject(WHITE_PEN)) == NULL); - TESTX(GetLastError() == ERROR_INVALID_PARAMETER, "GetLasterror returned 0x%08x\n", (unsigned int)GetLastError()); + ok_int(GdiIsHandleValid(hdc), 1); + ok(NtGdiDeleteObjectApp(hdc) != 0, "NtGdiDeleteObjectApp(hdc) was zero.\n"); + ok_long(GetLastError(), 0); + ok_int(GdiIsHandleValid(hdc), 1); + ok_ptr(SelectObject(hdc, GetStockObject(WHITE_PEN)), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Make sure */ - TEST(NtUserCallOneParam((DWORD_PTR)hdc, ONEPARAM_ROUTINE_RELEASEDC) == 0); + ok_ptr((void *)NtUserCallOneParam((DWORD_PTR)hdc, ONEPARAM_ROUTINE_RELEASEDC), NULL); /* Delete a brush */ SetLastError(0); hbrush = CreateSolidBrush(0x123456); - ASSERT(GdiIsHandleValid(hbrush) == 1); - TEST(NtGdiDeleteObjectApp(hbrush) == 1); - TEST(GetLastError() == 0); - TEST(GdiIsHandleValid(hbrush) == 0); + ok_int(GdiIsHandleValid(hbrush), 1); + ok_int(NtGdiDeleteObjectApp(hbrush), 1); + ok_long(GetLastError(), 0); + ok_int(GdiIsHandleValid(hbrush), 0); /* Try to delete a stock brush */ SetLastError(0); hbrush = GetStockObject(BLACK_BRUSH); - ASSERT(GdiIsHandleValid(hbrush) == 1); - TEST(NtGdiDeleteObjectApp(hbrush) == 1); - TEST(GetLastError() == 0); - TEST(GdiIsHandleValid(hbrush) == 1); + ok_int(GdiIsHandleValid(hbrush), 1); + ok_int(NtGdiDeleteObjectApp(hbrush), 1); + ok_long(GetLastError(), 0); + ok_int(GdiIsHandleValid(hbrush), 1); /* Delete a bitmap */ SetLastError(0); hbmp = CreateBitmap(10, 10, 1, 1, NULL); - ASSERT(GdiIsHandleValid(hbmp) == 1); - TEST(NtGdiDeleteObjectApp(hbmp) == 1); - TEST(GetLastError() == 0); - TEST(GdiIsHandleValid(hbmp) == 0); + ok_int(GdiIsHandleValid(hbmp), 1); + ok_int(NtGdiDeleteObjectApp(hbmp), 1); + ok_long(GetLastError(), 0); + ok_int(GdiIsHandleValid(hbmp), 0); /* Create a DC for further use */ hdc = CreateCompatibleDC(NULL); - ASSERT(hdc); + ok(hdc != NULL, "hdc was NULL.\n"); /* Try to delete a brush that is selected into a DC */ SetLastError(0); hbrush = CreateSolidBrush(0x123456); - ASSERT(GdiIsHandleValid(hbrush) == 1); - TEST(NtGdiSelectBrush(hdc, hbrush) != NULL); - TEST(NtGdiDeleteObjectApp(hbrush) == 1); - TEST(GetLastError() == 0); - TEST(GdiIsHandleValid(hbrush) == 1); + ok_int(GdiIsHandleValid(hbrush), 1); + ok(NtGdiSelectBrush(hdc, hbrush) != NULL, "NtGdiSelectBrush(hdc, hbrush) was NULL.\n"); + ok_int(NtGdiDeleteObjectApp(hbrush), 1); + ok_long(GetLastError(), 0); + ok_int(GdiIsHandleValid(hbrush), 1); /* Try to delete a bitmap that is selected into a DC */ SetLastError(0); hbmp = CreateBitmap(10, 10, 1, 1, NULL); - ASSERT(GdiIsHandleValid(hbmp) == 1); - TEST(NtGdiSelectBitmap(hdc, hbmp) != NULL); + ok_int(GdiIsHandleValid(hbmp), 1); + ok(NtGdiSelectBitmap(hdc, hbmp) != NULL, "NtGdiSelectBitmap(hdc, hbmp) was NULL.\n"); - TEST(NtGdiDeleteObjectApp(hbmp) == 1); - TEST(GetLastError() == 0); - TEST(GdiIsHandleValid(hbmp) == 1); + ok_int(NtGdiDeleteObjectApp(hbmp), 1); + ok_long(GetLastError(), 0); + ok_int(GdiIsHandleValid(hbmp), 1); /* Bitmap get's deleted as soon as we dereference it */ NtGdiSelectBitmap(hdc, GetStockObject(DEFAULT_BITMAP)); - TEST(GdiIsHandleValid(hbmp) == 0); + ok_int(GdiIsHandleValid(hbmp), 0); - TEST(NtGdiDeleteObjectApp(hbmp) == 1); - TEST(GetLastError() == 0); - TEST(GdiIsHandleValid(hbmp) == 0); + ok_int(NtGdiDeleteObjectApp(hbmp), 1); + ok_long(GetLastError(), 0); + ok_int(GdiIsHandleValid(hbmp), 0); /* Try to delete a brush that is selected into a DC */ SetLastError(0); hbrush = CreateSolidBrush(123); - ASSERT(GdiIsHandleValid(hbrush) == 1); - TEST(NtGdiSelectBrush(hdc, hbrush) != NULL); + ok_int(GdiIsHandleValid(hbrush), 1); + ok(NtGdiSelectBrush(hdc, hbrush) != NULL, "NtGdiSelectBrush(hdc, hbrush) was NULL.\n"); - TEST(NtGdiDeleteObjectApp(hbrush) == 1); - TEST(GetLastError() == 0); - TEST(GdiIsHandleValid(hbrush) == 1); + ok_int(NtGdiDeleteObjectApp(hbrush), 1); + ok_long(GetLastError(), 0); + ok_int(GdiIsHandleValid(hbrush), 1); }
6 years
1
0
0
0
[reactos] 01/01: [APITESTS][WIN32KNT_APITEST] Improve NtGdiGetFontResourceInfoInternalW testcase (#1290)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8fa1a24edce971bfce455…
commit 8fa1a24edce971bfce4551e16fcdb987566f7db3 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Jan 22 21:12:19 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Jan 22 21:12:19 2019 +0900 [APITESTS][WIN32KNT_APITEST] Improve NtGdiGetFontResourceInfoInternalW testcase (#1290) Use ok macro instead of obsolete TEST macro. --- .../apitests/win32nt/ntgdi/NtGdiGetFontResourceInfoInternalW.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiGetFontResourceInfoInternalW.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiGetFontResourceInfoInternalW.c index 35541c78d4..0eae92cd22 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiGetFontResourceInfoInternalW.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiGetFontResourceInfoInternalW.c @@ -31,7 +31,7 @@ START_TEST(NtGdiGetFontResourceInfoInternalW) &logfont, 2); - TEST(bRet != FALSE); + ok(bRet != FALSE, "bRet was not FALSE.\n"); printf("lfHeight = %ld\n", logfont.lfHeight); printf("lfWidth = %ld\n", logfont.lfWidth); @@ -40,4 +40,3 @@ START_TEST(NtGdiGetFontResourceInfoInternalW) // RemoveFontResourceW(szFullFileName); } -
6 years
1
0
0
0
[reactos] 01/01: [APITESTS][WIN32KNT_APITEST] Improve NtGdiExtTextOutW testcase (#1286)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=377734c9eca6af3ec4973…
commit 377734c9eca6af3ec4973f2543ccc4056508fd72 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Jan 22 21:11:26 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Jan 22 21:11:26 2019 +0900 [APITESTS][WIN32KNT_APITEST] Improve NtGdiExtTextOutW testcase (#1286) Use ok_int macros instead of obsolete TEST macros. --- modules/rostests/apitests/win32nt/ntgdi/NtGdiExtTextOutW.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiExtTextOutW.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiExtTextOutW.c index 44d0b67430..ef25e81ed0 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiExtTextOutW.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiExtTextOutW.c @@ -43,18 +43,16 @@ START_TEST(NtGdiExtTextOutW) len = wcslen(lpstr); ret = NtGdiExtTextOutW(hDC, 0, 0, 0, &rect, lpstr, len, Dx, 0); - TEST(ret == 1); + ok_int(ret, 1); ret = NtGdiExtTextOutW(hDC, 0, 0, ETO_PDY, &rect, lpstr, len, Dx, 0); - TEST(ret == 1); + ok_int(ret, 1); /* Test invalid lpDx */ ret = NtGdiExtTextOutW(hDC, 0, 0, 0, 0, lpstr, len, (INT*)((ULONG_PTR)-1), 0); - TEST(ret == 0); + ok_int(ret, 0); /* Test alignment requirement for lpDx */ ret = NtGdiExtTextOutW(hDC, 0, 0, 0, 0, lpstr, len, (INT*)((ULONG_PTR)Dx + 1), 0); - TEST(ret == 1); - + ok_int(ret, 1); } -
6 years
1
0
0
0
[reactos] 01/01: [APITESTS][WIN32KNT_APITEST] Improve NtGdiFlushUserBatch testcase (#1287)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1a591cbdfa75b84e21ade…
commit 1a591cbdfa75b84e21adee614755fd6ea44b53b6 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Jan 22 21:10:22 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Jan 22 21:10:22 2019 +0900 [APITESTS][WIN32KNT_APITEST] Improve NtGdiFlushUserBatch testcase (#1287) Use ok, ok_int, ok_long, and ok_ptr macros instead of TEST and ASSERT macros. --- .../apitests/win32nt/ntgdi/NtGdiFlushUserBatch.c | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiFlushUserBatch.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiFlushUserBatch.c index b799078a53..842e50ba3c 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiFlushUserBatch.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiFlushUserBatch.c @@ -21,16 +21,16 @@ START_TEST(NtGdiFlushUserBatch) return APISTATUS_NOT_FOUND; pTeb = NtCurrentTeb(); - ASSERT(pTeb); + ok(pTeb != NULL, "pTeb was NULL.\n"); pRet = (PVOID)pNtGdiFlushUserBatch(); - TEST(pRet != 0); - TEST(pRet == &pTeb->RealClientId); + ok(pRet != NULL, "pRet was NULL.\n"); + ok_ptr(pRet, &pTeb->RealClientId); - TEST(pTeb->GdiBatchCount == 0); - TEST(pTeb->GdiTebBatch.Offset == 0); - TEST(pTeb->GdiTebBatch.HDC == 0); + ok_long(pTeb->GdiBatchCount, 0); + ok_long(pTeb->GdiTebBatch.Offset, 0); + ok_ptr(pTeb->GdiTebBatch.HDC, NULL); /* Set up some bullshit */ pTeb->InDbgPrint = 1; @@ -39,11 +39,10 @@ START_TEST(NtGdiFlushUserBatch) pTeb->GdiTebBatch.HDC = (HDC)123; pRet = (PVOID)pNtGdiFlushUserBatch(); - TEST(pRet == &pTeb->RealClientId); - - TEST(pTeb->InDbgPrint == 0); - TEST(pTeb->GdiBatchCount == 12); - TEST(pTeb->GdiTebBatch.Offset == 0); - TEST(pTeb->GdiTebBatch.HDC == 0); + ok_ptr(pRet, &pTeb->RealClientId); + ok_int(pTeb->InDbgPrint, 0); + ok_long(pTeb->GdiBatchCount, 12); + ok_long(pTeb->GdiTebBatch.Offset, 0); + ok_ptr(pTeb->GdiTebBatch.HDC, NULL); }
6 years
1
0
0
0
[reactos] 01/01: [APITESTS][WIN32KNT_APITEST] Improve NtGdiGetRandomRgn testcase (#1293)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b8ca99fad5bd49c4bfd1b…
commit b8ca99fad5bd49c4bfd1b0a8eae8f65b07cc0f27 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Jan 22 21:07:18 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Jan 22 21:07:18 2019 +0900 [APITESTS][WIN32KNT_APITEST] Improve NtGdiGetRandomRgn testcase (#1293) Use ok_int and ok_long macros instead of obsolete TEST and RTEST macros. --- .../apitests/win32nt/ntgdi/NtGdiGetRandomRgn.c | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiGetRandomRgn.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiGetRandomRgn.c index 63f4d397c4..1833fdbcd2 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiGetRandomRgn.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiGetRandomRgn.c @@ -21,66 +21,66 @@ START_TEST(NtGdiGetRandomRgn) // UpdateWindow(hWnd); hDC = GetDC(hWnd); - ASSERT(hDC != NULL); + ok(hDC != NULL, "hDC was NULL.\n"); hrgn = CreateRectRgn(0,0,0,0); hrgn2 = CreateRectRgn(3,3,10,10); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetRandomRgn(0, hrgn, 0) == -1); - RTEST(GetLastError() == ERROR_INVALID_HANDLE); + ok_int(NtGdiGetRandomRgn(0, hrgn, 0), -1); + ok_long(GetLastError(), ERROR_INVALID_HANDLE); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetRandomRgn((HDC)2345, hrgn, 1) == -1); - RTEST(GetLastError() == ERROR_INVALID_HANDLE); + ok_int(NtGdiGetRandomRgn((HDC)2345, hrgn, 1), -1); + ok_long(GetLastError(), ERROR_INVALID_HANDLE); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetRandomRgn((HDC)2345, hrgn, 10) == -1); - RTEST(GetLastError() == ERROR_INVALID_HANDLE); + ok_int(NtGdiGetRandomRgn((HDC)2345, hrgn, 10), -1); + ok_long(GetLastError(), ERROR_INVALID_HANDLE); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetRandomRgn((HDC)2345, (HRGN)10, 10) == -1); - RTEST(GetLastError() == ERROR_INVALID_HANDLE); + ok_int(NtGdiGetRandomRgn((HDC)2345, (HRGN)10, 10), -1); + ok_long(GetLastError(), ERROR_INVALID_HANDLE); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetRandomRgn((HDC)2345, 0, 1) == -1); - RTEST(GetLastError() == ERROR_INVALID_HANDLE); + ok_int(NtGdiGetRandomRgn((HDC)2345, 0, 1), -1); + ok_long(GetLastError(), ERROR_INVALID_HANDLE); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetRandomRgn(hDC, 0, 0) == 0); - RTEST(NtGdiGetRandomRgn(hDC, 0, 1) == 0); - RTEST(NtGdiGetRandomRgn(hDC, (HRGN)-5, 0) == 0); - RTEST(NtGdiGetRandomRgn(hDC, (HRGN)-5, 1) == 0); - RTEST(NtGdiGetRandomRgn(hDC, hrgn, 0) == 0); - RTEST(NtGdiGetRandomRgn(hDC, hrgn, 1) == 0); - TEST(NtGdiGetRandomRgn(hDC, hrgn, 2) == 0); - RTEST(NtGdiGetRandomRgn(hDC, hrgn, 3) == 0); - RTEST(NtGdiGetRandomRgn(hDC, hrgn, 4) == 1); - RTEST(NtGdiGetRandomRgn(hDC, hrgn, 5) == 0); - RTEST(NtGdiGetRandomRgn(hDC, hrgn, 10) == 0); - RTEST(NtGdiGetRandomRgn(hDC, hrgn, -10) == 0); - RTEST(GetLastError() == ERROR_SUCCESS); + ok_int(NtGdiGetRandomRgn(hDC, 0, 0), 0); + ok_int(NtGdiGetRandomRgn(hDC, 0, 1), 0); + ok_int(NtGdiGetRandomRgn(hDC, (HRGN)-5, 0), 0); + ok_int(NtGdiGetRandomRgn(hDC, (HRGN)-5, 1), 0); + ok_int(NtGdiGetRandomRgn(hDC, hrgn, 0), 0); + ok_int(NtGdiGetRandomRgn(hDC, hrgn, 1), 0); + ok_int(NtGdiGetRandomRgn(hDC, hrgn, 2), 0); + ok_int(NtGdiGetRandomRgn(hDC, hrgn, 3), 0); + ok_int(NtGdiGetRandomRgn(hDC, hrgn, 4), 1); + ok_int(NtGdiGetRandomRgn(hDC, hrgn, 5), 0); + ok_int(NtGdiGetRandomRgn(hDC, hrgn, 10), 0); + ok_int(NtGdiGetRandomRgn(hDC, hrgn, -10), 0); + ok_long(GetLastError(), ERROR_SUCCESS); SelectClipRgn(hDC, hrgn2); - RTEST(NtGdiGetRandomRgn(hDC, 0, 1) == -1); - RTEST(GetLastError() == ERROR_SUCCESS); - RTEST(NtGdiGetRandomRgn(hDC, hrgn, 1) == 1); - RTEST(CombineRgn(hrgn, hrgn, hrgn, RGN_OR) == SIMPLEREGION); - RTEST(CombineRgn(hrgn, hrgn, hrgn2, RGN_XOR) == NULLREGION); + ok_int(NtGdiGetRandomRgn(hDC, 0, 1), -1); + ok_long(GetLastError(), ERROR_SUCCESS); + ok_int(NtGdiGetRandomRgn(hDC, hrgn, 1), 1); + ok_int(CombineRgn(hrgn, hrgn, hrgn, RGN_OR), SIMPLEREGION); + ok_int(CombineRgn(hrgn, hrgn, hrgn2, RGN_XOR), NULLREGION); SetRectRgn(hrgn2,0,0,0,0); SelectClipRgn(hDC, hrgn2); - RTEST(NtGdiGetRandomRgn(hDC, hrgn, 1) == 1); + ok_int(NtGdiGetRandomRgn(hDC, hrgn, 1), 1); - RTEST(CombineRgn(hrgn2, hrgn, hrgn2, RGN_XOR) == NULLREGION); - RTEST(CombineRgn(hrgn2, hrgn, hrgn, RGN_OR) == NULLREGION); + ok_int(CombineRgn(hrgn2, hrgn, hrgn2, RGN_XOR), NULLREGION); + ok_int(CombineRgn(hrgn2, hrgn, hrgn, RGN_OR), NULLREGION); SelectClipRgn(hDC, NULL); - RTEST(NtGdiGetRandomRgn(hDC, hrgn, 1) == 0); + ok_int(NtGdiGetRandomRgn(hDC, hrgn, 1), 0); - RTEST(NtGdiGetRandomRgn(hDC, hrgn, 4) == 1); + ok_int(NtGdiGetRandomRgn(hDC, hrgn, 4), 1); - RTEST(GetLastError() == ERROR_SUCCESS); + ok_long(GetLastError(), ERROR_SUCCESS); ReleaseDC(hWnd, hDC); DestroyWindow(hWnd);
6 years
1
0
0
0
[reactos] 01/01: [APITESTS][WIN32KNT_APITEST] Improve NtGdiGetDIBits testcase (#1289)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7123914694528ded7955d…
commit 7123914694528ded7955d781046a69c2d1a78dbe Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Jan 22 21:06:00 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Jan 22 21:06:00 2019 +0900 [APITESTS][WIN32KNT_APITEST] Improve NtGdiGetDIBits testcase (#1289) Use ok, ok_int and ok_long macros instead of obsolete RTEST and ASSERT macros. --- .../apitests/win32nt/ntgdi/NtGdiGetDIBits.c | 76 +++++++++++----------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiGetDIBits.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiGetDIBits.c index 596bdcc579..f8c45dda4e 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiGetDIBits.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiGetDIBits.c @@ -45,66 +45,68 @@ START_TEST(NtGdiGetDIBitsInternal) DWORD data[20*16]; HDC hDCScreen = GetDC(NULL); - ASSERT(hDCScreen != NULL); + ok(hDCScreen != NULL, "hDCScreen was NULL.\n"); hBitmap = CreateCompatibleBitmap(hDCScreen, 16, 16); - ASSERT(hBitmap != NULL); + ok(hBitmap != NULL, "hBitmap was NULL.\n"); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetDIBitsInternal(0, 0, 0, 0, NULL, NULL, 0, 0, 0) == 0); - RTEST(GetLastError() == ERROR_SUCCESS); + ok_int(NtGdiGetDIBitsInternal(0, 0, 0, 0, NULL, NULL, 0, 0, 0), 0); + ok_long(GetLastError(), ERROR_SUCCESS); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetDIBitsInternal((HDC)2345, 0, 0, 0, NULL, NULL, 0, 0, 0) == 0); - RTEST(GetLastError() == ERROR_SUCCESS); + ok_int(NtGdiGetDIBitsInternal((HDC)2345, 0, 0, 0, NULL, NULL, 0, 0, 0), 0); + ok_long(GetLastError(), ERROR_SUCCESS); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetDIBitsInternal((HDC)2345, hBitmap, 0, 0, NULL, NULL, 0, 0, 0) == 0); - RTEST(GetLastError() == ERROR_SUCCESS); + ok_int(NtGdiGetDIBitsInternal((HDC)2345, hBitmap, 0, 0, NULL, NULL, 0, 0, 0), 0); + ok_long(GetLastError(), ERROR_SUCCESS); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetDIBitsInternal(hDCScreen, hBitmap, 0, 0, NULL, NULL, 0, 0, 0) == 0); - RTEST(GetLastError() == ERROR_SUCCESS); + ok_int(NtGdiGetDIBitsInternal(hDCScreen, hBitmap, 0, 0, NULL, NULL, 0, 0, 0), 0); + ok_long(GetLastError(), ERROR_SUCCESS); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetDIBitsInternal(hDCScreen, hBitmap, 0, 15, NULL, NULL, 0, 0, 0) == 0); - RTEST(GetLastError() == ERROR_SUCCESS); + ok_int(NtGdiGetDIBitsInternal(hDCScreen, hBitmap, 0, 15, NULL, NULL, 0, 0, 0), 0); + ok_long(GetLastError(), ERROR_SUCCESS); ZeroMemory(&bmp, sizeof(bmp)); bmp.bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); FillMemory(&bmp.Colors, sizeof(bmp.Colors), 0x44); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetDIBitsInternal((HDC)0, hBitmap, 0, 15, NULL, &bmp.bi, 0, 0, 0) > 0); - RTEST(GetLastError() == ERROR_SUCCESS); - TEST(bmp.Colors[0].rgbRed == 0x44); + ok(NtGdiGetDIBitsInternal((HDC)0, hBitmap, 0, 15, NULL, &bmp.bi, 0, 0, 0) > 0, + "NtGdiGetDIBitsInternal((HDC)0, hBitmap, 0, 15, NULL, &bmp.bi, 0, 0, 0) <= 0.\n"); + ok_long(GetLastError(), ERROR_SUCCESS); + ok_int(bmp.Colors[0].rgbRed, 0x44); ZeroMemory(&bmp, sizeof(bmp)); bmp.bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); FillMemory(&bmp.Colors, sizeof(bmp.Colors), 0x44); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetDIBitsInternal((HDC)2345, hBitmap, 0, 15, NULL, &bmp.bi, 0, 0, 0) > 0); - RTEST(GetLastError() == ERROR_SUCCESS); - TEST(bmp.Colors[0].rgbRed == 0x44); + ok(NtGdiGetDIBitsInternal((HDC)2345, hBitmap, 0, 15, NULL, &bmp.bi, 0, 0, 0) > 0, + "The return value was <= 0.\n"); + ok_long(GetLastError(), ERROR_SUCCESS); + ok_int(bmp.Colors[0].rgbRed, 0x44); ZeroMemory(&bmp, sizeof(bmp)); bmp.bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); FillMemory(&bmp.Colors, sizeof(bmp.Colors), 0x44); SetLastError(ERROR_SUCCESS); - RTEST(NtGdiGetDIBitsInternal(hDCScreen, hBitmap, 0, 15, NULL, &bmp.bi, DIB_RGB_COLORS, - DIB_BitmapMaxBitsSize(&bmp.bi, 15), 0) > 0); - RTEST(GetLastError() == ERROR_SUCCESS); + ok(NtGdiGetDIBitsInternal(hDCScreen, hBitmap, 0, 15, NULL, &bmp.bi, DIB_RGB_COLORS, + DIB_BitmapMaxBitsSize(&bmp.bi, 15), 0) > 0, "The return value was <= 0.\n"); + ok_long(GetLastError(), ERROR_SUCCESS); ScreenBpp = GetDeviceCaps(hDCScreen, BITSPIXEL); - RTEST(bmp.bi.bmiHeader.biWidth == 16); - RTEST(bmp.bi.bmiHeader.biHeight == 16); - RTEST(bmp.bi.bmiHeader.biBitCount == ScreenBpp); - RTEST(bmp.bi.bmiHeader.biSizeImage == (16 * 16) * (ScreenBpp / 8)); + ok_long(bmp.bi.bmiHeader.biWidth, 16); + ok_long(bmp.bi.bmiHeader.biHeight, 16); + ok_long(bmp.bi.bmiHeader.biBitCount, ScreenBpp); + ok_long(bmp.bi.bmiHeader.biSizeImage, (16 * 16) * (ScreenBpp / 8)); - TEST(bmp.Colors[0].rgbRed == 0x44); + ok_int(bmp.Colors[0].rgbRed, 0x44); /* Test with pointer */ // ZeroMemory(&bmp.bi, sizeof(BITMAPINFO)); @@ -112,24 +114,24 @@ START_TEST(NtGdiGetDIBitsInternal) // FillMemory(&bmp.Colors, sizeof(bmp.Colors), 0x11223344); SetLastError(ERROR_SUCCESS); - TEST(NtGdiGetDIBitsInternal(hDCScreen, hBitmap, 0, 15, (void*)data, &bmp.bi, DIB_RGB_COLORS, - DIB_BitmapMaxBitsSize(&bmp.bi, 15), 0) > 0); - RTEST(GetLastError() == ERROR_SUCCESS); + ok(NtGdiGetDIBitsInternal(hDCScreen, hBitmap, 0, 15, (void*)data, &bmp.bi, DIB_RGB_COLORS, + DIB_BitmapMaxBitsSize(&bmp.bi, 15), 0) > 0, "The return value was <= 0.\n"); + ok_long(GetLastError(), ERROR_SUCCESS); - RTEST(bmp.bi.bmiHeader.biWidth == 16); - RTEST(bmp.bi.bmiHeader.biHeight == 16); - RTEST(bmp.bi.bmiHeader.biBitCount == ScreenBpp); - RTEST(bmp.bi.bmiHeader.biSizeImage == (16 * 16) * (ScreenBpp / 8)); + ok_long(bmp.bi.bmiHeader.biWidth, 16); + ok_long(bmp.bi.bmiHeader.biHeight, 16); + ok_long(bmp.bi.bmiHeader.biBitCount, ScreenBpp); + ok_long(bmp.bi.bmiHeader.biSizeImage, (16 * 16) * (ScreenBpp / 8)); - TEST(bmp.Colors[0].rgbRed != 0x44); + ok(bmp.Colors[0].rgbRed != 0x44, "bmp.Colors[0].rgbRed was 0x44.\n"); /* Test a BITMAPCOREINFO structure */ SetLastError(ERROR_SUCCESS); ZeroMemory(&bic, sizeof(BITMAPCOREINFO)); bic.bmciHeader.bcSize = sizeof(BITMAPCOREHEADER); - TEST(NtGdiGetDIBitsInternal(hDCScreen, hBitmap, 0, 15, NULL, (PBITMAPINFO)&bic, DIB_RGB_COLORS, - DIB_BitmapMaxBitsSize((PBITMAPINFO)&bic, 15), 0) > 0); - RTEST(GetLastError() == ERROR_SUCCESS); + ok(NtGdiGetDIBitsInternal(hDCScreen, hBitmap, 0, 15, NULL, (PBITMAPINFO)&bic, DIB_RGB_COLORS, + DIB_BitmapMaxBitsSize((PBITMAPINFO)&bic, 15), 0) > 0, "The return value was <= 0.\n"); + ok_long(GetLastError(), ERROR_SUCCESS); ReleaseDC(NULL, hDCScreen);
6 years
1
0
0
0
[reactos] 01/01: [APITESTS][WIN32KNT_APITEST] Improve NtGdiCreateCompatibleDC testcase (#1281)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e32d5a8b763715fcee79d…
commit e32d5a8b763715fcee79d6be3168f496b68ff372 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Jan 22 20:59:38 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Jan 22 20:59:38 2019 +0900 [APITESTS][WIN32KNT_APITEST] Improve NtGdiCreateCompatibleDC testcase (#1281) Use ok, ok_int and ok_ptr macros instead of obsolete TEST macros. --- .../rostests/apitests/win32nt/ntgdi/NtGdiCreateCompatibleDC.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateCompatibleDC.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateCompatibleDC.c index ff5fedb90a..2d662053ec 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateCompatibleDC.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateCompatibleDC.c @@ -14,21 +14,20 @@ START_TEST(NtGdiCreateCompatibleDC) /* Test if aa NULL DC is accepted */ hDC = NtGdiCreateCompatibleDC(NULL); - TEST(hDC != NULL); + ok(hDC != NULL, "hDC was NULL.\n"); /* We select a nwe palette. Note: SelectObject doesn't work with palettes! */ hObj = SelectPalette(hDC, GetStockObject(DEFAULT_PALETTE), 0); /* The old palette should be GetStockObject(DEFAULT_PALETTE) */ - TEST(hObj == GetStockObject(DEFAULT_PALETTE)); + ok_ptr(hObj, GetStockObject(DEFAULT_PALETTE)); /* The default bitmap should be GetStockObject(21) */ hObj = SelectObject(hDC, GetStockObject(21)); - TEST(hObj == GetStockObject(21)); + ok_ptr(hObj, GetStockObject(21)); /* The default pen should be GetStockObject(BLACK_PEN) */ hObj = SelectObject(hDC, GetStockObject(WHITE_PEN)); - TEST(hObj == GetStockObject(BLACK_PEN)); + ok_ptr(hObj, GetStockObject(BLACK_PEN)); - TEST(NtGdiDeleteObjectApp(hDC) != 0); + ok(NtGdiDeleteObjectApp(hDC) != 0, "NtGdiDeleteObjectApp(hDC) was zero.\n"); } -
6 years
1
0
0
0
[reactos] 01/01: [APITESTS][WIN32KNT_APITEST] Improve NtGdiCreateBitmap testcase (#1280)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0e70731358bff85798eb8…
commit 0e70731358bff85798eb8d2c4e33aa2c780de4e5 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Jan 22 20:52:25 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Jan 22 20:52:25 2019 +0900 [APITESTS][WIN32KNT_APITEST] Improve NtGdiCreateBitmap testcase (#1280) Use ok, ok_int, ok_long and ok_ptr macros instead of obsolete TEST macros. --- .../apitests/win32nt/ntgdi/NtGdiCreateBitmap.c | 179 ++++++++++----------- 1 file changed, 89 insertions(+), 90 deletions(-) diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateBitmap.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateBitmap.c index 27100a7fdd..828ed402be 100644 --- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateBitmap.c +++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiCreateBitmap.c @@ -15,187 +15,186 @@ void Test_NtGdiCreateBitmap_Params(void) /* Test simple params */ SetLastError(ERROR_SUCCESS); - TEST((hBmp = NtGdiCreateBitmap(1, 1, 1, 1, NULL)) != NULL); - TEST(GetLastError() == ERROR_SUCCESS); + ok((hBmp = NtGdiCreateBitmap(1, 1, 1, 1, NULL)) != NULL, "hBmp was NULL.\n"); + ok_long(GetLastError(), ERROR_SUCCESS); DeleteObject(hBmp); /* Test all zero */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(0, 0, 0, 0, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_ptr(NtGdiCreateBitmap(0, 0, 0, 0, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Test cx == 0 */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(0, 1, 1, 1, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_ptr(NtGdiCreateBitmap(0, 1, 1, 1, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Test negative cx */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(-10, 1, 1, 1, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_ptr(NtGdiCreateBitmap(-10, 1, 1, 1, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Test cy == 0 */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(1, 0, 1, 1, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_ptr(NtGdiCreateBitmap(1, 0, 1, 1, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Test negative cy */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(1, -2, 1, 1, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_ptr(NtGdiCreateBitmap(1, -2, 1, 1, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Test negative cy and valid bits */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(1, -2, 1, 1, BitmapData) == NULL); - TEST(GetLastError() == ERROR_SUCCESS); + ok_ptr(NtGdiCreateBitmap(1, -2, 1, 1, BitmapData), NULL); + ok_long(GetLastError(), ERROR_SUCCESS); /* Test negative cy and invalid bits */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(1, -2, 1, 1, (BYTE*)0x80001234) == NULL); - TEST(GetLastError() == ERROR_SUCCESS); + ok_ptr(NtGdiCreateBitmap(1, -2, 1, 1, (BYTE*)0x80001234), NULL); + ok_long(GetLastError(), ERROR_SUCCESS); /* Test huge size */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(100000, 100000, 1, 1, NULL) == NULL); - TEST(GetLastError() == ERROR_NOT_ENOUGH_MEMORY); + ok_ptr(NtGdiCreateBitmap(100000, 100000, 1, 1, NULL), NULL); + ok_long(GetLastError(), ERROR_NOT_ENOUGH_MEMORY); /* Test huge size and valid bits */ SetLastError(ERROR_SUCCESS); TEST(NtGdiCreateBitmap(1000, 1000, 1, 1, BitmapData) == NULL); - TEST(GetLastError() == ERROR_SUCCESS); + ok_long(GetLastError(), ERROR_SUCCESS); /* Test huge size and invalid bits */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(100000, 100000, 1, 1, (BYTE*)0x80001234) == NULL); - TEST(GetLastError() == ERROR_SUCCESS); + ok_ptr(NtGdiCreateBitmap(100000, 100000, 1, 1, (BYTE*)0x80001234), NULL); + ok_long(GetLastError(), ERROR_SUCCESS); /* Test cPlanes == 0 */ SetLastError(ERROR_SUCCESS); - TEST((hBmp = NtGdiCreateBitmap(1, 1, 0, 1, NULL)) != NULL); - TEST(GetLastError() == ERROR_SUCCESS); - ASSERT(GetObject(hBmp, sizeof(BITMAP), &bitmap) == sizeof(BITMAP)); - TEST(bitmap.bmType == 0); - TEST(bitmap.bmWidth == 1); - TEST(bitmap.bmHeight == 1); - TEST(bitmap.bmWidthBytes == 2); - TEST(bitmap.bmPlanes == 1); - TEST(bitmap.bmBitsPixel == 1); + ok((hBmp = NtGdiCreateBitmap(1, 1, 0, 1, NULL)) != NULL, "hBmp was NULL.\n"); + ok_long(GetLastError(), ERROR_SUCCESS); + ok_int(GetObject(hBmp, sizeof(BITMAP), &bitmap), (int)sizeof(BITMAP)); + ok_int(bitmap.bmType, 0); + ok_int(bitmap.bmWidth, 1); + ok_int(bitmap.bmHeight, 1); + ok_int(bitmap.bmWidthBytes, 2); + ok_int(bitmap.bmPlanes, 1); + ok_int(bitmap.bmBitsPixel, 1); DeleteObject(hBmp); /* Test big cPlanes */ SetLastError(ERROR_SUCCESS); - TEST((hBmp = NtGdiCreateBitmap(1, 1, 32, 1, NULL)) != NULL); - TEST(GetLastError() == ERROR_SUCCESS); + ok((hBmp = NtGdiCreateBitmap(1, 1, 32, 1, NULL)) != NULL, "hBmp was NULL.\n"); + ok_long(GetLastError(), ERROR_SUCCESS); DeleteObject(hBmp); - TEST(NtGdiCreateBitmap(1, 1, 33, 1, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_ptr(NtGdiCreateBitmap(1, 1, 33, 1, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Test cBPP == 0 */ SetLastError(ERROR_SUCCESS); - TEST((hBmp = NtGdiCreateBitmap(1, 1, 1, 0, NULL)) != NULL); - TEST(GetLastError() == ERROR_SUCCESS); - ASSERT(GetObject(hBmp, sizeof(BITMAP), &bitmap) == sizeof(BITMAP)); - TEST(bitmap.bmType == 0); - TEST(bitmap.bmWidth == 1); - TEST(bitmap.bmHeight == 1); - TEST(bitmap.bmWidthBytes == 2); - TEST(bitmap.bmPlanes == 1); - TEST(bitmap.bmBitsPixel == 1); + ok((hBmp = NtGdiCreateBitmap(1, 1, 1, 0, NULL)) != NULL, "hBmp was NULL.\n"); + ok_long(GetLastError(), ERROR_SUCCESS); + ok_int(GetObject(hBmp, sizeof(BITMAP), &bitmap), (int)sizeof(BITMAP)); + ok_int(bitmap.bmType, 0); + ok_int(bitmap.bmWidth, 1); + ok_int(bitmap.bmHeight, 1); + ok_int(bitmap.bmWidthBytes, 2); + ok_int(bitmap.bmPlanes, 1); + ok_int(bitmap.bmBitsPixel, 1); DeleteObject(hBmp); /* Test negative cBPP */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(1, 1, 1, -1, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_ptr(NtGdiCreateBitmap(1, 1, 1, -1, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Test bad cBPP */ SetLastError(ERROR_SUCCESS); - TEST((hBmp = NtGdiCreateBitmap(1, 1, 1, 3, NULL)) != NULL); - ASSERT(GetObject(hBmp, sizeof(BITMAP), &bitmap) == sizeof(BITMAP)); - TEST(bitmap.bmBitsPixel == 4); + ok((hBmp = NtGdiCreateBitmap(1, 1, 1, 3, NULL)) != NULL, "hBmp was NULL.\n"); + ok_int(GetObject(hBmp, sizeof(BITMAP), &bitmap), (int)sizeof(BITMAP)); + ok_int(bitmap.bmBitsPixel, 4); DeleteObject(hBmp); - TEST((hBmp = NtGdiCreateBitmap(1, 1, 1, 6, NULL)) != NULL); - ASSERT(GetObject(hBmp, sizeof(BITMAP), &bitmap) == sizeof(BITMAP)); - TEST(bitmap.bmBitsPixel == 8); + ok((hBmp = NtGdiCreateBitmap(1, 1, 1, 6, NULL)) != NULL, "hBmp was NULL.\n"); + ok_int(GetObject(hBmp, sizeof(BITMAP), &bitmap), (int)sizeof(BITMAP)); + ok_int(bitmap.bmBitsPixel, 8); DeleteObject(hBmp); - TEST((hBmp = NtGdiCreateBitmap(1, 1, 1, 15, NULL)) != NULL); - ASSERT(GetObject(hBmp, sizeof(BITMAP), &bitmap) == sizeof(BITMAP)); - TEST(bitmap.bmBitsPixel == 16); + ok((hBmp = NtGdiCreateBitmap(1, 1, 1, 15, NULL)) != NULL, "hBmp was NULL.\n"); + ok_int(GetObject(hBmp, sizeof(BITMAP), &bitmap), (int)sizeof(BITMAP)); + ok_int(bitmap.bmBitsPixel, 16); DeleteObject(hBmp); - TEST((hBmp = NtGdiCreateBitmap(1, 1, 1, 17, NULL)) != NULL); - ASSERT(GetObject(hBmp, sizeof(BITMAP), &bitmap) == sizeof(BITMAP)); - TEST(bitmap.bmBitsPixel == 24); + ok((hBmp = NtGdiCreateBitmap(1, 1, 1, 17, NULL)) != NULL, "hBmp was NULL.\n"); + ok_int(GetObject(hBmp, sizeof(BITMAP), &bitmap), (int)sizeof(BITMAP)); + ok_int(bitmap.bmBitsPixel, 24); DeleteObject(hBmp); - TEST((hBmp = NtGdiCreateBitmap(1, 1, 3, 7, NULL)) != NULL); - ASSERT(GetObject(hBmp, sizeof(BITMAP), &bitmap) == sizeof(BITMAP)); - TEST(bitmap.bmBitsPixel == 24); + ok((hBmp = NtGdiCreateBitmap(1, 1, 3, 7, NULL)) != NULL, "hBmp was NULL.\n"); + ok_int(GetObject(hBmp, sizeof(BITMAP), &bitmap), (int)sizeof(BITMAP)); + ok_int(bitmap.bmBitsPixel, 24); DeleteObject(hBmp); - TEST((hBmp = NtGdiCreateBitmap(1, 1, 1, 25, NULL)) != NULL); - ASSERT(GetObject(hBmp, sizeof(BITMAP), &bitmap) == sizeof(BITMAP)); - TEST(bitmap.bmBitsPixel == 32); + ok((hBmp = NtGdiCreateBitmap(1, 1, 1, 25, NULL)) != NULL, "hBmp was NULL.\n"); + ok_int(GetObject(hBmp, sizeof(BITMAP), &bitmap), (int)sizeof(BITMAP)); + ok_int(bitmap.bmBitsPixel, 32); DeleteObject(hBmp); - TEST(GetLastError() == ERROR_SUCCESS); + ok_long(GetLastError(), ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(1, 1, 1, 33, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_ptr(NtGdiCreateBitmap(1, 1, 1, 33, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Test bad pointer */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(1, 1, 1, 1, (BYTE*)0x80001234) == NULL); - TEST(GetLastError() == ERROR_SUCCESS); + ok_ptr(NtGdiCreateBitmap(1, 1, 1, 1, (BYTE*)0x80001234), NULL); + ok_long(GetLastError(), ERROR_SUCCESS); /* Test pointer alignment */ SetLastError(ERROR_SUCCESS); - TEST((hBmp = NtGdiCreateBitmap(1, 1, 1, 1, &BitmapData[1])) != NULL); - TEST(GetLastError() == ERROR_SUCCESS); + ok((hBmp = NtGdiCreateBitmap(1, 1, 1, 1, &BitmapData[1])) != NULL, "hBmp was NULL.\n"); + ok_long(GetLastError(), ERROR_SUCCESS); DeleteObject(hBmp); /* Test normal params */ SetLastError(ERROR_SUCCESS); - TEST((hBmp = NtGdiCreateBitmap(5, 7, 2, 4, NULL)) != NULL); - TEST(GetLastError() == ERROR_SUCCESS); - ASSERT(GetObject(hBmp, sizeof(BITMAP), &bitmap) == sizeof(BITMAP)); - TEST(bitmap.bmType == 0); - TEST(bitmap.bmWidth == 5); - TEST(bitmap.bmHeight == 7); - TEST(bitmap.bmWidthBytes == 6); - TEST(bitmap.bmPlanes == 1); - TEST(bitmap.bmBitsPixel == 8); + ok((hBmp = NtGdiCreateBitmap(5, 7, 2, 4, NULL)) != NULL, "hBmp was NULL.\n"); + ok_long(GetLastError(), ERROR_SUCCESS); + ok_int(GetObject(hBmp, sizeof(BITMAP), &bitmap), (int)sizeof(BITMAP)); + ok_int(bitmap.bmType, 0); + ok_int(bitmap.bmWidth, 5); + ok_int(bitmap.bmHeight, 7); + ok_int(bitmap.bmWidthBytes, 6); + ok_int(bitmap.bmPlanes, 1); + ok_int(bitmap.bmBitsPixel, 8); DeleteObject(hBmp); /* Test height 0 params */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(1, 0, 1, 1, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_ptr(NtGdiCreateBitmap(1, 0, 1, 1, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Test height -1 params */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(1, -1, 1, 1, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_ptr(NtGdiCreateBitmap(1, -1, 1, 1, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Test witdth 0 params */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(0, 1, 1, 1, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_ptr(NtGdiCreateBitmap(0, 1, 1, 1, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Test witdth -1 params */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(-1, 0, 1, 1, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); - + ok_ptr(NtGdiCreateBitmap(-1, 0, 1, 1, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); /* Test witdth -1 params */ SetLastError(ERROR_SUCCESS); - TEST(NtGdiCreateBitmap(0, 0, 1, 1, NULL) == NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_ptr(NtGdiCreateBitmap(0, 0, 1, 1, NULL), NULL); + ok_long(GetLastError(), ERROR_INVALID_PARAMETER); } START_TEST(NtGdiCreateBitmap)
6 years
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
30
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
25
26
27
28
29
30
Results per page:
10
25
50
100
200