mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:45:50 +00:00
[GDI32_APITEST]
Add tests for SetBrushOrgEx svn path=/trunk/; revision=56485
This commit is contained in:
parent
5aa9b26f83
commit
a97d8f8aee
1 changed files with 76 additions and 0 deletions
76
rostests/apitests/gdi32/SetBrushOrgEx.c
Normal file
76
rostests/apitests/gdi32/SetBrushOrgEx.c
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* PROJECT: ReactOS api tests
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* PURPOSE: Test for SetBrushOrgEx
|
||||
* PROGRAMMERS: Timo Kreuzer
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <wine/test.h>
|
||||
#include <windows.h>
|
||||
|
||||
void Test_Set(ULONG ulLine, HDC hdc, INT x, INT y, LPPOINT ppt, BOOL bExp, DWORD dwErrExp)
|
||||
{
|
||||
BOOL bResult;
|
||||
|
||||
SetLastError(0);
|
||||
|
||||
_SEH2_TRY
|
||||
{
|
||||
bResult = SetBrushOrgEx(hdc, x, y, ppt);
|
||||
}
|
||||
_SEH2_EXCEPT(1)
|
||||
{
|
||||
bResult = -1;
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
ok(bResult == bExp, "line %ld: Wrong result, expected %ld, got %ld\n",
|
||||
ulLine, bExp, bResult);
|
||||
ok(GetLastError() == dwErrExp,"line %ld: Wrong error, expected %lx, got %lx\n",
|
||||
ulLine, dwErrExp, GetLastError());
|
||||
}
|
||||
|
||||
#define TEST_SET(hdc, x, y, ppt, bExp, dwErrExp) \
|
||||
Test_Set(__LINE__, hdc, x, y, ppt, bExp, dwErrExp)
|
||||
|
||||
void Test_SetBrushOrgEx()
|
||||
{
|
||||
HDC hdc;
|
||||
POINT ptOldOrg;
|
||||
|
||||
hdc = CreateCompatibleDC(0);
|
||||
ok(hdc != 0, "could not ceate DC\n");
|
||||
|
||||
TEST_SET(0, 0, 0, NULL, 0, ERROR_INVALID_HANDLE);
|
||||
TEST_SET(0, 0, 0, (LPPOINT)-1, 0, ERROR_INVALID_HANDLE);
|
||||
TEST_SET(0, 0, 0, &ptOldOrg, 0, ERROR_INVALID_HANDLE);
|
||||
TEST_SET(hdc, 1, 2, &ptOldOrg, 1, 0);
|
||||
ok_long(ptOldOrg.x, 0);
|
||||
ok_long(ptOldOrg.y, 0);
|
||||
SetBrushOrgEx(hdc, 0, 0, &ptOldOrg);
|
||||
ok_long(ptOldOrg.x, 1);
|
||||
ok_long(ptOldOrg.y, 2);
|
||||
|
||||
ptOldOrg.x = 0; ptOldOrg.y = 0;
|
||||
TEST_SET(hdc, 1, 2, (LPPOINT)-1, -1, 0);
|
||||
SetBrushOrgEx(hdc, 0, 0, &ptOldOrg);
|
||||
ok_long(ptOldOrg.x, 0);
|
||||
ok_long(ptOldOrg.y, 0);
|
||||
|
||||
|
||||
TEST_SET(hdc, -10000, -20000000, &ptOldOrg, 1, 0);
|
||||
ok_long(ptOldOrg.x, 0);
|
||||
ok_long(ptOldOrg.y, 0);
|
||||
SetBrushOrgEx(hdc, 0, 0, &ptOldOrg);
|
||||
ok_long(ptOldOrg.x, -10000);
|
||||
ok_long(ptOldOrg.y, -20000000);
|
||||
|
||||
|
||||
}
|
||||
|
||||
START_TEST(SetBrushOrgEx)
|
||||
{
|
||||
Test_SetBrushOrgEx();
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue