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
56233536
Commit
56233536
authored
Jan 02, 2011
by
André Hentschel
Committed by
Alexandre Julliard
Jan 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Don't test function directly when reporting GetLastError().
parent
b49e1c29
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
25 deletions
+50
-25
font.c
dlls/gdi32/tests/font.c
+9
-3
gdiobj.c
dlls/gdi32/tests/gdiobj.c
+17
-11
metafile.c
dlls/gdi32/tests/metafile.c
+16
-8
pen.c
dlls/gdi32/tests/pen.c
+8
-3
No files found.
dlls/gdi32/tests/font.c
View file @
56233536
...
@@ -800,6 +800,7 @@ static void test_bitmap_font_metrics(void)
...
@@ -800,6 +800,7 @@ static void test_bitmap_font_metrics(void)
{
{
DWORD
fs
[
2
];
DWORD
fs
[
2
];
CHARSETINFO
csi
;
CHARSETINFO
csi
;
BOOL
bRet
;
fs
[
0
]
=
1L
<<
bit
;
fs
[
0
]
=
1L
<<
bit
;
fs
[
1
]
=
0
;
fs
[
1
]
=
0
;
...
@@ -812,7 +813,8 @@ static void test_bitmap_font_metrics(void)
...
@@ -812,7 +813,8 @@ static void test_bitmap_font_metrics(void)
hfont
=
create_font
(
lf
.
lfFaceName
,
&
lf
);
hfont
=
create_font
(
lf
.
lfFaceName
,
&
lf
);
old_hfont
=
SelectObject
(
hdc
,
hfont
);
old_hfont
=
SelectObject
(
hdc
,
hfont
);
ok
(
GetTextMetrics
(
hdc
,
&
tm
),
"GetTextMetrics error %d
\n
"
,
GetLastError
());
bRet
=
GetTextMetrics
(
hdc
,
&
tm
);
ok
(
bRet
,
"GetTextMetrics error %d
\n
"
,
GetLastError
());
if
(
fd
[
i
].
dpi
==
tm
.
tmDigitizedAspectX
)
if
(
fd
[
i
].
dpi
==
tm
.
tmDigitizedAspectX
)
{
{
trace
(
"found font %s, height %d charset %x dpi %d
\n
"
,
lf
.
lfFaceName
,
lf
.
lfHeight
,
lf
.
lfCharSet
,
fd
[
i
].
dpi
);
trace
(
"found font %s, height %d charset %x dpi %d
\n
"
,
lf
.
lfFaceName
,
lf
.
lfHeight
,
lf
.
lfCharSet
,
fd
[
i
].
dpi
);
...
@@ -1166,6 +1168,7 @@ static void test_GetKerningPairs(void)
...
@@ -1166,6 +1168,7 @@ static void test_GetKerningPairs(void)
for
(
i
=
0
;
i
<
sizeof
(
kd
)
/
sizeof
(
kd
[
0
]);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
kd
)
/
sizeof
(
kd
[
0
]);
i
++
)
{
{
OUTLINETEXTMETRICW
otm
;
OUTLINETEXTMETRICW
otm
;
UINT
uiRet
;
if
(
!
is_font_installed
(
kd
[
i
].
face_name
))
if
(
!
is_font_installed
(
kd
[
i
].
face_name
))
{
{
...
@@ -1185,7 +1188,8 @@ static void test_GetKerningPairs(void)
...
@@ -1185,7 +1188,8 @@ static void test_GetKerningPairs(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
otm
.
otmSize
=
sizeof
(
otm
);
/* just in case for Win9x compatibility */
otm
.
otmSize
=
sizeof
(
otm
);
/* just in case for Win9x compatibility */
ok
(
GetOutlineTextMetricsW
(
hdc
,
sizeof
(
otm
),
&
otm
)
==
sizeof
(
otm
),
"GetOutlineTextMetricsW error %d
\n
"
,
GetLastError
());
uiRet
=
GetOutlineTextMetricsW
(
hdc
,
sizeof
(
otm
),
&
otm
);
ok
(
uiRet
==
sizeof
(
otm
),
"GetOutlineTextMetricsW error %d
\n
"
,
GetLastError
());
ok
(
match_off_by_1
(
kd
[
i
].
tmHeight
,
otm
.
otmTextMetrics
.
tmHeight
),
"expected %d, got %d
\n
"
,
ok
(
match_off_by_1
(
kd
[
i
].
tmHeight
,
otm
.
otmTextMetrics
.
tmHeight
),
"expected %d, got %d
\n
"
,
kd
[
i
].
tmHeight
,
otm
.
otmTextMetrics
.
tmHeight
);
kd
[
i
].
tmHeight
,
otm
.
otmTextMetrics
.
tmHeight
);
...
@@ -3197,6 +3201,7 @@ static void test_AddFontMemResource(void)
...
@@ -3197,6 +3201,7 @@ static void test_AddFontMemResource(void)
void
*
font
;
void
*
font
;
DWORD
font_size
,
num_fonts
;
DWORD
font_size
,
num_fonts
;
HANDLE
ret
;
HANDLE
ret
;
BOOL
bRet
;
if
(
!
pAddFontMemResourceEx
||
!
pRemoveFontMemResourceEx
)
if
(
!
pAddFontMemResourceEx
||
!
pRemoveFontMemResourceEx
)
{
{
...
@@ -3284,7 +3289,8 @@ static void test_AddFontMemResource(void)
...
@@ -3284,7 +3289,8 @@ static void test_AddFontMemResource(void)
free_font
(
font
);
free_font
(
font
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ok
(
pRemoveFontMemResourceEx
(
ret
),
"RemoveFontMemResourceEx error %d
\n
"
,
GetLastError
());
bRet
=
pRemoveFontMemResourceEx
(
ret
);
ok
(
bRet
,
"RemoveFontMemResourceEx error %d
\n
"
,
GetLastError
());
/* test invalid pointer to number of loaded fonts */
/* test invalid pointer to number of loaded fonts */
font
=
load_font
(
"sserife.fon"
,
&
font_size
);
font
=
load_font
(
"sserife.fon"
,
&
font_size
);
...
...
dlls/gdi32/tests/gdiobj.c
View file @
56233536
...
@@ -118,6 +118,7 @@ struct hgdiobj_event
...
@@ -118,6 +118,7 @@ struct hgdiobj_event
static
DWORD
WINAPI
thread_proc
(
void
*
param
)
static
DWORD
WINAPI
thread_proc
(
void
*
param
)
{
{
LOGPEN
lp
;
LOGPEN
lp
;
DWORD
status
;
struct
hgdiobj_event
*
hgdiobj_event
=
param
;
struct
hgdiobj_event
*
hgdiobj_event
=
param
;
hgdiobj_event
->
hdc
=
CreateDC
(
"display"
,
NULL
,
NULL
,
NULL
);
hgdiobj_event
->
hdc
=
CreateDC
(
"display"
,
NULL
,
NULL
,
NULL
);
...
@@ -130,8 +131,8 @@ static DWORD WINAPI thread_proc(void *param)
...
@@ -130,8 +131,8 @@ static DWORD WINAPI thread_proc(void *param)
ok
(
hgdiobj_event
->
hgdiobj2
!=
0
,
"Failed to create pen
\n
"
);
ok
(
hgdiobj_event
->
hgdiobj2
!=
0
,
"Failed to create pen
\n
"
);
SetEvent
(
hgdiobj_event
->
ready_event
);
SetEvent
(
hgdiobj_event
->
ready_event
);
ok
(
WaitForSingleObject
(
hgdiobj_event
->
stop_event
,
INFINITE
)
==
WAIT_OBJECT_0
,
status
=
WaitForSingleObject
(
hgdiobj_event
->
stop_event
,
INFINITE
);
"WaitForSingleObject error %u
\n
"
,
GetLastError
());
ok
(
status
==
WAIT_OBJECT_0
,
"WaitForSingleObject error %u
\n
"
,
GetLastError
());
ok
(
!
GetObject
(
hgdiobj_event
->
hgdiobj1
,
sizeof
(
lp
),
&
lp
),
"GetObject should fail
\n
"
);
ok
(
!
GetObject
(
hgdiobj_event
->
hgdiobj1
,
sizeof
(
lp
),
&
lp
),
"GetObject should fail
\n
"
);
...
@@ -147,6 +148,8 @@ static void test_thread_objects(void)
...
@@ -147,6 +148,8 @@ static void test_thread_objects(void)
HANDLE
hthread
;
HANDLE
hthread
;
struct
hgdiobj_event
hgdiobj_event
;
struct
hgdiobj_event
hgdiobj_event
;
INT
ret
;
INT
ret
;
DWORD
status
;
BOOL
bRet
;
hgdiobj_event
.
stop_event
=
CreateEvent
(
NULL
,
0
,
0
,
NULL
);
hgdiobj_event
.
stop_event
=
CreateEvent
(
NULL
,
0
,
0
,
NULL
);
ok
(
hgdiobj_event
.
stop_event
!=
NULL
,
"CreateEvent error %u
\n
"
,
GetLastError
());
ok
(
hgdiobj_event
.
stop_event
!=
NULL
,
"CreateEvent error %u
\n
"
,
GetLastError
());
...
@@ -156,11 +159,11 @@ static void test_thread_objects(void)
...
@@ -156,11 +159,11 @@ static void test_thread_objects(void)
hthread
=
CreateThread
(
NULL
,
0
,
thread_proc
,
&
hgdiobj_event
,
0
,
&
tid
);
hthread
=
CreateThread
(
NULL
,
0
,
thread_proc
,
&
hgdiobj_event
,
0
,
&
tid
);
ok
(
hthread
!=
NULL
,
"CreateThread error %u
\n
"
,
GetLastError
());
ok
(
hthread
!=
NULL
,
"CreateThread error %u
\n
"
,
GetLastError
());
ok
(
WaitForSingleObject
(
hgdiobj_event
.
ready_event
,
INFINITE
)
==
WAIT_OBJECT_0
,
status
=
WaitForSingleObject
(
hgdiobj_event
.
ready_event
,
INFINITE
);
"WaitForSingleObject error %u
\n
"
,
GetLastError
());
ok
(
status
==
WAIT_OBJECT_0
,
"WaitForSingleObject error %u
\n
"
,
GetLastError
());
ok
(
GetObject
(
hgdiobj_event
.
hgdiobj1
,
sizeof
(
lp
),
&
lp
)
==
sizeof
(
lp
),
ret
=
GetObject
(
hgdiobj_event
.
hgdiobj1
,
sizeof
(
lp
),
&
lp
);
"GetObject error %u
\n
"
,
GetLastError
());
ok
(
ret
==
sizeof
(
lp
),
"GetObject error %u
\n
"
,
GetLastError
());
ok
(
lp
.
lopnStyle
==
PS_DASHDOTDOT
,
"wrong pen style %d
\n
"
,
lp
.
lopnStyle
);
ok
(
lp
.
lopnStyle
==
PS_DASHDOTDOT
,
"wrong pen style %d
\n
"
,
lp
.
lopnStyle
);
ok
(
lp
.
lopnWidth
.
x
==
17
,
"wrong pen width.y %d
\n
"
,
lp
.
lopnWidth
.
x
);
ok
(
lp
.
lopnWidth
.
x
==
17
,
"wrong pen width.y %d
\n
"
,
lp
.
lopnWidth
.
x
);
ok
(
lp
.
lopnWidth
.
y
==
0
,
"wrong pen width.y %d
\n
"
,
lp
.
lopnWidth
.
y
);
ok
(
lp
.
lopnWidth
.
y
==
0
,
"wrong pen width.y %d
\n
"
,
lp
.
lopnWidth
.
y
);
...
@@ -169,20 +172,23 @@ static void test_thread_objects(void)
...
@@ -169,20 +172,23 @@ static void test_thread_objects(void)
ret
=
GetDeviceCaps
(
hgdiobj_event
.
hdc
,
TECHNOLOGY
);
ret
=
GetDeviceCaps
(
hgdiobj_event
.
hdc
,
TECHNOLOGY
);
ok
(
ret
==
DT_RASDISPLAY
,
"GetDeviceCaps(TECHNOLOGY) should return DT_RASDISPLAY not %d
\n
"
,
ret
);
ok
(
ret
==
DT_RASDISPLAY
,
"GetDeviceCaps(TECHNOLOGY) should return DT_RASDISPLAY not %d
\n
"
,
ret
);
ok
(
DeleteObject
(
hgdiobj_event
.
hgdiobj1
),
"DeleteObject error %u
\n
"
,
GetLastError
());
bRet
=
DeleteObject
(
hgdiobj_event
.
hgdiobj1
);
ok
(
DeleteDC
(
hgdiobj_event
.
hdc
),
"DeleteDC error %u
\n
"
,
GetLastError
());
ok
(
bRet
,
"DeleteObject error %u
\n
"
,
GetLastError
());
bRet
=
DeleteDC
(
hgdiobj_event
.
hdc
);
ok
(
bRet
,
"DeleteDC error %u
\n
"
,
GetLastError
());
type
=
GetObjectType
(
hgdiobj_event
.
hgdiobj2
);
type
=
GetObjectType
(
hgdiobj_event
.
hgdiobj2
);
ok
(
type
==
OBJ_REGION
,
"GetObjectType returned %u
\n
"
,
type
);
ok
(
type
==
OBJ_REGION
,
"GetObjectType returned %u
\n
"
,
type
);
SetEvent
(
hgdiobj_event
.
stop_event
);
SetEvent
(
hgdiobj_event
.
stop_event
);
ok
(
WaitForSingleObject
(
hthread
,
INFINITE
)
==
WAIT_OBJECT_0
,
status
=
WaitForSingleObject
(
hthread
,
INFINITE
);
"WaitForSingleObject error %u
\n
"
,
GetLastError
());
ok
(
status
==
WAIT_OBJECT_0
,
"WaitForSingleObject error %u
\n
"
,
GetLastError
());
CloseHandle
(
hthread
);
CloseHandle
(
hthread
);
type
=
GetObjectType
(
hgdiobj_event
.
hgdiobj2
);
type
=
GetObjectType
(
hgdiobj_event
.
hgdiobj2
);
ok
(
type
==
OBJ_REGION
,
"GetObjectType returned %u
\n
"
,
type
);
ok
(
type
==
OBJ_REGION
,
"GetObjectType returned %u
\n
"
,
type
);
ok
(
DeleteObject
(
hgdiobj_event
.
hgdiobj2
),
"DeleteObject error %u
\n
"
,
GetLastError
());
bRet
=
DeleteObject
(
hgdiobj_event
.
hgdiobj2
);
ok
(
bRet
,
"DeleteObject error %u
\n
"
,
GetLastError
());
CloseHandle
(
hgdiobj_event
.
stop_event
);
CloseHandle
(
hgdiobj_event
.
stop_event
);
CloseHandle
(
hgdiobj_event
.
ready_event
);
CloseHandle
(
hgdiobj_event
.
ready_event
);
...
...
dlls/gdi32/tests/metafile.c
View file @
56233536
...
@@ -340,13 +340,17 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
...
@@ -340,13 +340,17 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
ret
=
GetWorldTransform
(
hdc
,
&
xform
);
ret
=
GetWorldTransform
(
hdc
,
&
xform
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
if
(
!
ret
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
{
ok
(
GetWindowOrgEx
(
hdc
,
&
pt
),
"GetWindowOrgEx error %u
\n
"
,
GetLastError
());
ret
=
GetWindowOrgEx
(
hdc
,
&
pt
);
ok
(
ret
,
"GetWindowOrgEx error %u
\n
"
,
GetLastError
());
trace
(
"window org (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
);
trace
(
"window org (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
);
ok
(
GetViewportOrgEx
(
hdc
,
&
pt
),
"GetViewportOrgEx error %u
\n
"
,
GetLastError
());
ret
=
GetViewportOrgEx
(
hdc
,
&
pt
);
ok
(
ret
,
"GetViewportOrgEx error %u
\n
"
,
GetLastError
());
trace
(
"vport org (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
);
trace
(
"vport org (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
);
ok
(
GetWindowExtEx
(
hdc
,
&
size
),
"GetWindowExtEx error %u
\n
"
,
GetLastError
());
ret
=
GetWindowExtEx
(
hdc
,
&
size
);
ok
(
ret
,
"GetWindowExtEx error %u
\n
"
,
GetLastError
());
trace
(
"window ext (%d,%d)
\n
"
,
size
.
cx
,
size
.
cy
);
trace
(
"window ext (%d,%d)
\n
"
,
size
.
cx
,
size
.
cy
);
ok
(
GetViewportExtEx
(
hdc
,
&
size
),
"GetViewportExtEx error %u
\n
"
,
GetLastError
());
ret
=
GetViewportExtEx
(
hdc
,
&
size
);
ok
(
ret
,
"GetViewportExtEx error %u
\n
"
,
GetLastError
());
trace
(
"vport ext (%d,%d)
\n
"
,
size
.
cx
,
size
.
cy
);
trace
(
"vport ext (%d,%d)
\n
"
,
size
.
cx
,
size
.
cy
);
}
}
else
else
...
@@ -458,13 +462,17 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
...
@@ -458,13 +462,17 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
ret
=
GetWorldTransform
(
hdc
,
&
xform
);
ret
=
GetWorldTransform
(
hdc
,
&
xform
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
if
(
!
ret
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
{
ok
(
GetWindowOrgEx
(
hdc
,
&
pt
),
"GetWindowOrgEx error %u
\n
"
,
GetLastError
());
ret
=
GetWindowOrgEx
(
hdc
,
&
pt
);
ok
(
ret
,
"GetWindowOrgEx error %u
\n
"
,
GetLastError
());
trace
(
"window org (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
);
trace
(
"window org (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
);
ok
(
GetViewportOrgEx
(
hdc
,
&
pt
),
"GetViewportOrgEx error %u
\n
"
,
GetLastError
());
ret
=
GetViewportOrgEx
(
hdc
,
&
pt
);
ok
(
ret
,
"GetViewportOrgEx error %u
\n
"
,
GetLastError
());
trace
(
"vport org (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
);
trace
(
"vport org (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
);
ok
(
GetWindowExtEx
(
hdc
,
&
size
),
"GetWindowExtEx error %u
\n
"
,
GetLastError
());
ret
=
GetWindowExtEx
(
hdc
,
&
size
);
ok
(
ret
,
"GetWindowExtEx error %u
\n
"
,
GetLastError
());
trace
(
"window ext (%d,%d)
\n
"
,
size
.
cx
,
size
.
cy
);
trace
(
"window ext (%d,%d)
\n
"
,
size
.
cx
,
size
.
cy
);
ok
(
GetViewportExtEx
(
hdc
,
&
size
),
"GetViewportExtEx error %u
\n
"
,
GetLastError
());
ret
=
GetViewportExtEx
(
hdc
,
&
size
);
ok
(
ret
,
"GetViewportExtEx error %u
\n
"
,
GetLastError
());
trace
(
"vport ext (%d,%d)
\n
"
,
size
.
cx
,
size
.
cy
);
trace
(
"vport ext (%d,%d)
\n
"
,
size
.
cx
,
size
.
cy
);
}
}
else
else
...
...
dlls/gdi32/tests/pen.c
View file @
56233536
...
@@ -475,6 +475,8 @@ static void test_ps_alternate(void)
...
@@ -475,6 +475,8 @@ static void test_ps_alternate(void)
HBITMAP
bmp
;
HBITMAP
bmp
;
HPEN
pen
;
HPEN
pen
;
LOGBRUSH
lb
;
LOGBRUSH
lb
;
INT
iRet
;
HGDIOBJ
hRet
;
lb
.
lbStyle
=
BS_SOLID
;
lb
.
lbStyle
=
BS_SOLID
;
lb
.
lbColor
=
RGB
(
0xff
,
0xff
,
0xff
);
lb
.
lbColor
=
RGB
(
0xff
,
0xff
,
0xff
);
...
@@ -490,9 +492,12 @@ static void test_ps_alternate(void)
...
@@ -490,9 +492,12 @@ static void test_ps_alternate(void)
ok
(
hdc
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
ok
(
hdc
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
bmp
=
CreateBitmap
(
8
,
1
,
1
,
1
,
NULL
);
bmp
=
CreateBitmap
(
8
,
1
,
1
,
1
,
NULL
);
ok
(
bmp
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
ok
(
bmp
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
ok
(
SelectObject
(
hdc
,
bmp
)
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
hRet
=
SelectObject
(
hdc
,
bmp
);
ok
(
SelectObject
(
hdc
,
pen
)
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
ok
(
hRet
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
ok
(
SetBkMode
(
hdc
,
TRANSPARENT
),
"gle=%d
\n
"
,
GetLastError
());
hRet
=
SelectObject
(
hdc
,
pen
);
ok
(
hRet
!=
NULL
,
"gle=%d
\n
"
,
GetLastError
());
iRet
=
SetBkMode
(
hdc
,
TRANSPARENT
);
ok
(
iRet
,
"gle=%d
\n
"
,
GetLastError
());
TEST_LINE
(
0
,
1
,
"10000000"
)
TEST_LINE
(
0
,
1
,
"10000000"
)
TEST_LINE
(
0
,
2
,
"10000000"
)
TEST_LINE
(
0
,
2
,
"10000000"
)
...
...
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