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
37e7de12
Commit
37e7de12
authored
Oct 24, 2006
by
Jeff Latimer
Committed by
Alexandre Julliard
Oct 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Add tests for ScriptStringAnalyse and ScriptStringFree.
parent
9fe46733
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
39 deletions
+53
-39
usp10.c
dlls/usp10/tests/usp10.c
+53
-39
No files found.
dlls/usp10/tests/usp10.c
View file @
37e7de12
...
...
@@ -614,30 +614,38 @@ static void test_ScriptXtoX(void)
static
void
test_ScriptString
(
void
)
{
/*******************************************************************************************
*
* 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.
*
*/
HRESULT
hr
;
HWND
hwnd
;
HDC
hdc
=
0
;
WCHAR
teststr
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'a'
,
'\0'
};
void
*
pString
=
(
WCHAR
*
)
&
teststr
;
int
cString
=
5
;
int
cGlyphs
=
cString
*
2
+
16
;
int
iCharset
=
-
1
;
DWORD
dwFlags
=
SSA_GLYPHS
;
int
iReqWidth
=
100
;
SCRIPT_CONTROL
psControl
;
SCRIPT_STATE
psState
;
const
int
piDx
[
5
]
=
{
10
,
10
,
10
,
10
,
10
};
SCRIPT_TABDEF
pTabdef
;
const
BYTE
pbInClass
=
0
;
SCRIPT_STRING_ANALYSIS
pssa
=
NULL
;
int
iX
=
10
;
int
iY
=
100
;
UINT
uOptions
=
0
;
const
RECT
prc
=
{
0
,
50
,
100
,
100
};
int
iMinSel
=
0
;
int
iMaxSel
=
0
;
BOOL
fDisabled
=
FALSE
;
WCHAR
teststr
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'1'
,
' '
,
'a'
,
'2'
,
'b'
,
'3'
,
'\0'
};
int
String
=
(
sizeof
(
teststr
)
/
sizeof
(
WCHAR
))
-
1
;
int
Glyphs
=
String
*
2
+
16
;
int
Charset
;
DWORD
Flags
=
SSA_GLYPHS
;
int
ReqWidth
=
100
;
SCRIPT_CONTROL
Control
;
SCRIPT_STATE
State
;
const
int
Dx
[
5
]
=
{
10
,
10
,
10
,
10
,
10
};
SCRIPT_TABDEF
Tabdef
;
const
BYTE
InClass
=
0
;
SCRIPT_STRING_ANALYSIS
ssa
=
NULL
;
int
X
=
10
;
int
Y
=
100
;
UINT
Options
=
0
;
const
RECT
rc
=
{
0
,
50
,
100
,
100
};
int
MinSel
=
0
;
int
MaxSel
=
0
;
BOOL
Disabled
=
FALSE
;
LOGFONTA
lf
;
HFONT
zfont
;
...
...
@@ -658,31 +666,37 @@ static void test_ScriptString(void)
lf
.
lfOrientation
=
0
;
lf
.
lfUnderline
=
0
;
lf
.
lfStrikeOut
=
0
;
lf
.
lfWeight
=
3
;
lf
.
lfWeight
=
3
00
;
lf
.
lfWidth
=
10
;
zfont
=
(
HFONT
)
SelectObject
(
hdc
,
CreateFontIndirectA
(
&
lf
));
Charset
=
-
1
;
/* this flag indicates unicode input */
/* Test without hdc to get E_INVALIDARG */
hr
=
ScriptStringAnalyse
(
NULL
,
pString
,
cString
,
cGlyphs
,
iCharset
,
dw
Flags
,
iReqWidth
,
&
psControl
,
&
psState
,
piDx
,
&
p
Tabdef
,
&
pbInClass
,
&
p
ssa
);
hr
=
ScriptStringAnalyse
(
NULL
,
teststr
,
String
,
Glyphs
,
Charset
,
Flags
,
ReqWidth
,
&
Control
,
&
State
,
Dx
,
&
Tabdef
,
&
InClass
,
&
ssa
);
ok
(
hr
==
E_PENDING
,
"ScriptStringAnalyse Stub should return E_PENDING not %08x
\n
"
,
hr
);
/* test with hdc, this should be a valid test */
hr
=
ScriptStringAnalyse
(
hdc
,
pString
,
cString
,
cGlyphs
,
iCharset
,
dwFlags
,
iReqWidth
,
&
psControl
,
&
psState
,
piDx
,
&
pTabdef
,
&
pbInClass
,
&
pssa
);
ok
(
hr
==
E_NOTIMPL
,
"ScriptStringAnalyse Stub should return E_NOTIMPL not %08x
\n
"
,
hr
);
/* Commented code it pending new code in ScriptStringAnalysis */
/* ok(hr == S_OK, "ScriptStringAnalyse Stub should return S_OK not %08x\n", (unsigned int) hr);*/
/* ok(pssa != NULL, "ScriptStringAnalyse pssa should not be NULL\n");*/
hr
=
ScriptStringAnalyse
(
hdc
,
teststr
,
String
,
Glyphs
,
Charset
,
Flags
,
ReqWidth
,
&
Control
,
&
State
,
Dx
,
&
Tabdef
,
&
InClass
,
&
ssa
);
todo_wine
ok
(
hr
==
S_OK
,
"ScriptStringAnalyse should return S_OK not %08x
\n
"
,
hr
);
/* test makes sure that a call with a valid pssa still works */
hr
=
ScriptStringAnalyse
(
hdc
,
teststr
,
String
,
Glyphs
,
Charset
,
Flags
,
ReqWidth
,
&
Control
,
&
State
,
Dx
,
&
Tabdef
,
&
InClass
,
&
ssa
);
todo_wine
ok
(
hr
==
S_OK
,
"ScriptStringAnalyse should return S_OK not %08x
\n
"
,
hr
);
todo_wine
ok
(
ssa
!=
NULL
,
"ScriptStringAnalyse pssa should not be NULL
\n
"
);
if
(
hr
==
0
)
{
hr
=
ScriptStringOut
(
pssa
,
iX
,
iY
,
uOptions
,
&
prc
,
iMinSel
,
iMaxSel
,
f
Disabled
);
ok
(
hr
==
E_NOTIMPL
,
"ScriptStringOut Stub should return E_NOTIMPL
not %08x
\n
"
,
hr
);
hr
=
ScriptStringFree
(
&
p
ssa
);
ok
(
hr
==
S_OK
,
"ScriptStringFree Stub
should return S_OK not %08x
\n
"
,
hr
);
hr
=
ScriptStringOut
(
ssa
,
X
,
Y
,
Options
,
&
rc
,
MinSel
,
MaxSel
,
Disabled
);
todo_wine
ok
(
hr
==
S_OK
,
"ScriptStringOut should return S_OK
not %08x
\n
"
,
hr
);
hr
=
ScriptStringFree
(
&
ssa
);
todo_wine
ok
(
hr
==
S_OK
,
"ScriptStringFree
should return S_OK not %08x
\n
"
,
hr
);
}
}
...
...
@@ -1060,9 +1074,6 @@ START_TEST(usp10)
test_ScriptCacheGetHeight
(
hdc
);
test_ScriptGetGlyphABCWidth
(
hdc
);
ReleaseDC
(
hwnd
,
hdc
);
DestroyWindow
(
hwnd
);
test_ScriptGetFontProperties
();
test_ScriptTextOut
();
test_ScriptXtoX
();
...
...
@@ -1070,4 +1081,7 @@ START_TEST(usp10)
test_ScriptLayout
();
test_digit_substitution
();
ReleaseDC
(
hwnd
,
hdc
);
DestroyWindow
(
hwnd
);
}
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