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
34f3e88b
Commit
34f3e88b
authored
Aug 04, 2006
by
Jeff Latimer
Committed by
Alexandre Julliard
Aug 04, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Fix glyph comparsion between tests.
parent
25d6383a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
42 deletions
+35
-42
usp10.c
dlls/usp10/tests/usp10.c
+35
-42
No files found.
dlls/usp10/tests/usp10.c
View file @
34f3e88b
...
...
@@ -32,20 +32,18 @@
#include <winerror.h>
#include <usp10.h>
static
void
test_ScriptItemIzeShapePlace
(
unsigned
short
pwOutGlyphs
[
256
])
static
void
test_ScriptItemIzeShapePlace
(
HDC
hdc
,
unsigned
short
pwOutGlyphs
[
256
])
{
HRESULT
hr
;
int
iMaxProps
;
const
SCRIPT_PROPERTIES
**
ppSp
;
HWND
hwnd
;
HDC
hdc
;
int
cInChars
;
int
cMaxItems
;
SCRIPT_ITEM
pItem
[
255
];
int
pcItems
;
WCHAR
TestItem1
[
6
]
=
{
'T'
,
'e'
,
's'
,
't'
,
'a'
,
0
};
WCHAR
TestItem2
[
6
]
=
{
'T'
,
'e'
,
's'
,
't'
,
'b'
,
0
};
WCHAR
TestItem1
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'a'
,
0
};
WCHAR
TestItem2
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'b'
,
0
};
SCRIPT_CACHE
psc
;
int
cChars
;
...
...
@@ -58,22 +56,12 @@ static void test_ScriptItemIzeShapePlace(unsigned short pwOutGlyphs[256])
int
piAdvance
[
256
];
GOFFSET
pGoffset
[
256
];
ABC
pABC
[
256
];
LOGFONT
W
lf
;
LOGFONT
A
lf
;
HFONT
zfont
;
int
cnt
;
/* We need a valid HDC to drive a lot of Script functions which requires the following *
* to set up for the tests. */
hwnd
=
CreateWindowExA
(
0
,
"static"
,
""
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
assert
(
hwnd
!=
0
);
ShowWindow
(
hwnd
,
SW_SHOW
);
UpdateWindow
(
hwnd
);
hdc
=
GetDC
(
hwnd
);
/* We now have a hdc */
ok
(
hdc
!=
NULL
,
"HDC failed to be created %p
\n
"
,
hdc
);
lstrcpy
W
(
lf
.
lfFaceName
,
(
WCHAR
*
)
"Courier
"
);
lstrcpy
A
(
lf
.
lfFaceName
,
"Symbol
"
);
lf
.
lfHeight
=
10
;
lf
.
lfItalic
=
0
;
lf
.
lfEscapement
=
0
;
...
...
@@ -83,7 +71,7 @@ static void test_ScriptItemIzeShapePlace(unsigned short pwOutGlyphs[256])
lf
.
lfWeight
=
3
;
lf
.
lfWidth
=
10
;
zfont
=
(
HFONT
)
SelectObject
(
hdc
,
CreateFontIndirect
W
(
&
lf
));
zfont
=
(
HFONT
)
SelectObject
(
hdc
,
CreateFontIndirect
A
(
&
lf
));
/* Start testing usp10 functions */
/* This test determines that the pointer returned by ScriptGetProperties is valid
...
...
@@ -205,34 +193,20 @@ static void test_ScriptItemIzeShapePlace(unsigned short pwOutGlyphs[256])
hr
=
ScriptFreeCache
(
&
psc
);
ok
(
!
psc
,
"psc is not null after ScriptFreeCache
\n
"
);
}
ReleaseDC
(
hwnd
,
hdc
);
DestroyWindow
(
hwnd
);
}
void
test_ScriptGetCMap
(
unsigned
short
pwOutGlyphs
[
256
])
void
test_ScriptGetCMap
(
HDC
hdc
,
unsigned
short
pwOutGlyphs
[
256
])
{
HRESULT
hr
;
HWND
hwnd
;
HDC
hdc
;
SCRIPT_CACHE
psc
=
NULL
;
int
cInChars
;
int
cChars
;
unsigned
short
pwOutGlyphs3
[
256
];
WCHAR
TestItem1
[
6
]
=
{
'T'
,
'e'
,
's'
,
't'
,
'a'
,
0
};
WCHAR
TestItem1
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'a'
,
0
};
DWORD
dwFlags
;
int
cnt
;
/* We need a valid HDC to drive a lot of Script functions which requires the following *
* to set up for the tests. */
hwnd
=
CreateWindowExA
(
0
,
"static"
,
""
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
assert
(
hwnd
!=
0
);
hdc
=
GetDC
(
hwnd
);
ok
(
hdc
!=
NULL
,
"HDC failed to be created %p
\n
"
,
hdc
);
/* Check to make sure that SCRIPT_CACHE gets allocated ok */
dwFlags
=
0
;
cInChars
=
cChars
=
5
;
...
...
@@ -275,6 +249,7 @@ void test_ScriptGetCMap(unsigned short pwOutGlyphs[256])
hr
=
ScriptFreeCache
(
&
psc
);
ok
(
!
psc
,
"psc is not null after ScriptFreeCache
\n
"
);
}
void
test_ScriptGetFontProperties
(
void
)
...
...
@@ -363,7 +338,7 @@ void test_ScriptTextOut(void)
int
cMaxItems
;
SCRIPT_ITEM
pItem
[
255
];
int
pcItems
;
WCHAR
TestItem1
[
6
]
=
{
'T'
,
'e'
,
's'
,
't'
,
'a'
,
0
};
WCHAR
TestItem1
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'a'
,
0
};
SCRIPT_CACHE
psc
;
int
cChars
;
...
...
@@ -582,7 +557,7 @@ static void test_ScriptString(void)
HRESULT
hr
;
HWND
hwnd
;
HDC
hdc
=
0
;
WCHAR
teststr
[
6
]
=
{
'T'
,
'e'
,
's'
,
't'
,
'a'
,
'\0'
};
WCHAR
teststr
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'a'
,
'\0'
};
void
*
pString
=
(
WCHAR
*
)
&
teststr
;
int
cString
=
5
;
int
cGlyphs
=
cString
*
2
+
16
;
...
...
@@ -604,7 +579,7 @@ static void test_ScriptString(void)
int
iMaxSel
=
0
;
BOOL
fDisabled
=
FALSE
;
LOGFONT
W
lf
;
LOGFONT
A
lf
;
HFONT
zfont
;
/* We need a valid HDC to drive a lot of Script functions which requires the following *
...
...
@@ -616,7 +591,7 @@ static void test_ScriptString(void)
hdc
=
GetDC
(
hwnd
);
/* We now have a hdc */
ok
(
hdc
!=
NULL
,
"HDC failed to be created %p
\n
"
,
hdc
);
lstrcpy
W
(
lf
.
lfFaceName
,
(
WCHAR
*
)
"Courier
"
);
lstrcpy
A
(
lf
.
lfFaceName
,
"Symbol
"
);
lf
.
lfHeight
=
10
;
lf
.
lfItalic
=
0
;
lf
.
lfEscapement
=
0
;
...
...
@@ -626,8 +601,8 @@ static void test_ScriptString(void)
lf
.
lfWeight
=
3
;
lf
.
lfWidth
=
10
;
zfont
=
(
HFONT
)
SelectObject
(
hdc
,
CreateFontIndirect
W
(
&
lf
));
zfont
=
(
HFONT
)
SelectObject
(
hdc
,
CreateFontIndirect
A
(
&
lf
));
/* Test without hdc to get E_INVALIDARG */
hr
=
ScriptStringAnalyse
(
NULL
,
pString
,
cString
,
cGlyphs
,
iCharset
,
dwFlags
,
iReqWidth
,
&
psControl
,
&
psState
,
piDx
,
&
pTabdef
,
...
...
@@ -653,10 +628,28 @@ static void test_ScriptString(void)
START_TEST
(
usp10
)
{
HWND
hwnd
;
HDC
hdc
;
unsigned
short
pwOutGlyphs
[
256
];
test_ScriptItemIzeShapePlace
(
pwOutGlyphs
);
test_ScriptGetCMap
(
pwOutGlyphs
);
/* We need a valid HDC to drive a lot of Script functions which requires the following *
* to set up for the tests. */
hwnd
=
CreateWindowExA
(
0
,
"static"
,
""
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
assert
(
hwnd
!=
0
);
ShowWindow
(
hwnd
,
SW_SHOW
);
UpdateWindow
(
hwnd
);
hdc
=
GetDC
(
hwnd
);
/* We now have a hdc */
ok
(
hdc
!=
NULL
,
"HDC failed to be created %p
\n
"
,
hdc
);
test_ScriptItemIzeShapePlace
(
hdc
,
pwOutGlyphs
);
test_ScriptGetCMap
(
hdc
,
pwOutGlyphs
);
ReleaseDC
(
hwnd
,
hdc
);
DestroyWindow
(
hwnd
);
test_ScriptGetFontProperties
();
test_ScriptTextOut
();
test_ScriptXtoX
();
...
...
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