[GDI32_APITEST]
authorThomas Faber <thomas.faber@reactos.org>
Tue, 18 Aug 2015 10:24:01 +0000 (10:24 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Tue, 18 Aug 2015 10:24:01 +0000 (10:24 +0000)
- Add a simple test for SetBoundsRect

svn path=/trunk/; revision=68750

rostests/apitests/gdi32/CMakeLists.txt
rostests/apitests/gdi32/SetBoundsRect.c [new file with mode: 0644]
rostests/apitests/gdi32/testlist.c

index c502f0d..6b430c4 100644 (file)
@@ -59,6 +59,7 @@ list(APPEND SOURCE
     Rectangle.c
     RealizePalette.c
     SelectObject.c
     Rectangle.c
     RealizePalette.c
     SelectObject.c
+    SetBoundsRect.c
     SetBrushOrgEx.c
     SetDCPenColor.c
     SetDIBits.c
     SetBrushOrgEx.c
     SetDCPenColor.c
     SetDIBits.c
diff --git a/rostests/apitests/gdi32/SetBoundsRect.c b/rostests/apitests/gdi32/SetBoundsRect.c
new file mode 100644 (file)
index 0000000..261d99d
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * PROJECT:         ReactOS API tests
+ * LICENSE:         LGPLv2.1+ - See COPYING.LIB in the top level directory
+ * PURPOSE:         Test for SetBoundsRect
+ * PROGRAMMERS:     Thomas Faber <thomas.faber@reactos.org
+ */
+
+#include <apitest.h>
+#include <winuser.h>
+#include <wingdi.h>
+
+START_TEST(SetBoundsRect)
+{
+    HDC hDC;
+    UINT ret;
+    DWORD error;
+
+    hDC = CreateCompatibleDC(GetDC(NULL));
+    if (hDC == NULL)
+    {
+        skip("No DC\n");
+        return;
+    }
+
+    SetLastError(0xbeeffeed);
+    ret = SetBoundsRect(hDC, NULL, 0);
+    error = GetLastError();
+    ok(ret == (DCB_DISABLE | DCB_RESET), "ret = %u\n", ret);
+    ok(error == 0xbeeffeed, "error = %lu\n", error);
+
+    SetLastError(0xbeeffeed);
+    ret = SetBoundsRect(hDC, NULL, DCB_ACCUMULATE);
+    error = GetLastError();
+    ok(ret == (DCB_DISABLE | DCB_RESET), "ret = %u\n", ret);
+    ok(error == 0xbeeffeed, "error = %lu\n", error);
+
+    SetLastError(0xbeeffeed);
+    ret = SetBoundsRect(hDC, NULL, DCB_DISABLE);
+    error = GetLastError();
+    ok(ret == (DCB_DISABLE | DCB_RESET), "ret = %u\n", ret);
+    ok(error == 0xbeeffeed, "error = %lu\n", error);
+
+    SetLastError(0xbeeffeed);
+    ret = SetBoundsRect(hDC, NULL, DCB_ENABLE);
+    error = GetLastError();
+    ok(ret == (DCB_DISABLE | DCB_RESET), "ret = %u\n", ret);
+    ok(error == 0xbeeffeed, "error = %lu\n", error);
+
+    SetLastError(0xbeeffeed);
+    ret = SetBoundsRect(hDC, NULL, DCB_RESET);
+    error = GetLastError();
+    ok(ret == (DCB_ENABLE | DCB_RESET), "ret = %u\n", ret);
+    ok(error == 0xbeeffeed, "error = %lu\n", error);
+
+    DeleteDC(hDC);
+}
index c6acd03..6a99fa5 100644 (file)
@@ -60,6 +60,7 @@ extern void func_PatBlt(void);
 extern void func_Rectangle(void);
 extern void func_RealizePalette(void);
 extern void func_SelectObject(void);
 extern void func_Rectangle(void);
 extern void func_RealizePalette(void);
 extern void func_SelectObject(void);
+extern void func_SetBoundsRect(void);
 extern void func_SetBrushOrgEx(void);
 extern void func_SetDCPenColor(void);
 extern void func_SetDIBits(void);
 extern void func_SetBrushOrgEx(void);
 extern void func_SetDCPenColor(void);
 extern void func_SetDIBits(void);
@@ -129,6 +130,7 @@ const struct test winetest_testlist[] =
     { "Rectangle", func_Rectangle },
     { "RealizePalette", func_RealizePalette },
     { "SelectObject", func_SelectObject },
     { "Rectangle", func_Rectangle },
     { "RealizePalette", func_RealizePalette },
     { "SelectObject", func_SelectObject },
+    { "SetBoundsRect", func_SetBoundsRect },
     { "SetBrushOrgEx", func_SetBrushOrgEx },
     { "SetDCPenColor", func_SetDCPenColor },
     { "SetDIBits", func_SetDIBits },
     { "SetBrushOrgEx", func_SetBrushOrgEx },
     { "SetDCPenColor", func_SetDCPenColor },
     { "SetDIBits", func_SetDIBits },