[Win32nt|ApiTests] Add Exclude, Intersect and Offset Clip Region tests.

This commit is contained in:
jimtabor 2020-01-20 13:11:09 -06:00
parent 4927905eeb
commit ef8c9239d7
6 changed files with 98 additions and 1 deletions

View file

@ -18,6 +18,7 @@ list(APPEND SOURCE
ntgdi/NtGdiDoPalette.c
ntgdi/NtGdiEngCreatePalette.c
ntgdi/NtGdiEnumFontOpen.c
ntgdi/NtGdiExcludeClipRect.c
ntgdi/NtGdiExtSelectClipRgn.c
ntgdi/NtGdiExtTextOutW.c
#ntgdi/NtGdiFlushUserBatch.c
@ -26,6 +27,8 @@ list(APPEND SOURCE
ntgdi/NtGdiGetFontResourceInfoInternalW.c
ntgdi/NtGdiGetRandomRgn.c
ntgdi/NtGdiGetStockObject.c
ntgdi/NtGdiIntersectClipRect.c
ntgdi/NtGdiOffsetClipRgn.c
ntgdi/NtGdiPolyPolyDraw.c
ntgdi/NtGdiRestoreDC.c
ntgdi/NtGdiSaveDC.c

View file

@ -0,0 +1,30 @@
/*
* PROJECT: ReactOS api tests
* LICENSE: GPL - See COPYING in the top level directory
* PURPOSE: Test for NtGdiExcludeClipRect
* PROGRAMMERS:
*/
#include <win32nt.h>
START_TEST(NtGdiExcludeClipRect)
{
//HDC hdc;
// test what params are accepted for what operations
// 0? invalid? are params maybe ignored in some cases?
// LastError
/* Preparation */
//hdc = CreateCompatibleDC(NULL);
/* Test NULL DC */
SetLastError(0x12345);
ok_int(NtGdiExcludeClipRect(NULL, 0, 0, 0, 0), ERROR);
ok_int(GetLastError(), ERROR_INVALID_HANDLE);
/* Test invalid DC */
SetLastError(0x12345);
ok_int(NtGdiExcludeClipRect((HDC)(ULONG_PTR)0x12345, 0, 0, 0, 0), ERROR);
ok((GetLastError() == ERROR_INVALID_HANDLE), "ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
}

View file

@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS api tests
* LICENSE: GPL - See COPYING in the top level directory
* PURPOSE: Test for NtGdiCombineRgn
* PURPOSE: Test for NtGdiExtSelectClipRgn
* PROGRAMMERS:
*/

View file

@ -0,0 +1,29 @@
/*
* PROJECT: ReactOS api tests
* LICENSE: GPL - See COPYING in the top level directory
* PURPOSE: Test for NtGdiIntersectClipRect
* PROGRAMMERS:
*/
#include <win32nt.h>
START_TEST(NtGdiIntersectClipRect)
{
//HDC hdc;
// test what params are accepted for what operations
// 0? invalid? are params maybe ignored in some cases?
// LastError
/* Preparation */
//hdc = CreateCompatibleDC(NULL);
/* Test NULL DC */
SetLastError(0x12345);
ok_int(NtGdiIntersectClipRect(NULL, 0, 0, 0, 0), ERROR);
ok_int(GetLastError(), ERROR_INVALID_HANDLE);
/* Test invalid DC */
SetLastError(0x12345);
ok_int(NtGdiIntersectClipRect((HDC)(ULONG_PTR)0x12345, 0, 0, 0, 0), ERROR);
ok((GetLastError() == ERROR_INVALID_HANDLE), "ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
}

View file

@ -0,0 +1,29 @@
/*
* PROJECT: ReactOS api tests
* LICENSE: GPL - See COPYING in the top level directory
* PURPOSE: Test for NtGdiOffsetClipRgn
* PROGRAMMERS:
*/
#include <win32nt.h>
START_TEST(NtGdiOffsetClipRgn)
{
//HDC hdc;
// test what params are accepted for what operations
// 0? invalid? are params maybe ignored in some cases?
// LastError
/* Preparation */
//hdc = CreateCompatibleDC(NULL);
/* Test NULL DC */
SetLastError(0x12345);
ok_int(NtGdiOffsetClipRgn(NULL, 0, 0), ERROR);
ok_int(GetLastError(), ERROR_INVALID_HANDLE);
/* Test invalid DC */
SetLastError(0x12345);
ok_int(NtGdiOffsetClipRgn((HDC)(ULONG_PTR)0x12345, 0, 0), ERROR);
ok((GetLastError() == ERROR_INVALID_HANDLE), "ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
}

View file

@ -19,6 +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_NtGdiExcludeClipRect(void);
extern void func_NtGdiExtSelectClipRgn(void);
extern void func_NtGdiExtTextOutW(void);
//extern void func_NtGdiFlushUserBatch(void);
@ -27,6 +28,8 @@ extern void func_NtGdiGetDIBitsInternal(void);
extern void func_NtGdiGetFontResourceInfoInternalW(void);
extern void func_NtGdiGetRandomRgn(void);
extern void func_NtGdiGetStockObject(void);
extern void func_NtGdiIntersectClipRect(void);
extern void func_NtGdiOffsetClipRgn(void);
extern void func_NtGdiPolyPolyDraw(void);
extern void func_NtGdiRestoreDC(void);
extern void func_NtGdiSaveDC(void);
@ -80,6 +83,7 @@ const struct test winetest_testlist[] =
{ "NtGdiDoPalette", func_NtGdiDoPalette },
{ "NtGdiEngCreatePalette", func_NtGdiEngCreatePalette },
{ "NtGdiEnumFontOpen", func_NtGdiEnumFontOpen },
{ "NtGdiExcludeClipRect", func_NtGdiExcludeClipRect },
{ "NtGdiExtSelectClipRgn", func_NtGdiExtSelectClipRgn },
{ "NtGdiExtTextOutW", func_NtGdiExtTextOutW },
//{ "NtGdiFlushUserBatch", func_NtGdiFlushUserBatch },
@ -88,6 +92,8 @@ const struct test winetest_testlist[] =
{ "NtGdiGetFontResourceInfoInternalW", func_NtGdiGetFontResourceInfoInternalW },
{ "NtGdiGetRandomRgn", func_NtGdiGetRandomRgn },
{ "NtGdiGetStockObject", func_NtGdiGetStockObject },
{ "NtGdiIntersectClipRect", func_NtGdiIntersectClipRect },
{ "NtGdiOffsetClipRgn", func_NtGdiOffsetClipRgn },
{ "NtGdiPolyPolyDraw", func_NtGdiPolyPolyDraw },
{ "NtGdiRestoreDC", func_NtGdiRestoreDC },
{ "NtGdiSaveDC", func_NtGdiSaveDC },