Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b9f18b34
Commit
b9f18b34
authored
Nov 02, 2014
by
Amine Khaldi
Committed by
Alexandre Julliard
Nov 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Add basic tests for the handling of dwCount parameter in ExtCreateRegion.
parent
b5a405af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletion
+35
-1
clipping.c
dlls/gdi32/tests/clipping.c
+35
-1
No files found.
dlls/gdi32/tests/clipping.c
View file @
b9f18b34
...
@@ -184,11 +184,12 @@ static void test_ExtCreateRegion(void)
...
@@ -184,11 +184,12 @@ static void test_ExtCreateRegion(void)
{
{
static
const
RECT
empty_rect
;
static
const
RECT
empty_rect
;
static
const
RECT
rc
=
{
111
,
222
,
333
,
444
};
static
const
RECT
rc
=
{
111
,
222
,
333
,
444
};
static
const
RECT
arc
[
2
]
=
{
{
0
,
0
,
10
,
10
},
{
10
,
10
,
20
,
20
}};
static
const
RECT
rc_xformed
=
{
76
,
151
,
187
,
262
};
static
const
RECT
rc_xformed
=
{
76
,
151
,
187
,
262
};
union
union
{
{
RGNDATA
data
;
RGNDATA
data
;
char
buf
[
sizeof
(
RGNDATAHEADER
)
+
sizeof
(
RECT
)];
char
buf
[
sizeof
(
RGNDATAHEADER
)
+
2
*
sizeof
(
RECT
)];
}
rgn
;
}
rgn
;
HRGN
hrgn
;
HRGN
hrgn
;
XFORM
xform
;
XFORM
xform
;
...
@@ -224,6 +225,20 @@ static void test_ExtCreateRegion(void)
...
@@ -224,6 +225,20 @@ static void test_ExtCreateRegion(void)
rgn
.
data
.
rdh
.
iType
=
RDH_RECTANGLES
;
rgn
.
data
.
rdh
.
iType
=
RDH_RECTANGLES
;
rgn
.
data
.
rdh
.
dwSize
=
sizeof
(
rgn
.
data
.
rdh
);
rgn
.
data
.
rdh
.
dwSize
=
sizeof
(
rgn
.
data
.
rdh
);
/* sizeof(RGNDATAHEADER) is large enough */
SetLastError
(
0xdeadbeef
);
hrgn
=
ExtCreateRegion
(
NULL
,
sizeof
(
RGNDATAHEADER
),
&
rgn
.
data
);
ok
(
hrgn
!=
0
,
"ExtCreateRegion error %u
\n
"
,
GetLastError
());
verify_region
(
hrgn
,
&
empty_rect
);
DeleteObject
(
hrgn
);
/* Cannot be smaller than sizeof(RGNDATAHEADER) */
SetLastError
(
0xdeadbeef
);
hrgn
=
ExtCreateRegion
(
NULL
,
sizeof
(
RGNDATAHEADER
)
-
1
,
&
rgn
.
data
);
todo_wine
ok
(
!
hrgn
,
"ExtCreateRegion should fail
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"0xdeadbeef, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hrgn
=
ExtCreateRegion
(
NULL
,
sizeof
(
rgn
),
&
rgn
.
data
);
hrgn
=
ExtCreateRegion
(
NULL
,
sizeof
(
rgn
),
&
rgn
.
data
);
ok
(
hrgn
!=
0
,
"ExtCreateRegion error %u
\n
"
,
GetLastError
());
ok
(
hrgn
!=
0
,
"ExtCreateRegion error %u
\n
"
,
GetLastError
());
...
@@ -234,6 +249,13 @@ static void test_ExtCreateRegion(void)
...
@@ -234,6 +249,13 @@ static void test_ExtCreateRegion(void)
SetRectEmpty
(
&
rgn
.
data
.
rdh
.
rcBound
);
SetRectEmpty
(
&
rgn
.
data
.
rdh
.
rcBound
);
memcpy
(
rgn
.
data
.
Buffer
,
&
rc
,
sizeof
(
rc
));
memcpy
(
rgn
.
data
.
Buffer
,
&
rc
,
sizeof
(
rc
));
/* With a single rect this seems to work... */
SetLastError
(
0xdeadbeef
);
hrgn
=
ExtCreateRegion
(
NULL
,
sizeof
(
RGNDATAHEADER
)
+
sizeof
(
RECT
)
-
1
,
&
rgn
.
data
);
ok
(
hrgn
!=
0
,
"ExtCreateRegion error %u
\n
"
,
GetLastError
());
verify_region
(
hrgn
,
&
rc
);
DeleteObject
(
hrgn
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hrgn
=
ExtCreateRegion
(
NULL
,
sizeof
(
rgn
),
&
rgn
.
data
);
hrgn
=
ExtCreateRegion
(
NULL
,
sizeof
(
rgn
),
&
rgn
.
data
);
ok
(
hrgn
!=
0
,
"ExtCreateRegion error %u
\n
"
,
GetLastError
());
ok
(
hrgn
!=
0
,
"ExtCreateRegion error %u
\n
"
,
GetLastError
());
...
@@ -267,6 +289,18 @@ static void test_ExtCreateRegion(void)
...
@@ -267,6 +289,18 @@ static void test_ExtCreateRegion(void)
ok
(
hrgn
!=
0
,
"ExtCreateRegion error %u/%x
\n
"
,
GetLastError
(),
GetLastError
());
ok
(
hrgn
!=
0
,
"ExtCreateRegion error %u/%x
\n
"
,
GetLastError
(),
GetLastError
());
verify_region
(
hrgn
,
&
rc_xformed
);
verify_region
(
hrgn
,
&
rc_xformed
);
DeleteObject
(
hrgn
);
DeleteObject
(
hrgn
);
rgn
.
data
.
rdh
.
nCount
=
2
;
SetRectEmpty
(
&
rgn
.
data
.
rdh
.
rcBound
);
memcpy
(
rgn
.
data
.
Buffer
,
arc
,
sizeof
(
arc
));
/* Buffer cannot be smaller than sizeof(RGNDATAHEADER) + 2 * sizeof(RECT) */
SetLastError
(
0xdeadbeef
);
hrgn
=
ExtCreateRegion
(
NULL
,
sizeof
(
RGNDATAHEADER
)
+
2
*
sizeof
(
RECT
)
-
1
,
&
rgn
.
data
);
todo_wine
ok
(
!
hrgn
,
"ExtCreateRegion should fail
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"0xdeadbeef, got %u
\n
"
,
GetLastError
());
}
}
static
void
test_GetClipRgn
(
void
)
static
void
test_GetClipRgn
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment