1*c2c66affSColin Finck /*
2*c2c66affSColin Finck  * PROJECT:         ReactOS api tests
3*c2c66affSColin Finck  * LICENSE:         GPL - See COPYING in the top level directory
4*c2c66affSColin Finck  * PURPOSE:         Test for FrameRgn
5*c2c66affSColin Finck  * PROGRAMMERS:     Timo Kreuzer
6*c2c66affSColin Finck  */
7*c2c66affSColin Finck 
8*c2c66affSColin Finck #include <apitest.h>
9*c2c66affSColin Finck #include <windows.h>
10*c2c66affSColin Finck #include <stdio.h>
11*c2c66affSColin Finck #include "init.h"
12*c2c66affSColin Finck 
13*c2c66affSColin Finck void Test_OffsetRgn()
14*c2c66affSColin Finck {
15*c2c66affSColin Finck     HRGN hrgn1, hrgn2;
16*c2c66affSColin Finck     HDC hdc;
17*c2c66affSColin Finck 
18*c2c66affSColin Finck     hrgn1 = CreateRectRgn(0, 0, 0, 0);
19*c2c66affSColin Finck     ok(hrgn1 != NULL, "CreateRectRgn failed\n");
20*c2c66affSColin Finck     ok_int(OffsetRgn(hrgn1, INT_MIN + 10, 10), NULLREGION);
21*c2c66affSColin Finck     ok_int(OffsetRgn(hrgn1, 0xF000000, 0xF000000), NULLREGION);
22*c2c66affSColin Finck     DeleteObject(hrgn1);
23*c2c66affSColin Finck 
24*c2c66affSColin Finck     hrgn1 = CreateRectRgn(0, 0, 100, 100);
25*c2c66affSColin Finck     ok(hrgn1 != NULL, "CreateRectRgn failed\n");
26*c2c66affSColin Finck     ok_int(OffsetRgn(hrgn1, 10, 10), SIMPLEREGION);
27*c2c66affSColin Finck     ok_int(OffsetRgn(hrgn1, 0x8000000 - 110, 10), ERROR);
28*c2c66affSColin Finck     ok_int(OffsetRgn(hrgn1, 0x8000000 - 111, 10), SIMPLEREGION);
29*c2c66affSColin Finck     DeleteObject(hrgn1);
30*c2c66affSColin Finck 
31*c2c66affSColin Finck     hrgn1 = CreateRectRgn(0, 0, 100, 100);
32*c2c66affSColin Finck     ok(hrgn1 != NULL, "CreateRectRgn failed\n");
33*c2c66affSColin Finck     ok_int(OffsetRgn(hrgn1, -10, 10), SIMPLEREGION);
34*c2c66affSColin Finck     ok_int(OffsetRgn(hrgn1, -(0x8000000 - 9), 10), ERROR);
35*c2c66affSColin Finck     ok_int(OffsetRgn(hrgn1, -(0x8000000 - 10), 10), SIMPLEREGION);
36*c2c66affSColin Finck     DeleteObject(hrgn1);
37*c2c66affSColin Finck 
38*c2c66affSColin Finck     hrgn1 = CreateRectRgn(0, 0, 10, 10);
39*c2c66affSColin Finck     hrgn2 = CreateRectRgn(1000, 20, 1010, 30);
40*c2c66affSColin Finck     ok_int(CombineRgn(hrgn1, hrgn1, hrgn2, RGN_OR), COMPLEXREGION);
41*c2c66affSColin Finck     ok_int(OffsetRgn(hrgn1, 0x8000000 - 100, 10), ERROR);
42*c2c66affSColin Finck     ok_int(CombineRgn(hrgn1, hrgn1, hrgn2, RGN_XOR), SIMPLEREGION);
43*c2c66affSColin Finck     DeleteObject(hrgn2);
44*c2c66affSColin Finck     hrgn2 = CreateRectRgn(0, 0, 10, 10);
45*c2c66affSColin Finck     ok_int(CombineRgn(hrgn1, hrgn1, hrgn2, RGN_XOR), NULLREGION);
46*c2c66affSColin Finck 
47*c2c66affSColin Finck     hrgn1 = CreateRectRgn(0, 0, 0, 0);
48*c2c66affSColin Finck     hdc = CreateCompatibleDC(NULL);
49*c2c66affSColin Finck     ok_int(GetClipRgn(hdc, hrgn1), 0);
50*c2c66affSColin Finck     ok_int(OffsetRgn(hrgn1, 10, 10), NULLREGION);
51*c2c66affSColin Finck 
52*c2c66affSColin Finck }
53*c2c66affSColin Finck 
54*c2c66affSColin Finck START_TEST(OffsetRgn)
55*c2c66affSColin Finck {
56*c2c66affSColin Finck     Test_OffsetRgn();
57*c2c66affSColin Finck }
58*c2c66affSColin Finck 
59