ReactOS 0.4.15-dev-8096-ga0eec98
SetBrushOrgEx.c File Reference
#include "precomp.h"
#include <pseh/pseh2.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 34 of file SetBrushOrgEx.c.

Function Documentation

◆ START_TEST()

START_TEST ( SetBrushOrgEx  )

Definition at line 72 of file SetBrushOrgEx.c.

73{
75}
void Test_SetBrushOrgEx()
Definition: SetBrushOrgEx.c:37

◆ Test_Set()

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

Definition at line 12 of file SetBrushOrgEx.c.

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

◆ Test_SetBrushOrgEx()

void Test_SetBrushOrgEx ( )

Definition at line 37 of file SetBrushOrgEx.c.

38{
39 HDC hdc;
40 POINT ptOldOrg;
41
43 ok(hdc != 0, "could not ceate DC\n");
44
46 TEST_SET(0, 0, 0, (LPPOINT)-1, 0, ERROR_INVALID_HANDLE);
47 TEST_SET(0, 0, 0, &ptOldOrg, 0, ERROR_INVALID_HANDLE);
48 TEST_SET(hdc, 1, 2, &ptOldOrg, 1, 0);
49 ok_long(ptOldOrg.x, 0);
50 ok_long(ptOldOrg.y, 0);
51 SetBrushOrgEx(hdc, 0, 0, &ptOldOrg);
52 ok_long(ptOldOrg.x, 1);
53 ok_long(ptOldOrg.y, 2);
54
55 ptOldOrg.x = 0; ptOldOrg.y = 0;
56 TEST_SET(hdc, 1, 2, (LPPOINT)-1, -1, 0);
57 SetBrushOrgEx(hdc, 0, 0, &ptOldOrg);
58 ok_long(ptOldOrg.x, 0);
59 ok_long(ptOldOrg.y, 0);
60
61
62 TEST_SET(hdc, -10000, -20000000, &ptOldOrg, 1, 0);
63 ok_long(ptOldOrg.x, 0);
64 ok_long(ptOldOrg.y, 0);
65 SetBrushOrgEx(hdc, 0, 0, &ptOldOrg);
66 ok_long(ptOldOrg.x, -10000);
67 ok_long(ptOldOrg.y, -20000000);
68
69
70}
#define TEST_SET(hdc, x, y, ppt, bExp, dwErrExp)
Definition: SetBrushOrgEx.c:34
#define ok_long(expression, result)
Definition: atltest.h:133
#define NULL
Definition: types.h:112
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static HDC
Definition: imagelist.c:92
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)

Referenced by START_TEST().