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