https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ef8c9239d700b8375b7d5…
commit ef8c9239d700b8375b7d50333511e2ca33850bf7
Author: jimtabor <james.tabor(a)reactos.org>
AuthorDate: Mon Jan 20 13:11:09 2020 -0600
Commit: jimtabor <james.tabor(a)reactos.org>
CommitDate: Mon Jan 20 13:11:09 2020 -0600
[Win32nt|ApiTests] Add Exclude, Intersect and Offset Clip Region tests.
---
modules/rostests/apitests/win32nt/CMakeLists.txt | 3 +++
.../apitests/win32nt/ntgdi/NtGdiExcludeClipRect.c | 30 ++++++++++++++++++++++
.../apitests/win32nt/ntgdi/NtGdiExtSelectClipRgn.c | 2 +-
.../win32nt/ntgdi/NtGdiIntersectClipRect.c | 29 +++++++++++++++++++++
.../apitests/win32nt/ntgdi/NtGdiOffsetClipRgn.c | 29 +++++++++++++++++++++
modules/rostests/apitests/win32nt/testlist.c | 6 +++++
6 files changed, 98 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/apitests/win32nt/CMakeLists.txt
b/modules/rostests/apitests/win32nt/CMakeLists.txt
index 8ef26f564d9..bdda9755197 100644
--- a/modules/rostests/apitests/win32nt/CMakeLists.txt
+++ b/modules/rostests/apitests/win32nt/CMakeLists.txt
@@ -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
diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiExcludeClipRect.c
b/modules/rostests/apitests/win32nt/ntgdi/NtGdiExcludeClipRect.c
new file mode 100644
index 00000000000..6dd1a22a86e
--- /dev/null
+++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiExcludeClipRect.c
@@ -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());
+
+}
diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiExtSelectClipRgn.c
b/modules/rostests/apitests/win32nt/ntgdi/NtGdiExtSelectClipRgn.c
index 03cd12d161f..847c1377cef 100644
--- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiExtSelectClipRgn.c
+++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiExtSelectClipRgn.c
@@ -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:
*/
diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiIntersectClipRect.c
b/modules/rostests/apitests/win32nt/ntgdi/NtGdiIntersectClipRect.c
new file mode 100644
index 00000000000..cbe66134ab7
--- /dev/null
+++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiIntersectClipRect.c
@@ -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());
+}
diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiOffsetClipRgn.c
b/modules/rostests/apitests/win32nt/ntgdi/NtGdiOffsetClipRgn.c
new file mode 100644
index 00000000000..ef28a23c8f2
--- /dev/null
+++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiOffsetClipRgn.c
@@ -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());
+}
diff --git a/modules/rostests/apitests/win32nt/testlist.c
b/modules/rostests/apitests/win32nt/testlist.c
index 186fd03e6ca..bbf0756fc31 100644
--- a/modules/rostests/apitests/win32nt/testlist.c
+++ b/modules/rostests/apitests/win32nt/testlist.c
@@ -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 },