[Win32nt|ApiTests] Add ExtSelectClipRgn test

For CORE-13817 and CORE-15906
This commit is contained in:
jimtabor 2019-05-08 12:31:17 -05:00
parent 0a392b188a
commit 25198d5cbd
3 changed files with 60 additions and 3 deletions

View file

@ -18,7 +18,7 @@ list(APPEND SOURCE
ntgdi/NtGdiDoPalette.c
ntgdi/NtGdiEngCreatePalette.c
ntgdi/NtGdiEnumFontOpen.c
#ntgdi/NtGdiExtSelectClipRgn.c
ntgdi/NtGdiExtSelectClipRgn.c
ntgdi/NtGdiExtTextOutW.c
#ntgdi/NtGdiFlushUserBatch.c
ntgdi/NtGdiGetBitmapBits.c

View file

@ -0,0 +1,57 @@
/*
* PROJECT: ReactOS api tests
* LICENSE: GPL - See COPYING in the top level directory
* PURPOSE: Test for NtGdiCombineRgn
* PROGRAMMERS:
*/
#include <win32nt.h>
START_TEST(NtGdiExtSelectClipRgn)
{
HRGN hRgnDest, hRgn1, hRgn2;
HDC hdc;
// test what params are accepted for what operations
// 0? invalid? are params maybe ignored in some cases?
// LastError
/* Preparation */
hRgnDest = CreateRectRgn(100, 100, 100, 100);
hRgn1 = CreateRectRgn(1,1,4,4);
hRgn2 = CreateRectRgn(2,2,6,3);
hdc = GetDC(NULL);
/* RGN_AND = 1, RGN_OR = 2, RGN_XOR = 3, RGN_DIFF = 4, RGN_COPY = 5 */
SetLastError(0xDEADFACE);
ok_int(NtGdiExtSelectClipRgn(NULL, NULL, RGN_AND-1), ERROR);
ok_long(GetLastError(), ERROR_INVALID_PARAMETER);
SetLastError(0xDEADFACE);
ok_int(NtGdiExtSelectClipRgn(NULL, NULL, RGN_COPY+1), ERROR);
ok_long(GetLastError(), ERROR_INVALID_PARAMETER);
SetLastError(0xDEADFACE);
ok_int(NtGdiExtSelectClipRgn(NULL, NULL, RGN_COPY), ERROR);
ok_long(GetLastError(), ERROR_INVALID_HANDLE);
ok_int(NtGdiExtSelectClipRgn(hdc, hRgnDest, RGN_COPY), NULLREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_COPY), SIMPLEREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, hRgnDest, RGN_DIFF), SIMPLEREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, hRgn1, RGN_COPY), SIMPLEREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, hRgn2, RGN_DIFF), COMPLEXREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_COPY), SIMPLEREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_COPY), SIMPLEREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, hRgnDest, RGN_COPY), NULLREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, hRgn1, RGN_AND), NULLREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, hRgn2, RGN_AND), NULLREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_COPY), SIMPLEREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, hRgn1, RGN_OR), SIMPLEREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, hRgn2, RGN_OR), SIMPLEREGION);
ok_int(NtGdiExtSelectClipRgn(hdc, hRgn1, RGN_XOR), COMPLEXREGION);
SetLastError(0xDEADFACE);
ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_DIFF), ERROR);
ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_OR), ERROR);
ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_XOR), ERROR);
ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_AND), ERROR);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_COPY), SIMPLEREGION);
}

View file

@ -19,7 +19,7 @@ extern void func_NtGdiDeleteObjectApp(void);
extern void func_NtGdiDoPalette(void);
extern void func_NtGdiEngCreatePalette(void);
extern void func_NtGdiEnumFontOpen(void);
//extern void func_NtGdiExtSelectClipRgn(void);
extern void func_NtGdiExtSelectClipRgn(void);
extern void func_NtGdiExtTextOutW(void);
//extern void func_NtGdiFlushUserBatch(void);
extern void func_NtGdiGetBitmapBits(void);
@ -80,7 +80,7 @@ const struct test winetest_testlist[] =
{ "NtGdiDoPalette", func_NtGdiDoPalette },
{ "NtGdiEngCreatePalette", func_NtGdiEngCreatePalette },
{ "NtGdiEnumFontOpen", func_NtGdiEnumFontOpen },
//{ "NtGdiExtSelectClipRgn", func_NtGdiExtSelectClipRgn },
{ "NtGdiExtSelectClipRgn", func_NtGdiExtSelectClipRgn },
{ "NtGdiExtTextOutW", func_NtGdiExtTextOutW },
//{ "NtGdiFlushUserBatch", func_NtGdiFlushUserBatch },
{ "NtGdiGetBitmapBits", func_NtGdiGetBitmapBits },