ReactOS 0.4.15-dev-7659-ga55345b
OffsetRgn.c File Reference
#include "precomp.h"
Include dependency graph for OffsetRgn.c:

Go to the source code of this file.

Functions

void Test_OffsetRgn ()
 
 START_TEST (OffsetRgn)
 

Function Documentation

◆ START_TEST()

START_TEST ( OffsetRgn  )

Definition at line 51 of file OffsetRgn.c.

52{
54}
void Test_OffsetRgn()
Definition: OffsetRgn.c:10

◆ Test_OffsetRgn()

void Test_OffsetRgn ( )

Definition at line 10 of file OffsetRgn.c.

11{
12 HRGN hrgn1, hrgn2;
13 HDC hdc;
14
15 hrgn1 = CreateRectRgn(0, 0, 0, 0);
16 ok(hrgn1 != NULL, "CreateRectRgn failed\n");
17 ok_int(OffsetRgn(hrgn1, INT_MIN + 10, 10), NULLREGION);
18 ok_int(OffsetRgn(hrgn1, 0xF000000, 0xF000000), NULLREGION);
19 DeleteObject(hrgn1);
20
21 hrgn1 = CreateRectRgn(0, 0, 100, 100);
22 ok(hrgn1 != NULL, "CreateRectRgn failed\n");
23 ok_int(OffsetRgn(hrgn1, 10, 10), SIMPLEREGION);
24 ok_int(OffsetRgn(hrgn1, 0x8000000 - 110, 10), ERROR);
25 ok_int(OffsetRgn(hrgn1, 0x8000000 - 111, 10), SIMPLEREGION);
26 DeleteObject(hrgn1);
27
28 hrgn1 = CreateRectRgn(0, 0, 100, 100);
29 ok(hrgn1 != NULL, "CreateRectRgn failed\n");
30 ok_int(OffsetRgn(hrgn1, -10, 10), SIMPLEREGION);
31 ok_int(OffsetRgn(hrgn1, -(0x8000000 - 9), 10), ERROR);
32 ok_int(OffsetRgn(hrgn1, -(0x8000000 - 10), 10), SIMPLEREGION);
33 DeleteObject(hrgn1);
34
35 hrgn1 = CreateRectRgn(0, 0, 10, 10);
36 hrgn2 = CreateRectRgn(1000, 20, 1010, 30);
37 ok_int(CombineRgn(hrgn1, hrgn1, hrgn2, RGN_OR), COMPLEXREGION);
38 ok_int(OffsetRgn(hrgn1, 0x8000000 - 100, 10), ERROR);
39 ok_int(CombineRgn(hrgn1, hrgn1, hrgn2, RGN_XOR), SIMPLEREGION);
41 hrgn2 = CreateRectRgn(0, 0, 10, 10);
42 ok_int(CombineRgn(hrgn1, hrgn1, hrgn2, RGN_XOR), NULLREGION);
43
44 hrgn1 = CreateRectRgn(0, 0, 0, 0);
46 ok_int(GetClipRgn(hdc, hrgn1), 0);
47 ok_int(OffsetRgn(hrgn1, 10, 10), NULLREGION);
48
49}
static HRGN hrgn2
#define ok(value,...)
Definition: atltest.h:57
#define ok_int(expression, result)
Definition: atltest.h:134
#define NULL
Definition: types.h:112
#define ERROR(name)
Definition: error_private.h:53
pKey DeleteObject()
#define INT_MIN
Definition: limits.h:39
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
#define COMPLEXREGION
Definition: wingdi.h:363
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define NULLREGION
Definition: wingdi.h:361
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int WINAPI GetClipRgn(_In_ HDC, _In_ HRGN)
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
#define SIMPLEREGION
Definition: wingdi.h:362
#define RGN_XOR
Definition: wingdi.h:360
#define RGN_OR
Definition: wingdi.h:359
int WINAPI OffsetRgn(_In_ HRGN, _In_ int, _In_ int)

Referenced by START_TEST().