ReactOS 0.4.15-dev-8408-g466a198
OffsetClipRgn.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 OffsetClipRgn
5 * PROGRAMMERS: Timo Kreuzer
6 */
7
8#include "precomp.h"
9
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}
72
74{
76}
static HRGN hrgn2
static HRGN hrgn
void Test_OffsetClipRgn()
Definition: OffsetClipRgn.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 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)