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
55f385c8
Commit
55f385c8
authored
Dec 24, 2006
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Fix all failing tests on Windows and Wine.
parent
d2f21301
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
58 deletions
+15
-58
usp10.c
dlls/usp10/tests/usp10.c
+10
-52
usp10.c
dlls/usp10/usp10.c
+5
-6
No files found.
dlls/usp10/tests/usp10.c
View file @
55f385c8
...
...
@@ -313,21 +313,12 @@ static void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256])
}
static
void
test_ScriptGetFontProperties
(
void
)
static
void
test_ScriptGetFontProperties
(
HDC
hdc
)
{
HRESULT
hr
;
HDC
hdc
;
HWND
hwnd
;
SCRIPT_CACHE
psc
,
old_psc
;
SCRIPT_FONTPROPERTIES
sfp
;
/* Only do the bare minumum to get a valid hdc */
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
);
/* Some sanity checks for ScriptGetFontProperties */
hr
=
ScriptGetFontProperties
(
NULL
,
NULL
,
NULL
);
...
...
@@ -383,17 +374,11 @@ static void test_ScriptGetFontProperties(void)
ok
(
psc
==
old_psc
,
"Expected psc not to be changed, was %p is now %p
\n
"
,
old_psc
,
psc
);
ScriptFreeCache
(
&
psc
);
ok
(
psc
==
NULL
,
"Expected psc to be NULL, got %p
\n
"
,
psc
);
/* Cleanup */
ReleaseDC
(
hwnd
,
hdc
);
DestroyWindow
(
hwnd
);
}
static
void
test_ScriptTextOut
(
void
)
static
void
test_ScriptTextOut
(
HDC
hdc
)
{
HRESULT
hr
;
HWND
hwnd
;
HDC
hdc
;
int
cInChars
;
int
cMaxItems
;
...
...
@@ -418,17 +403,6 @@ static void test_ScriptTextOut(void)
SCRIPT_LOGATTR
*
psla
;
SCRIPT_LOGATTR
sla
[
256
];
/* 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
);
/* This is a valid test that will cause parsing to take place */
cInChars
=
5
;
cMaxItems
=
255
;
...
...
@@ -519,8 +493,6 @@ static void test_ScriptTextOut(void)
ok
(
psc
==
NULL
,
"Expected psc to be NULL, got %p
\n
"
,
psc
);
}
}
ReleaseDC
(
hwnd
,
hdc
);
DestroyWindow
(
hwnd
);
}
static
void
test_ScriptXtoX
(
void
)
...
...
@@ -632,20 +604,18 @@ static void test_ScriptXtoX(void)
}
static
void
test_ScriptString
(
void
)
static
void
test_ScriptString
(
HDC
hdc
)
{
/*******************************************************************************************
*
* This set of tests are for the string functions of uniscribe. The ScriptStringAnalyse
* function allocates memory pointed to by the SCRIPT_STRING_ANALYSIS ssa pointer. This
* memory if freed by ScriptStringFree. There needs to be a valid hdc for this
this as
* ScriptStrinAnalyse calls ScriptSItemize, ScriptShape and ScriptPlace which require it.
* function allocates memory pointed to by the SCRIPT_STRING_ANALYSIS ssa pointer. This
* memory if freed by ScriptStringFree. There needs to be a valid hdc for this
as
* ScriptStrin
g
Analyse calls ScriptSItemize, ScriptShape and ScriptPlace which require it.
*
*/
HRESULT
hr
;
HWND
hwnd
;
HDC
hdc
=
0
;
WCHAR
teststr
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'1'
,
' '
,
'a'
,
'2'
,
'b'
,
'3'
,
'\0'
};
int
String
=
(
sizeof
(
teststr
)
/
sizeof
(
WCHAR
))
-
1
;
int
Glyphs
=
String
*
2
+
16
;
...
...
@@ -668,16 +638,6 @@ static void test_ScriptString(void)
BOOL
Disabled
=
FALSE
;
LOGFONTA
lf
;
HFONT
zfont
;
/* 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
);
/* We now have a hdc */
ok
(
hdc
!=
NULL
,
"HDC failed to be created %p
\n
"
,
hdc
);
lstrcpyA
(
lf
.
lfFaceName
,
"Symbol"
);
lf
.
lfHeight
=
10
;
...
...
@@ -689,10 +649,8 @@ static void test_ScriptString(void)
lf
.
lfWeight
=
300
;
lf
.
lfWidth
=
10
;
zfont
=
(
HFONT
)
SelectObject
(
hdc
,
CreateFontIndirectA
(
&
lf
));
Charset
=
-
1
;
/* this flag indicates unicode input */
/* Test without hdc to get E_
INVALIDAR
G */
/* Test without hdc to get E_
PENDIN
G */
hr
=
ScriptStringAnalyse
(
NULL
,
teststr
,
String
,
Glyphs
,
Charset
,
Flags
,
ReqWidth
,
&
Control
,
&
State
,
Dx
,
&
Tabdef
,
&
InClass
,
&
ssa
);
...
...
@@ -1298,10 +1256,10 @@ START_TEST(usp10)
test_ScriptCacheGetHeight
(
hdc
);
test_ScriptGetGlyphABCWidth
(
hdc
);
test_ScriptGetFontProperties
();
test_ScriptTextOut
();
test_ScriptGetFontProperties
(
hdc
);
test_ScriptTextOut
(
hdc
);
test_ScriptXtoX
();
test_ScriptString
();
test_ScriptString
(
hdc
);
test_ScriptStringXtoCP_CPtoX
(
hdc
);
test_ScriptLayout
();
...
...
dlls/usp10/usp10.c
View file @
55f385c8
...
...
@@ -511,12 +511,11 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc,
hdc
,
pString
,
cString
,
cGlyphs
,
iCharset
,
dwFlags
,
iReqWidth
,
psControl
,
psState
,
piDx
,
pTabdef
,
pbInClass
,
pssa
);
if
(
1
>
cString
||
NULL
==
pString
)
{
return
E_INVALIDARG
;
}
if
((
dwFlags
&
SSA_GLYPHS
)
&&
NULL
==
hdc
)
{
return
E_PENDING
;
}
if
(
cString
<
1
||
!
pString
)
return
E_INVALIDARG
;
if
((
dwFlags
&
SSA_GLYPHS
)
&&
!
hdc
)
return
E_PENDING
;
analysis
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
StringAnalysis
));
...
...
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