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
c4ba8a8c
Commit
c4ba8a8c
authored
Aug 13, 2006
by
Benjamin Arai
Committed by
Alexandre Julliard
Aug 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Conformance test for olefont:ReleaseHfont.
parent
eb9f4603
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
2 deletions
+75
-2
olefont.c
dlls/oleaut32/tests/olefont.c
+75
-2
No files found.
dlls/oleaut32/tests/olefont.c
View file @
c4ba8a8c
...
...
@@ -599,6 +599,78 @@ static void test_IsEqual()
IFont_Release
(
ifnt
);
}
static
void
test_ReleaseHfont
(
void
)
{
FONTDESC
fd
;
static
const
WCHAR
system_font
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
0
};
static
const
WCHAR
arial_font
[]
=
{
'A'
,
'r'
,
'i'
,
'a'
,
'l'
,
0
};
LPVOID
pvObj1
=
NULL
;
LPVOID
pvObj2
=
NULL
;
IFont
*
ifnt1
=
NULL
;
IFont
*
ifnt2
=
NULL
;
HFONT
hfnt1
=
0
;
HFONT
hfnt2
=
0
;
HRESULT
hres
;
/* Basic font description */
fd
.
cbSizeofstruct
=
sizeof
(
FONTDESC
);
fd
.
lpstrName
=
(
WCHAR
*
)
system_font
;
S
(
fd
.
cySize
).
Lo
=
100
;
S
(
fd
.
cySize
).
Hi
=
100
;
fd
.
sWeight
=
0
;
fd
.
sCharset
=
0
;
fd
.
fItalic
=
0
;
fd
.
fUnderline
=
0
;
fd
.
fStrikethrough
=
0
;
/* Create HFONTs and IFONTs */
pOleCreateFontIndirect
(
&
fd
,
&
IID_IFont
,
&
pvObj1
);
ifnt1
=
pvObj1
;
IFont_get_hFont
(
ifnt1
,
&
hfnt1
);
fd
.
lpstrName
=
(
WCHAR
*
)
arial_font
;
pOleCreateFontIndirect
(
&
fd
,
&
IID_IFont
,
&
pvObj2
);
ifnt2
=
pvObj2
;
IFont_get_hFont
(
ifnt2
,
&
hfnt2
);
/* Try invalid HFONT */
hres
=
IFont_ReleaseHfont
(
ifnt1
,(
HFONT
)
0
);
ok
(
hres
==
E_INVALIDARG
,
"IFont_ReleaseHfont: (Bad HFONT) Expected E_INVALIDARG but got 0x%08lx
\n
"
,
hres
);
/* Try to add a bad HFONT */
hres
=
IFont_ReleaseHfont
(
ifnt1
,(
HFONT
)
32
);
todo_wine
{
ok
(
hres
==
S_FALSE
,
"IFont_ReleaseHfont: (Bad HFONT) Expected S_FALSE but got 0x%08lx
\n
"
,
hres
);}
/* Release all refs */
hres
=
IFont_ReleaseHfont
(
ifnt1
,
hfnt1
);
ok
(
hres
==
S_OK
,
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx
\n
"
,
hres
);
hres
=
IFont_ReleaseHfont
(
ifnt2
,
hfnt2
);
ok
(
hres
==
S_OK
,
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx
\n
"
,
hres
);
/* Check that both lists are empty */
hres
=
IFont_ReleaseHfont
(
ifnt1
,
hfnt1
);
todo_wine
{
ok
(
hres
==
S_FALSE
,
"IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08lx
\n
"
,
hres
);}
/* The list should be empty */
hres
=
IFont_ReleaseHfont
(
ifnt2
,
hfnt2
);
todo_wine
{
ok
(
hres
==
S_FALSE
,
"IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08lx
\n
"
,
hres
);}
IFont_Release
(
ifnt1
);
IFont_Release
(
ifnt2
);
}
START_TEST
(
olefont
)
{
hOleaut32
=
LoadLibraryA
(
"oleaut32.dll"
);
...
...
@@ -616,11 +688,12 @@ START_TEST(olefont)
test_ifont_sizes
(
180000
,
0
,
72
,
1270
,
-
36
,
"ratio2"
);
/* 2nd part of ratio */
/* These depend on details of how IFont rounds sizes internally. */
/* test_ifont_sizes(0, 0, 72, 2540, 0, "zero size"); */
/* zero size */
/* test_ifont_sizes(186000, 0, 72, 2540, -19, "rounding"); */
/* test rounding */
test_ifont_sizes
(
0
,
0
,
72
,
2540
,
0
,
"zero size"
);
/* zero size */
test_ifont_sizes
(
186000
,
0
,
72
,
2540
,
-
19
,
"rounding"
);
/* test rounding */
test_font_events_disp
();
test_GetIDsOfNames
();
test_Invoke
();
test_IsEqual
();
test_ReleaseHfont
();
}
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