[Win32nt|ApiTests] Add Exclude, Intersect and Offset Clip Region tests.
authorjimtabor <james.tabor@reactos.org>
Mon, 20 Jan 2020 19:11:09 +0000 (13:11 -0600)
committerjimtabor <james.tabor@reactos.org>
Mon, 20 Jan 2020 19:11:09 +0000 (13:11 -0600)
modules/rostests/apitests/win32nt/CMakeLists.txt
modules/rostests/apitests/win32nt/ntgdi/NtGdiExcludeClipRect.c [new file with mode: 0644]
modules/rostests/apitests/win32nt/ntgdi/NtGdiExtSelectClipRgn.c
modules/rostests/apitests/win32nt/ntgdi/NtGdiIntersectClipRect.c [new file with mode: 0644]
modules/rostests/apitests/win32nt/ntgdi/NtGdiOffsetClipRgn.c [new file with mode: 0644]
modules/rostests/apitests/win32nt/testlist.c

index 8ef26f5..bdda975 100644 (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
diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiExcludeClipRect.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiExcludeClipRect.c
new file mode 100644 (file)
index 0000000..6dd1a22
--- /dev/null
@@ -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());
+
+}
index 03cd12d..847c137 100644 (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:
  */
 
diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiIntersectClipRect.c b/modules/rostests/apitests/win32nt/ntgdi/NtGdiIntersectClipRect.c
new file mode 100644 (file)
index 0000000..cbe6613
--- /dev/null
@@ -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 (file)
index 0000000..ef28a23
--- /dev/null
@@ -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());
+}
index 186fd03..bbf0756 100644 (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 },