ReactOS 0.4.15-dev-7942-gd23573b
OffsetClipRgn.c File Reference
#include "precomp.h"
Include dependency graph for OffsetClipRgn.c:

Go to the source code of this file.

Functions

void Test_OffsetClipRgn ()
 
 START_TEST (OffsetClipRgn)
 

Function Documentation

◆ START_TEST()

START_TEST ( OffsetClipRgn  )

Definition at line 73 of file OffsetClipRgn.c.

74{
76}
void Test_OffsetClipRgn()
Definition: OffsetClipRgn.c:10

◆ Test_OffsetClipRgn()

void Test_OffsetClipRgn ( )

Definition at line 10 of file OffsetClipRgn.c.

11{
12 HDC hdc;
13 HRGN hrgn, hrgn2;
14 //RECT rect;
15
17 ok(hdc != 0, "CreateCompatibleDC failed, skipping tests.\n");
18 if (!hdc) return;
19
20 hrgn2 = CreateRectRgn(0, 0, 0, 0);
21
22 /* Test NULL DC */
23 SetLastError(0x12345);
26
27 /* Test invalid DC */
28 SetLastError(0x12345);
29 ok_int(OffsetClipRgn((HDC)(ULONG_PTR)0x12345, 0, 0), ERROR);
30 ok((GetLastError() == 0x12345) || (GetLastError() == ERROR_INVALID_HANDLE), "Expected 0x12345 or ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
31 SetLastError(0x12345);
32
33 /* Test without a clip region set */
34 SetLastError(0x12345);
37 ok_int(GetLastError(), 0x12345);
38 SetLastError(0x12345);
39
40 /* Set a clip region */
41 hrgn = CreateRectRgn(10, 10, 20, 30);
46 hrgn = CreateRectRgn(20, 20, 30, 40);
48
49 /* Set different scaling */
51 ok_int(SetViewportExtEx(hdc, 100, 100, NULL), 1);
52 ok_int(SetWindowExtEx(hdc, 200, 50, NULL), 1);
55 hrgn = CreateRectRgn(25, 40, 35, 60);
57
58#if 0
59 /* Set different scaling */
61 ok_int(SetViewportExtEx(hdc, 100, 100, NULL), 1);
62 ok_int(SetWindowExtEx(hdc, 80, 350, NULL), 1);
65 hrgn = CreateRectRgn(33, 23, 43, 43);
67#endif
68
69 ok_int(GetLastError(), 0x12345);
70
71}
static HRGN hrgn2
static HRGN hrgn
#define ok(value,...)
Definition: atltest.h:57
#define ok_int(expression, result)
Definition: atltest.h:134
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define SetLastError(x)
Definition: compat.h:752
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ERROR(name)
Definition: error_private.h:53
pKey DeleteObject()
#define CLIPRGN
Definition: precomp.h:18
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
uint32_t ULONG_PTR
Definition: typedefs.h:65
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
int WINAPI SetMapMode(_In_ HDC, _In_ int)
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI SetViewportExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
Definition: coord.c:465
#define NULLREGION
Definition: wingdi.h:361
BOOL WINAPI EqualRgn(_In_ HRGN, _In_ HRGN)
#define MM_ANISOTROPIC
Definition: wingdi.h:867
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI SetWindowExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
#define SIMPLEREGION
Definition: wingdi.h:362
int WINAPI GetRandomRgn(_In_ HDC, _In_ HRGN, _In_ INT)
int WINAPI OffsetClipRgn(_In_ HDC, _In_ int, _In_ int)
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)

Referenced by START_TEST().