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
7fc0becf
Commit
7fc0becf
authored
Mar 12, 2007
by
Felix Nawothnig
Committed by
Alexandre Julliard
Mar 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add PS_ALTERNATE tests.
parent
aa685beb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
pen.c
dlls/gdi32/tests/pen.c
+56
-0
No files found.
dlls/gdi32/tests/pen.c
View file @
7fc0becf
...
...
@@ -28,6 +28,8 @@
#include "wine/test.h"
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
static
void
test_logpen
(
void
)
{
static
const
struct
...
...
@@ -427,7 +429,61 @@ else
}
}
static
unsigned
int
atoi2
(
const
char
*
s
)
{
unsigned
int
ret
=
0
;
while
(
*
s
)
ret
=
(
ret
<<
1
)
|
(
*
s
++
==
'1'
);
return
ret
;
}
#define TEST_LINE(x1, x2, z) \
{ int buf = 0; \
SetBitmapBits(bmp, sizeof(buf), &buf); \
MoveToEx(hdc, x1, 0, NULL); \
LineTo(hdc, x2, 0); \
GetBitmapBits(bmp, sizeof(buf), &buf); \
expect(atoi2(z), buf); }
static
void
test_ps_alternate
(
void
)
{
HDC
hdc
;
HBITMAP
bmp
;
HPEN
pen
;
LOGBRUSH
lb
;
lb
.
lbStyle
=
BS_SOLID
;
lb
.
lbColor
=
RGB
(
0xff
,
0xff
,
0xff
);
SetLastError
(
0xdeadbeef
);
pen
=
ExtCreatePen
(
PS_COSMETIC
|
PS_ALTERNATE
,
1
,
&
lb
,
0
,
NULL
);
if
(
pen
==
NULL
&&
GetLastError
()
==
0xdeadbeef
)
{
skip
(
"looks like 9x, skipping PS_ALTERNATE tests
\n
"
);
return
;
}
ok
(
pen
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
hdc
=
CreateCompatibleDC
(
NULL
);
ok
(
hdc
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
bmp
=
CreateBitmap
(
8
,
1
,
1
,
1
,
NULL
);
ok
(
bmp
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
ok
(
SelectObject
(
hdc
,
bmp
)
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
ok
(
SelectObject
(
hdc
,
pen
)
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
ok
(
SetBkMode
(
hdc
,
TRANSPARENT
),
"gle=%d
\n
"
,
GetLastError
());
TEST_LINE
(
0
,
1
,
"10000000"
)
TEST_LINE
(
0
,
2
,
"10000000"
)
TEST_LINE
(
0
,
3
,
"10100000"
)
TEST_LINE
(
0
,
4
,
"10100000"
)
TEST_LINE
(
1
,
4
,
"01010000"
)
TEST_LINE
(
1
,
5
,
"01010000"
)
TEST_LINE
(
4
,
8
,
"00001010"
)
DeleteObject
(
pen
);
DeleteObject
(
bmp
);
DeleteDC
(
hdc
);
}
START_TEST
(
pen
)
{
test_logpen
();
test_ps_alternate
();
}
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