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
d4b85369
Commit
d4b85369
authored
Apr 15, 2010
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10/tests: Expanded tests for ScriptShape.
parent
e9cee6fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
119 additions
and
6 deletions
+119
-6
usp10.c
dlls/usp10/tests/usp10.c
+119
-6
No files found.
dlls/usp10/tests/usp10.c
View file @
d4b85369
...
@@ -289,16 +289,14 @@ static void test_ScriptItemize( void )
...
@@ -289,16 +289,14 @@ static void test_ScriptItemize( void )
static
void
test_ScriptShape
(
HDC
hdc
)
static
void
test_ScriptShape
(
HDC
hdc
)
{
{
static
const
WCHAR
test1
[]
=
{
'
t'
,
'e'
,
's'
,
't
'
,
0
};
static
const
WCHAR
test1
[]
=
{
'
w'
,
'i'
,
'n'
,
'e
'
,
0
};
BOOL
ret
;
static
const
WCHAR
test2
[]
=
{
0x202B
,
'i'
,
'n'
,
0x202C
,
0
}
;
HRESULT
hr
;
HRESULT
hr
;
SCRIPT_CACHE
sc
=
NULL
;
SCRIPT_CACHE
sc
=
NULL
;
WORD
glyphs
[
4
],
logclust
[
4
];
WORD
glyphs
[
4
],
glyphs2
[
4
],
logclust
[
4
];
SCRIPT_VISATTR
attrs
[
4
];
SCRIPT_VISATTR
attrs
[
4
];
SCRIPT_ITEM
items
[
2
];
SCRIPT_ITEM
items
[
2
];
int
nb
,
widths
[
4
];
int
nb
;
GOFFSET
offset
[
4
];
ABC
abc
[
4
];
hr
=
ScriptItemize
(
test1
,
4
,
2
,
NULL
,
NULL
,
items
,
NULL
);
hr
=
ScriptItemize
(
test1
,
4
,
2
,
NULL
,
NULL
,
items
,
NULL
);
ok
(
!
hr
,
"ScriptItemize should return S_OK not %08x
\n
"
,
hr
);
ok
(
!
hr
,
"ScriptItemize should return S_OK not %08x
\n
"
,
hr
);
...
@@ -324,8 +322,122 @@ static void test_ScriptShape(HDC hdc)
...
@@ -324,8 +322,122 @@ static void test_ScriptShape(HDC hdc)
ok
(
!
hr
,
"ScriptShape should return S_OK not %08x
\n
"
,
hr
);
ok
(
!
hr
,
"ScriptShape should return S_OK not %08x
\n
"
,
hr
);
ok
(
items
[
0
].
a
.
fNoGlyphIndex
==
FALSE
,
"fNoGlyphIndex TRUE
\n
"
);
ok
(
items
[
0
].
a
.
fNoGlyphIndex
==
FALSE
,
"fNoGlyphIndex TRUE
\n
"
);
memset
(
glyphs
,
-
1
,
sizeof
(
glyphs
));
memset
(
logclust
,
-
1
,
sizeof
(
logclust
));
memset
(
attrs
,
-
1
,
sizeof
(
attrs
));
hr
=
ScriptShape
(
NULL
,
&
sc
,
test1
,
4
,
4
,
&
items
[
0
].
a
,
glyphs
,
logclust
,
attrs
,
&
nb
);
hr
=
ScriptShape
(
NULL
,
&
sc
,
test1
,
4
,
4
,
&
items
[
0
].
a
,
glyphs
,
logclust
,
attrs
,
&
nb
);
ok
(
!
hr
,
"ScriptShape should return S_OK not %08x
\n
"
,
hr
);
ok
(
!
hr
,
"ScriptShape should return S_OK not %08x
\n
"
,
hr
);
ok
(
nb
==
4
,
"Wrong number of items
\n
"
);
ok
(
logclust
[
0
]
==
0
,
"clusters out of order
\n
"
);
ok
(
logclust
[
1
]
==
1
,
"clusters out of order
\n
"
);
ok
(
logclust
[
2
]
==
2
,
"clusters out of order
\n
"
);
ok
(
logclust
[
3
]
==
3
,
"clusters out of order
\n
"
);
ok
(
attrs
[
0
].
uJustification
==
SCRIPT_JUSTIFY_CHARACTER
,
"uJustification incorrect
\n
"
);
ok
(
attrs
[
1
].
uJustification
==
SCRIPT_JUSTIFY_CHARACTER
,
"uJustification incorrect
\n
"
);
ok
(
attrs
[
2
].
uJustification
==
SCRIPT_JUSTIFY_CHARACTER
,
"uJustification incorrect
\n
"
);
ok
(
attrs
[
3
].
uJustification
==
SCRIPT_JUSTIFY_CHARACTER
,
"uJustification incorrect
\n
"
);
ok
(
attrs
[
0
].
fClusterStart
==
1
,
"fClusterStart incorrect
\n
"
);
ok
(
attrs
[
1
].
fClusterStart
==
1
,
"fClusterStart incorrect
\n
"
);
ok
(
attrs
[
2
].
fClusterStart
==
1
,
"fClusterStart incorrect
\n
"
);
ok
(
attrs
[
3
].
fClusterStart
==
1
,
"fClusterStart incorrect
\n
"
);
ok
(
attrs
[
0
].
fDiacritic
==
0
,
"fDiacritic incorrect
\n
"
);
ok
(
attrs
[
1
].
fDiacritic
==
0
,
"fDiacritic incorrect
\n
"
);
ok
(
attrs
[
2
].
fDiacritic
==
0
,
"fDiacritic incorrect
\n
"
);
ok
(
attrs
[
3
].
fDiacritic
==
0
,
"fDiacritic incorrect
\n
"
);
ok
(
attrs
[
0
].
fZeroWidth
==
0
,
"fZeroWidth incorrect
\n
"
);
ok
(
attrs
[
1
].
fZeroWidth
==
0
,
"fZeroWidth incorrect
\n
"
);
ok
(
attrs
[
2
].
fZeroWidth
==
0
,
"fZeroWidth incorrect
\n
"
);
ok
(
attrs
[
3
].
fZeroWidth
==
0
,
"fZeroWidth incorrect
\n
"
);
ScriptFreeCache
(
&
sc
);
sc
=
NULL
;
memset
(
glyphs2
,
-
1
,
sizeof
(
glyphs2
));
memset
(
logclust
,
-
1
,
sizeof
(
logclust
));
memset
(
attrs
,
-
1
,
sizeof
(
attrs
));
hr
=
ScriptShape
(
hdc
,
&
sc
,
test2
,
4
,
4
,
&
items
[
0
].
a
,
glyphs2
,
logclust
,
attrs
,
&
nb
);
ok
(
hr
==
S_OK
,
"ScriptShape should return S_OK not %08x
\n
"
,
hr
);
ok
(
nb
==
4
,
"Wrong number of items
\n
"
);
ok
(
glyphs2
[
0
]
==
0
,
"Incorrect glyph for 0x202B
\n
"
);
ok
(
glyphs2
[
3
]
==
0
,
"Incorrect glyph for 0x202C
\n
"
);
ok
(
logclust
[
0
]
==
0
,
"clusters out of order
\n
"
);
ok
(
logclust
[
1
]
==
1
,
"clusters out of order
\n
"
);
ok
(
logclust
[
2
]
==
2
,
"clusters out of order
\n
"
);
ok
(
logclust
[
3
]
==
3
,
"clusters out of order
\n
"
);
ok
(
attrs
[
0
].
uJustification
==
SCRIPT_JUSTIFY_CHARACTER
,
"uJustification incorrect
\n
"
);
ok
(
attrs
[
1
].
uJustification
==
SCRIPT_JUSTIFY_CHARACTER
,
"uJustification incorrect
\n
"
);
ok
(
attrs
[
2
].
uJustification
==
SCRIPT_JUSTIFY_CHARACTER
,
"uJustification incorrect
\n
"
);
ok
(
attrs
[
3
].
uJustification
==
SCRIPT_JUSTIFY_CHARACTER
,
"uJustification incorrect
\n
"
);
ok
(
attrs
[
0
].
fClusterStart
==
1
,
"fClusterStart incorrect
\n
"
);
ok
(
attrs
[
1
].
fClusterStart
==
1
,
"fClusterStart incorrect
\n
"
);
ok
(
attrs
[
2
].
fClusterStart
==
1
,
"fClusterStart incorrect
\n
"
);
ok
(
attrs
[
3
].
fClusterStart
==
1
,
"fClusterStart incorrect
\n
"
);
ok
(
attrs
[
0
].
fDiacritic
==
0
,
"fDiacritic incorrect
\n
"
);
ok
(
attrs
[
1
].
fDiacritic
==
0
,
"fDiacritic incorrect
\n
"
);
ok
(
attrs
[
2
].
fDiacritic
==
0
,
"fDiacritic incorrect
\n
"
);
ok
(
attrs
[
3
].
fDiacritic
==
0
,
"fDiacritic incorrect
\n
"
);
ok
(
attrs
[
0
].
fZeroWidth
==
0
,
"fZeroWidth incorrect
\n
"
);
ok
(
attrs
[
1
].
fZeroWidth
==
0
,
"fZeroWidth incorrect
\n
"
);
ok
(
attrs
[
2
].
fZeroWidth
==
0
,
"fZeroWidth incorrect
\n
"
);
ok
(
attrs
[
3
].
fZeroWidth
==
0
,
"fZeroWidth incorrect
\n
"
);
/* modify LTR to RTL */
items
[
0
].
a
.
fRTL
=
1
;
memset
(
glyphs2
,
-
1
,
sizeof
(
glyphs2
));
memset
(
logclust
,
-
1
,
sizeof
(
logclust
));
memset
(
attrs
,
-
1
,
sizeof
(
attrs
));
hr
=
ScriptShape
(
hdc
,
&
sc
,
test1
,
4
,
4
,
&
items
[
0
].
a
,
glyphs2
,
logclust
,
attrs
,
&
nb
);
ok
(
!
hr
,
"ScriptShape should return S_OK not %08x
\n
"
,
hr
);
ok
(
nb
==
4
,
"Wrong number of items
\n
"
);
ok
(
glyphs2
[
0
]
==
glyphs
[
3
],
"Glyphs not reordered properly
\n
"
);
ok
(
glyphs2
[
1
]
==
glyphs
[
2
],
"Glyphs not reordered properly
\n
"
);
ok
(
glyphs2
[
2
]
==
glyphs
[
1
],
"Glyphs not reordered properly
\n
"
);
ok
(
glyphs2
[
3
]
==
glyphs
[
0
],
"Glyphs not reordered properly
\n
"
);
ok
(
logclust
[
0
]
==
3
,
"clusters out of order
\n
"
);
ok
(
logclust
[
1
]
==
2
,
"clusters out of order
\n
"
);
ok
(
logclust
[
2
]
==
1
,
"clusters out of order
\n
"
);
ok
(
logclust
[
3
]
==
0
,
"clusters out of order
\n
"
);
ok
(
attrs
[
0
].
uJustification
==
SCRIPT_JUSTIFY_CHARACTER
,
"uJustification incorrect
\n
"
);
ok
(
attrs
[
1
].
uJustification
==
SCRIPT_JUSTIFY_CHARACTER
,
"uJustification incorrect
\n
"
);
ok
(
attrs
[
2
].
uJustification
==
SCRIPT_JUSTIFY_CHARACTER
,
"uJustification incorrect
\n
"
);
ok
(
attrs
[
3
].
uJustification
==
SCRIPT_JUSTIFY_CHARACTER
,
"uJustification incorrect
\n
"
);
ok
(
attrs
[
0
].
fClusterStart
==
1
,
"fClusterStart incorrect
\n
"
);
ok
(
attrs
[
1
].
fClusterStart
==
1
,
"fClusterStart incorrect
\n
"
);
ok
(
attrs
[
2
].
fClusterStart
==
1
,
"fClusterStart incorrect
\n
"
);
ok
(
attrs
[
3
].
fClusterStart
==
1
,
"fClusterStart incorrect
\n
"
);
ok
(
attrs
[
0
].
fDiacritic
==
0
,
"fDiacritic incorrect
\n
"
);
ok
(
attrs
[
1
].
fDiacritic
==
0
,
"fDiacritic incorrect
\n
"
);
ok
(
attrs
[
2
].
fDiacritic
==
0
,
"fDiacritic incorrect
\n
"
);
ok
(
attrs
[
3
].
fDiacritic
==
0
,
"fDiacritic incorrect
\n
"
);
ok
(
attrs
[
0
].
fZeroWidth
==
0
,
"fZeroWidth incorrect
\n
"
);
ok
(
attrs
[
1
].
fZeroWidth
==
0
,
"fZeroWidth incorrect
\n
"
);
ok
(
attrs
[
2
].
fZeroWidth
==
0
,
"fZeroWidth incorrect
\n
"
);
ok
(
attrs
[
3
].
fZeroWidth
==
0
,
"fZeroWidth incorrect
\n
"
);
ScriptFreeCache
(
&
sc
);
}
static
void
test_ScriptPlace
(
HDC
hdc
)
{
static
const
WCHAR
test1
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
BOOL
ret
;
HRESULT
hr
;
SCRIPT_CACHE
sc
=
NULL
;
WORD
glyphs
[
4
],
logclust
[
4
];
SCRIPT_VISATTR
attrs
[
4
];
SCRIPT_ITEM
items
[
2
];
int
nb
,
widths
[
4
];
GOFFSET
offset
[
4
];
ABC
abc
[
4
];
hr
=
ScriptItemize
(
test1
,
4
,
2
,
NULL
,
NULL
,
items
,
NULL
);
ok
(
!
hr
,
"ScriptItemize should return S_OK not %08x
\n
"
,
hr
);
ok
(
items
[
0
].
a
.
fNoGlyphIndex
==
FALSE
,
"fNoGlyphIndex TRUE
\n
"
);
hr
=
ScriptShape
(
hdc
,
&
sc
,
test1
,
4
,
4
,
&
items
[
0
].
a
,
glyphs
,
logclust
,
attrs
,
&
nb
);
ok
(
!
hr
,
"ScriptShape should return S_OK not %08x
\n
"
,
hr
);
ok
(
items
[
0
].
a
.
fNoGlyphIndex
==
FALSE
,
"fNoGlyphIndex TRUE
\n
"
);
hr
=
ScriptPlace
(
hdc
,
&
sc
,
glyphs
,
4
,
NULL
,
&
items
[
0
].
a
,
widths
,
NULL
,
NULL
);
hr
=
ScriptPlace
(
hdc
,
&
sc
,
glyphs
,
4
,
NULL
,
&
items
[
0
].
a
,
widths
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"ScriptPlace should return E_INVALIDARG not %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"ScriptPlace should return E_INVALIDARG not %08x
\n
"
,
hr
);
...
@@ -1667,6 +1779,7 @@ START_TEST(usp10)
...
@@ -1667,6 +1779,7 @@ START_TEST(usp10)
test_ScriptCacheGetHeight
(
hdc
);
test_ScriptCacheGetHeight
(
hdc
);
test_ScriptGetGlyphABCWidth
(
hdc
);
test_ScriptGetGlyphABCWidth
(
hdc
);
test_ScriptShape
(
hdc
);
test_ScriptShape
(
hdc
);
test_ScriptPlace
(
hdc
);
test_ScriptGetFontProperties
(
hdc
);
test_ScriptGetFontProperties
(
hdc
);
test_ScriptTextOut
(
hdc
);
test_ScriptTextOut
(
hdc
);
...
...
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