ReactOS  0.4.14-dev-1314-gacf135d
SetBrushOrgEx.c File Reference
#include "precomp.h"
Include dependency graph for SetBrushOrgEx.c:

Go to the source code of this file.

Macros

#define TEST_SET(hdc, x, y, ppt, bExp, dwErrExp)   Test_Set(__LINE__, hdc, x, y, ppt, bExp, dwErrExp)
 

Functions

void Test_Set (ULONG ulLine, HDC hdc, INT x, INT y, LPPOINT ppt, BOOL bExp, DWORD dwErrExp)
 
void Test_SetBrushOrgEx ()
 
 START_TEST (SetBrushOrgEx)
 

Macro Definition Documentation

◆ TEST_SET

#define TEST_SET (   hdc,
  x,
  y,
  ppt,
  bExp,
  dwErrExp 
)    Test_Set(__LINE__, hdc, x, y, ppt, bExp, dwErrExp)

Definition at line 32 of file SetBrushOrgEx.c.

Function Documentation

◆ START_TEST()

START_TEST ( SetBrushOrgEx  )

Definition at line 70 of file SetBrushOrgEx.c.

71 {
73 }
void Test_SetBrushOrgEx()
Definition: SetBrushOrgEx.c:35

◆ Test_Set()

void Test_Set ( ULONG  ulLine,
HDC  hdc,
INT  x,
INT  y,
LPPOINT  ppt,
BOOL  bExp,
DWORD  dwErrExp 
)

Definition at line 10 of file SetBrushOrgEx.c.

11 {
12  BOOL bResult;
13 
14  SetLastError(0);
15 
16  _SEH2_TRY
17  {
18  bResult = SetBrushOrgEx(hdc, x, y, ppt);
19  }
20  _SEH2_EXCEPT(1)
21  {
22  bResult = -1;
23  }
24  _SEH2_END;
25 
26  ok(bResult == bExp, "line %ld: Wrong result, expected %d, got %d\n",
27  ulLine, bExp, bResult);
28  ok(GetLastError() == dwErrExp,"line %ld: Wrong error, expected %lx, got %lx\n",
29  ulLine, dwErrExp, GetLastError());
30 }
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
_SEH2_TRY
Definition: create.c:4250
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI SetBrushOrgEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define SetLastError(x)
Definition: compat.h:417
HDC hdc
Definition: main.c:9
_SEH2_END
Definition: create.c:4424
#define ok(value,...)
Definition: atltest.h:57
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6

◆ Test_SetBrushOrgEx()

void Test_SetBrushOrgEx ( )

Definition at line 35 of file SetBrushOrgEx.c.

36 {
37  HDC hdc;
38  POINT ptOldOrg;
39 
41  ok(hdc != 0, "could not ceate DC\n");
42 
43  TEST_SET(0, 0, 0, NULL, 0, ERROR_INVALID_HANDLE);
44  TEST_SET(0, 0, 0, (LPPOINT)-1, 0, ERROR_INVALID_HANDLE);
45  TEST_SET(0, 0, 0, &ptOldOrg, 0, ERROR_INVALID_HANDLE);
46  TEST_SET(hdc, 1, 2, &ptOldOrg, 1, 0);
47  ok_long(ptOldOrg.x, 0);
48  ok_long(ptOldOrg.y, 0);
49  SetBrushOrgEx(hdc, 0, 0, &ptOldOrg);
50  ok_long(ptOldOrg.x, 1);
51  ok_long(ptOldOrg.y, 2);
52 
53  ptOldOrg.x = 0; ptOldOrg.y = 0;
54  TEST_SET(hdc, 1, 2, (LPPOINT)-1, -1, 0);
55  SetBrushOrgEx(hdc, 0, 0, &ptOldOrg);
56  ok_long(ptOldOrg.x, 0);
57  ok_long(ptOldOrg.y, 0);
58 
59 
60  TEST_SET(hdc, -10000, -20000000, &ptOldOrg, 1, 0);
61  ok_long(ptOldOrg.x, 0);
62  ok_long(ptOldOrg.y, 0);
63  SetBrushOrgEx(hdc, 0, 0, &ptOldOrg);
64  ok_long(ptOldOrg.x, -10000);
65  ok_long(ptOldOrg.y, -20000000);
66 
67 
68 }
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
static HDC
Definition: imagelist.c:92
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define ok_long(expression, result)
Definition: atltest.h:133
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI SetBrushOrgEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HDC hdc
Definition: main.c:9
#define ok(value,...)
Definition: atltest.h:57
#define TEST_SET(hdc, x, y, ppt, bExp, dwErrExp)
Definition: SetBrushOrgEx.c:32

Referenced by START_TEST().