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
bf686702
Commit
bf686702
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:AddRefHfont.
parent
c4ba8a8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
136 additions
and
0 deletions
+136
-0
olefont.c
dlls/oleaut32/tests/olefont.c
+136
-0
No files found.
dlls/oleaut32/tests/olefont.c
View file @
bf686702
...
...
@@ -671,6 +671,141 @@ static void test_ReleaseHfont(void)
IFont_Release
(
ifnt2
);
}
static
void
test_AddRefHfont
(
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
;
LPVOID
pvObj3
=
NULL
;
IFont
*
ifnt1
=
NULL
;
IFont
*
ifnt2
=
NULL
;
IFont
*
ifnt3
=
NULL
;
HFONT
hfnt1
=
0
;
HFONT
hfnt2
=
0
;
HFONT
hfnt3
=
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_AddRefHfont
(
ifnt1
,(
HFONT
)
0
);
ok
(
hres
==
E_INVALIDARG
,
"IFont_AddRefHfont: (Bad HFONT) Expected E_INVALIDARG but got 0x%08lx
\n
"
,
hres
);
/* Try to add a bad HFONT */
hres
=
IFont_AddRefHfont
(
ifnt1
,(
HFONT
)
32
);
todo_wine
{
ok
(
hres
==
S_FALSE
,
"IFont_AddRefHfont: (Bad HFONT) Expected S_FALSE but got 0x%08lx
\n
"
,
hres
);}
/* Add simple IFONT HFONT pair */
hres
=
IFont_AddRefHfont
(
ifnt1
,
hfnt1
);
ok
(
hres
==
S_OK
,
"IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08lx
\n
"
,
hres
);
/* IFONT and HFONT do not have to be the same (always looks at HFONT) */
hres
=
IFont_AddRefHfont
(
ifnt2
,
hfnt1
);
todo_wine
{
ok
(
hres
==
S_OK
,
"IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08lx
\n
"
,
hres
);}
/* Release all hfnt1 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
(
ifnt1
,
hfnt1
);
todo_wine
{
ok
(
hres
==
S_OK
,
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx
\n
"
,
hres
);}
hres
=
IFont_ReleaseHfont
(
ifnt1
,
hfnt1
);
todo_wine
{
ok
(
hres
==
S_OK
,
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx
\n
"
,
hres
);}
/* Check if hfnt1 is 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
);}
/* Release all hfnt2 refs */
hres
=
IFont_ReleaseHfont
(
ifnt2
,
hfnt2
);
ok
(
hres
==
S_OK
,
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx
\n
"
,
hres
);
/* Check if hfnt2 is 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
);}
/* Show that releasing an IFONT does not always release it from the HFONT cache. */
IFont_Release
(
ifnt1
);
/* Add a reference for destroyed hfnt1 */
hres
=
IFont_AddRefHfont
(
ifnt2
,
hfnt1
);
todo_wine
{
ok
(
hres
==
S_OK
,
"IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08lx
\n
"
,
hres
);}
/* Decrement reference for destroyed hfnt1 */
hres
=
IFont_ReleaseHfont
(
ifnt2
,
hfnt1
);
todo_wine
{
ok
(
hres
==
S_OK
,
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx
\n
"
,
hres
);}
/* Shows that releasing all IFONT's does clear the HFONT cache. */
IFont_Release
(
ifnt2
);
/* Need to make a new IFONT for testing */
fd
.
fUnderline
=
1
;
pOleCreateFontIndirect
(
&
fd
,
&
IID_IFont
,
&
pvObj3
);
ifnt3
=
pvObj3
;
IFont_get_hFont
(
ifnt3
,
&
hfnt3
);
/* Add a reference for destroyed hfnt1 */
hres
=
IFont_AddRefHfont
(
ifnt3
,
hfnt1
);
todo_wine
{
ok
(
hres
==
S_FALSE
,
"IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08lx
\n
"
,
hres
);}
/* Decrement reference for destroyed hfnt1 */
hres
=
IFont_ReleaseHfont
(
ifnt3
,
hfnt1
);
todo_wine
{
ok
(
hres
==
S_FALSE
,
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx
\n
"
,
hres
);}
hres
=
IFont_Release
(
ifnt3
);
}
START_TEST
(
olefont
)
{
hOleaut32
=
LoadLibraryA
(
"oleaut32.dll"
);
...
...
@@ -696,4 +831,5 @@ START_TEST(olefont)
test_Invoke
();
test_IsEqual
();
test_ReleaseHfont
();
test_AddRefHfont
();
}
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