Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0a225750
Commit
0a225750
authored
Jul 10, 2008
by
Adam Petaccia
Committed by
Alexandre Julliard
Jul 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add another helper macro to deal with magic numbers.
parent
e253d6a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
region.c
dlls/gdiplus/tests/region.c
+18
-15
No files found.
dlls/gdiplus/tests/region.c
View file @
0a225750
...
@@ -29,9 +29,12 @@
...
@@ -29,9 +29,12 @@
#define RGNDATA_INFINITE_RECT 0x10000003
#define RGNDATA_INFINITE_RECT 0x10000003
#define RGNDATA_MAGIC 0xdbc01001
#define RGNDATA_MAGIC 0xdbc01001
#define RGNDATA_MAGIC2 0xdbc01002
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
#define expect_magic(value) ok(*value == RGNDATA_MAGIC || *value == RGNDATA_MAGIC2, "Expected a known magic value, got %8x\n", *value)
static
inline
void
expect_dword
(
DWORD
*
value
,
DWORD
expected
)
static
inline
void
expect_dword
(
DWORD
*
value
,
DWORD
expected
)
{
{
ok
(
*
value
==
expected
,
"expected %08x got %08x
\n
"
,
expected
,
*
value
);
ok
(
*
value
==
expected
,
"expected %08x got %08x
\n
"
,
expected
,
*
value
);
...
@@ -73,7 +76,7 @@ todo_wine
...
@@ -73,7 +76,7 @@ todo_wine
ok
(
needed
==
20
,
"got %d
\n
"
,
needed
);
ok
(
needed
==
20
,
"got %d
\n
"
,
needed
);
expect_dword
(
buf
,
12
);
expect_dword
(
buf
,
12
);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
expect_
dword
(
buf
+
2
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
2
)
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
4
,
RGNDATA_INFINITE_RECT
);
expect_dword
(
buf
+
4
,
RGNDATA_INFINITE_RECT
);
...
@@ -87,7 +90,7 @@ todo_wine
...
@@ -87,7 +90,7 @@ todo_wine
ok
(
needed
==
20
,
"got %d
\n
"
,
needed
);
ok
(
needed
==
20
,
"got %d
\n
"
,
needed
);
expect_dword
(
buf
,
12
);
expect_dword
(
buf
,
12
);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
expect_
dword
(
buf
+
2
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
2
)
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
4
,
RGNDATA_EMPTY_RECT
);
expect_dword
(
buf
+
4
,
RGNDATA_EMPTY_RECT
);
...
@@ -101,7 +104,7 @@ todo_wine
...
@@ -101,7 +104,7 @@ todo_wine
ok
(
needed
==
20
,
"got %d
\n
"
,
needed
);
ok
(
needed
==
20
,
"got %d
\n
"
,
needed
);
expect_dword
(
buf
,
12
);
expect_dword
(
buf
,
12
);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
expect_
dword
(
buf
+
2
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
2
)
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
4
,
RGNDATA_INFINITE_RECT
);
expect_dword
(
buf
+
4
,
RGNDATA_INFINITE_RECT
);
...
@@ -122,7 +125,7 @@ todo_wine
...
@@ -122,7 +125,7 @@ todo_wine
ok
(
needed
==
36
,
"got %d
\n
"
,
needed
);
ok
(
needed
==
36
,
"got %d
\n
"
,
needed
);
expect_dword
(
buf
,
28
);
expect_dword
(
buf
,
28
);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
expect_
dword
(
buf
+
2
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
2
)
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
4
,
RGNDATA_RECT
);
expect_dword
(
buf
+
4
,
RGNDATA_RECT
);
expect_float
(
buf
+
5
,
10
.
0
);
expect_float
(
buf
+
5
,
10
.
0
);
...
@@ -174,7 +177,7 @@ todo_wine
...
@@ -174,7 +177,7 @@ todo_wine
ok
(
needed
==
156
,
"got %d
\n
"
,
needed
);
ok
(
needed
==
156
,
"got %d
\n
"
,
needed
);
expect_dword
(
buf
,
148
);
expect_dword
(
buf
,
148
);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
expect_
dword
(
buf
+
2
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
2
)
);
expect_dword
(
buf
+
3
,
10
);
expect_dword
(
buf
+
3
,
10
);
expect_dword
(
buf
+
4
,
CombineModeExclude
);
expect_dword
(
buf
+
4
,
CombineModeExclude
);
expect_dword
(
buf
+
5
,
CombineModeComplement
);
expect_dword
(
buf
+
5
,
CombineModeComplement
);
...
@@ -234,11 +237,11 @@ todo_wine
...
@@ -234,11 +237,11 @@ todo_wine
ok
(
needed
==
72
,
"got %d
\n
"
,
needed
);
ok
(
needed
==
72
,
"got %d
\n
"
,
needed
);
expect_dword
(
buf
,
64
);
expect_dword
(
buf
,
64
);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
expect_
dword
(
buf
+
2
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
2
)
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
4
,
RGNDATA_PATH
);
expect_dword
(
buf
+
4
,
RGNDATA_PATH
);
expect_dword
(
buf
+
5
,
0x00000030
);
expect_dword
(
buf
+
5
,
0x00000030
);
expect_
dword
(
buf
+
6
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
6
)
);
expect_dword
(
buf
+
7
,
0x00000004
);
expect_dword
(
buf
+
7
,
0x00000004
);
expect_dword
(
buf
+
8
,
0x00000000
);
expect_dword
(
buf
+
8
,
0x00000000
);
expect_float
(
buf
+
9
,
12
.
5
);
expect_float
(
buf
+
9
,
12
.
5
);
...
@@ -266,12 +269,12 @@ todo_wine
...
@@ -266,12 +269,12 @@ todo_wine
ok
(
needed
==
96
,
"got %d
\n
"
,
needed
);
ok
(
needed
==
96
,
"got %d
\n
"
,
needed
);
expect_dword
(
buf
,
88
);
expect_dword
(
buf
,
88
);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
expect_
dword
(
buf
+
2
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
2
)
);
expect_dword
(
buf
+
3
,
2
);
expect_dword
(
buf
+
3
,
2
);
expect_dword
(
buf
+
4
,
CombineModeIntersect
);
expect_dword
(
buf
+
4
,
CombineModeIntersect
);
expect_dword
(
buf
+
5
,
RGNDATA_PATH
);
expect_dword
(
buf
+
5
,
RGNDATA_PATH
);
expect_dword
(
buf
+
6
,
0x00000030
);
expect_dword
(
buf
+
6
,
0x00000030
);
expect_
dword
(
buf
+
7
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
7
)
);
expect_dword
(
buf
+
8
,
0x00000004
);
expect_dword
(
buf
+
8
,
0x00000004
);
expect_dword
(
buf
+
9
,
0x00000000
);
expect_dword
(
buf
+
9
,
0x00000000
);
expect_float
(
buf
+
10
,
12
.
5
);
expect_float
(
buf
+
10
,
12
.
5
);
...
@@ -307,13 +310,13 @@ todo_wine
...
@@ -307,13 +310,13 @@ todo_wine
ok
(
needed
==
36
,
"got %d
\n
"
,
needed
);
ok
(
needed
==
36
,
"got %d
\n
"
,
needed
);
expect_dword
(
buf
,
28
);
expect_dword
(
buf
,
28
);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
expect_
dword
(
buf
+
2
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
2
)
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
4
,
RGNDATA_PATH
);
expect_dword
(
buf
+
4
,
RGNDATA_PATH
);
/* Second signature for pathdata */
/* Second signature for pathdata */
expect_dword
(
buf
+
5
,
12
);
expect_dword
(
buf
+
5
,
12
);
expect_
dword
(
buf
+
6
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
6
)
);
expect_dword
(
buf
+
7
,
0
);
expect_dword
(
buf
+
7
,
0
);
expect_dword
(
buf
+
8
,
0x00004000
);
expect_dword
(
buf
+
8
,
0x00004000
);
...
@@ -338,12 +341,12 @@ todo_wine
...
@@ -338,12 +341,12 @@ todo_wine
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
expect_dword
(
buf
,
48
);
expect_dword
(
buf
,
48
);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
expect_
dword
(
buf
+
2
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
2
)
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
4
,
RGNDATA_PATH
);
expect_dword
(
buf
+
4
,
RGNDATA_PATH
);
expect_dword
(
buf
+
5
,
32
);
expect_dword
(
buf
+
5
,
32
);
expect_
dword
(
buf
+
6
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
6
)
);
expect_dword
(
buf
+
7
,
4
);
expect_dword
(
buf
+
7
,
4
);
expect_dword
(
buf
+
8
,
0x00004000
);
/* ?? */
expect_dword
(
buf
+
8
,
0x00004000
);
/* ?? */
...
@@ -380,12 +383,12 @@ todo_wine
...
@@ -380,12 +383,12 @@ todo_wine
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
expect_dword
(
buf
,
64
);
expect_dword
(
buf
,
64
);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
trace
(
"buf[1] = %08x
\n
"
,
buf
[
1
]);
expect_
dword
(
buf
+
2
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
2
)
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
3
,
0
);
expect_dword
(
buf
+
4
,
RGNDATA_PATH
);
expect_dword
(
buf
+
4
,
RGNDATA_PATH
);
expect_dword
(
buf
+
5
,
48
);
expect_dword
(
buf
+
5
,
48
);
expect_
dword
(
buf
+
6
,
RGNDATA_MAGIC
);
expect_
magic
((
DWORD
*
)(
buf
+
6
)
);
expect_dword
(
buf
+
7
,
4
);
expect_dword
(
buf
+
7
,
4
);
expect_dword
(
buf
+
8
,
0
);
expect_dword
(
buf
+
8
,
0
);
expect_float
(
buf
+
9
,
5
.
6
);
expect_float
(
buf
+
9
,
5
.
6
);
...
...
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