ReactOS 0.4.15-dev-7842-g558ab78
OffsetRgn.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for FrameRgn
5 * PROGRAMMERS: Timo Kreuzer
6 */
7
8#include "precomp.h"
9
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}
50
52{
54}
55
static HRGN hrgn2
void Test_OffsetRgn()
Definition: OffsetRgn.c:10
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#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)