1 /*
2  * PROJECT:         ReactOS API tests
3  * LICENSE:         LGPLv2.1+ - See COPYING.LIB in the top level directory
4  * PURPOSE:         Test for SetBoundsRect
5  * PROGRAMMERS:     Thomas Faber <thomas.faber@reactos.org
6  */
7 
8 #include <apitest.h>
9 #include <winuser.h>
10 #include <wingdi.h>
11 
12 START_TEST(SetBoundsRect)
13 {
14     HDC hDC;
15     UINT ret;
16     DWORD error;
17 
18     hDC = CreateCompatibleDC(GetDC(NULL));
19     if (hDC == NULL)
20     {
21         skip("No DC\n");
22         return;
23     }
24 
25     SetLastError(0xbeeffeed);
26     ret = SetBoundsRect(hDC, NULL, 0);
27     error = GetLastError();
28     ok(ret == (DCB_DISABLE | DCB_RESET), "ret = %u\n", ret);
29     ok(error == 0xbeeffeed, "error = %lu\n", error);
30 
31     SetLastError(0xbeeffeed);
32     ret = SetBoundsRect(hDC, NULL, DCB_ACCUMULATE);
33     error = GetLastError();
34     ok(ret == (DCB_DISABLE | DCB_RESET), "ret = %u\n", ret);
35     ok(error == 0xbeeffeed, "error = %lu\n", error);
36 
37     SetLastError(0xbeeffeed);
38     ret = SetBoundsRect(hDC, NULL, DCB_DISABLE);
39     error = GetLastError();
40     ok(ret == (DCB_DISABLE | DCB_RESET), "ret = %u\n", ret);
41     ok(error == 0xbeeffeed, "error = %lu\n", error);
42 
43     SetLastError(0xbeeffeed);
44     ret = SetBoundsRect(hDC, NULL, DCB_ENABLE);
45     error = GetLastError();
46     ok(ret == (DCB_DISABLE | DCB_RESET), "ret = %u\n", ret);
47     ok(error == 0xbeeffeed, "error = %lu\n", error);
48 
49     SetLastError(0xbeeffeed);
50     ret = SetBoundsRect(hDC, NULL, DCB_RESET);
51     error = GetLastError();
52     ok(ret == (DCB_ENABLE | DCB_RESET), "ret = %u\n", ret);
53     ok(error == 0xbeeffeed, "error = %lu\n", error);
54 
55     DeleteDC(hDC);
56 }
57