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
4b19b618
Commit
4b19b618
authored
Mar 14, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add more GdipMeasureString/GdipMeasureCharacterRanges clipping and alignment tests.
parent
81ffe043
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
193 additions
and
8 deletions
+193
-8
graphics.c
dlls/gdiplus/tests/graphics.c
+193
-8
No files found.
dlls/gdiplus/tests/graphics.c
View file @
4b19b618
...
...
@@ -3909,7 +3909,7 @@ static void test_measure_string(void)
static
const
WCHAR
string
[]
=
{
'A'
,
'0'
,
'1'
,
0
};
HDC
hdc
;
GpStringFormat
*
format
;
CharacterRange
range
=
{
0
,
3
}
;
CharacterRange
range
;
GpRegion
*
region
;
GpGraphics
*
graphics
;
GpFontFamily
*
family
;
...
...
@@ -3923,8 +3923,7 @@ static void test_measure_string(void)
status
=
GdipCreateStringFormat
(
StringFormatFlagsNoWrap
,
LANG_NEUTRAL
,
&
format
);
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
status
=
GdipSetStringFormatMeasurableCharacterRanges
(
format
,
1
,
&
range
);
expect
(
Ok
,
status
);
status
=
GdipCreateRegion
(
&
region
);
expect
(
Ok
,
status
);
...
...
@@ -3964,8 +3963,123 @@ static void test_measure_string(void)
todo_wine
expectf
(
height
/
2
.
0
,
bounds
.
Height
);
range
.
First
=
0
;
range
.
Length
=
lstrlenW
(
string
);
status
=
GdipSetStringFormatMeasurableCharacterRanges
(
format
,
1
,
&
range
);
expect
(
Ok
,
status
);
rect
.
X
=
5
.
0
;
rect
.
Y
=
5
.
0
;
rect
.
Width
=
32000
.
0
;
rect
.
Height
=
32000
.
0
;
status
=
GdipMeasureCharacterRanges
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
1
,
&
region
);
expect
(
Ok
,
status
);
set_rect_empty
(
&
bounds
);
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
bounds
);
expect
(
Ok
,
status
);
expectf_
(
5
.
0
+
margin_x
,
bounds
.
X
,
1
.
0
);
expectf
(
5
.
0
,
bounds
.
Y
);
expectf_
(
width
-
margin_x
*
2
.
0
,
bounds
.
Width
,
1
.
0
);
todo_wine
expectf_
(
height
-
margin_y
,
bounds
.
Height
,
1
.
0
);
width_rgn
=
bounds
.
Width
;
height_rgn
=
bounds
.
Height
;
range
.
First
=
0
;
range
.
Length
=
1
;
status
=
GdipSetStringFormatMeasurableCharacterRanges
(
format
,
1
,
&
range
);
expect
(
Ok
,
status
);
set_rect_empty
(
&
rect
);
rect
.
Width
=
32000
.
0
;
rect
.
Height
=
32000
.
0
;
status
=
GdipMeasureCharacterRanges
(
graphics
,
string
,
1
,
font
,
&
rect
,
format
,
1
,
&
region
);
expect
(
Ok
,
status
);
set_rect_empty
(
&
bounds
);
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
bounds
);
expect
(
Ok
,
status
);
expectf_
(
margin_x
,
bounds
.
X
,
1
.
0
);
expectf
(
0
.
0
,
bounds
.
Y
);
ok
(
bounds
.
Width
<
width_rgn
/
2
.
0
,
"width of 1 glyph is wrong
\n
"
);
expectf
(
height_rgn
,
bounds
.
Height
);
width_1
=
bounds
.
Width
;
range
.
First
=
0
;
range
.
Length
=
lstrlenW
(
string
);
status
=
GdipSetStringFormatMeasurableCharacterRanges
(
format
,
1
,
&
range
);
expect
(
Ok
,
status
);
rect
.
X
=
5
.
0
;
rect
.
Y
=
5
.
0
;
rect
.
Width
=
0
.
0
;
rect
.
Height
=
0
.
0
;
status
=
GdipMeasureCharacterRanges
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
1
,
&
region
);
expect
(
Ok
,
status
);
set_rect_empty
(
&
bounds
);
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
bounds
);
expect
(
Ok
,
status
);
expectf
(
0
.
0
,
bounds
.
X
);
expectf
(
0
.
0
,
bounds
.
Y
);
expectf
(
0
.
0
,
bounds
.
Width
);
expectf
(
0
.
0
,
bounds
.
Height
);
rect
.
X
=
5
.
0
;
rect
.
Y
=
5
.
0
;
rect
.
Width
=
width_rgn
/
2
.
0
;
rect
.
Height
=
32000
.
0
;
status
=
GdipMeasureCharacterRanges
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
1
,
&
region
);
expect
(
Ok
,
status
);
set_rect_empty
(
&
bounds
);
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
bounds
);
expect
(
Ok
,
status
);
todo_wine
expectf_
(
5
.
0
+
margin_x
,
bounds
.
X
,
1
.
0
);
todo_wine
expectf
(
5
.
0
,
bounds
.
Y
);
todo_wine
expectf_
(
width_1
,
bounds
.
Width
,
1
.
0
);
todo_wine
expectf_
(
height
-
margin_y
,
bounds
.
Height
,
1
.
0
);
status
=
GdipSetStringFormatFlags
(
format
,
StringFormatFlagsNoWrap
|
StringFormatFlagsNoClip
);
rect
.
X
=
5
.
0
;
rect
.
Y
=
5
.
0
;
rect
.
Width
=
0
.
0
;
rect
.
Height
=
0
.
0
;
status
=
GdipMeasureCharacterRanges
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
1
,
&
region
);
expect
(
Ok
,
status
);
set_rect_empty
(
&
bounds
);
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
bounds
);
expect
(
Ok
,
status
);
todo_wine
expectf_
(
5
.
0
+
margin_x
,
bounds
.
X
,
1
.
0
);
todo_wine
expectf
(
5
.
0
,
bounds
.
Y
);
todo_wine
expectf
(
width_rgn
,
bounds
.
Width
);
todo_wine
expectf
(
height_rgn
,
bounds
.
Height
);
rect
.
X
=
5
.
0
;
rect
.
Y
=
5
.
0
;
rect
.
Width
=
width_rgn
/
2
.
0
;
rect
.
Height
=
32000
.
0
;
status
=
GdipMeasureCharacterRanges
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
1
,
&
region
);
expect
(
Ok
,
status
);
set_rect_empty
(
&
bounds
);
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
bounds
);
expect
(
Ok
,
status
);
todo_wine
expectf_
(
5
.
0
+
margin_x
,
bounds
.
X
,
1
.
0
);
todo_wine
expectf
(
5
.
0
,
bounds
.
Y
);
todo_wine
expectf_
(
width_1
,
bounds
.
Width
,
1
.
0
);
todo_wine
expectf
(
height_rgn
,
bounds
.
Height
);
set_rect_empty
(
&
rect
);
rect
.
Height
=
height
/
2
.
0
;
set_rect_empty
(
&
bounds
);
...
...
@@ -3975,7 +4089,7 @@ todo_wine
expect
(
1
,
lines
);
expectf
(
0
.
0
,
bounds
.
X
);
expectf
(
0
.
0
,
bounds
.
Y
);
expectf
(
width
,
bounds
.
Width
);
expectf
_
(
width
,
bounds
.
Width
,
0
.
01
);
todo_wine
expectf
(
height
,
bounds
.
Height
);
...
...
@@ -4042,6 +4156,7 @@ todo_wine
expectf_
(
width_1
,
bounds
.
Width
,
0
.
01
);
expectf
(
height
,
bounds
.
Height
);
/* Default (Near) alignment */
rect
.
X
=
5
.
0
;
rect
.
Y
=
5
.
0
;
rect
.
Width
=
width
*
2
.
0
;
...
...
@@ -4053,7 +4168,7 @@ todo_wine
expect
(
1
,
lines
);
expectf
(
5
.
0
,
bounds
.
X
);
expectf
(
5
.
0
,
bounds
.
Y
);
expectf
(
width
,
bounds
.
Width
);
expectf
_
(
width
,
bounds
.
Width
,
0
.
01
);
expectf
(
height
,
bounds
.
Height
);
rect
.
X
=
5
.
0
;
...
...
@@ -4074,6 +4189,7 @@ todo_wine
width_rgn
=
bounds
.
Width
;
height_rgn
=
bounds
.
Height
;
/* Center alignment */
GdipSetStringFormatAlign
(
format
,
StringAlignmentCenter
);
GdipSetStringFormatLineAlign
(
format
,
StringAlignmentCenter
);
...
...
@@ -4090,7 +4206,23 @@ todo_wine
expectf_
(
5
.
0
+
width
/
2
.
0
,
bounds
.
X
,
0
.
01
);
todo_wine
expectf
(
5
.
0
+
height
/
2
.
0
,
bounds
.
Y
);
expectf
(
width
,
bounds
.
Width
);
expectf_
(
width
,
bounds
.
Width
,
0
.
01
);
expectf
(
height
,
bounds
.
Height
);
rect
.
X
=
5
.
0
;
rect
.
Y
=
5
.
0
;
rect
.
Width
=
0
.
0
;
rect
.
Height
=
0
.
0
;
set_rect_empty
(
&
bounds
);
status
=
GdipMeasureString
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
&
bounds
,
&
glyphs
,
&
lines
);
expect
(
Ok
,
status
);
expect
(
3
,
glyphs
);
expect
(
1
,
lines
);
todo_wine
expectf_
(
5
.
0
-
width
/
2
.
0
,
bounds
.
X
,
0
.
01
);
todo_wine
expectf
(
5
.
0
-
height
/
2
.
0
,
bounds
.
Y
);
expectf_
(
width
,
bounds
.
Width
,
0
.
01
);
expectf
(
height
,
bounds
.
Height
);
rect
.
X
=
5
.
0
;
...
...
@@ -4108,6 +4240,25 @@ todo_wine
expectf_
(
width_rgn
,
bounds
.
Width
,
1
.
0
);
expectf_
(
height_rgn
,
bounds
.
Height
,
1
.
0
);
rect
.
X
=
5
.
0
;
rect
.
Y
=
5
.
0
;
rect
.
Width
=
0
.
0
;
rect
.
Height
=
0
.
0
;
status
=
GdipMeasureCharacterRanges
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
1
,
&
region
);
expect
(
Ok
,
status
);
set_rect_empty
(
&
bounds
);
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
bounds
);
expect
(
Ok
,
status
);
todo_wine
expectf_
(
5
.
0
-
width_rgn
/
2
.
0
,
bounds
.
X
,
1
.
0
);
todo_wine
expectf_
(
5
.
0
-
height_rgn
/
2
.
0
,
bounds
.
Y
,
1
.
0
);
todo_wine
expectf_
(
width_rgn
,
bounds
.
Width
,
1
.
0
);
todo_wine
expectf_
(
height_rgn
,
bounds
.
Height
,
1
.
0
);
/* Far alignment */
GdipSetStringFormatAlign
(
format
,
StringAlignmentFar
);
GdipSetStringFormatLineAlign
(
format
,
StringAlignmentFar
);
...
...
@@ -4121,10 +4272,26 @@ todo_wine
expect
(
3
,
glyphs
);
expect
(
1
,
lines
);
todo_wine
expectf
(
5
.
0
+
width
,
bounds
.
X
);
expectf
_
(
5
.
0
+
width
,
bounds
.
X
,
0
.
01
);
todo_wine
expectf
(
5
.
0
+
height
,
bounds
.
Y
);
expectf
(
width
,
bounds
.
Width
);
expectf_
(
width
,
bounds
.
Width
,
0
.
01
);
expectf
(
height
,
bounds
.
Height
);
rect
.
X
=
5
.
0
;
rect
.
Y
=
5
.
0
;
rect
.
Width
=
0
.
0
;
rect
.
Height
=
0
.
0
;
set_rect_empty
(
&
bounds
);
status
=
GdipMeasureString
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
&
bounds
,
&
glyphs
,
&
lines
);
expect
(
Ok
,
status
);
expect
(
3
,
glyphs
);
expect
(
1
,
lines
);
todo_wine
expectf_
(
5
.
0
-
width
,
bounds
.
X
,
0
.
01
);
todo_wine
expectf
(
5
.
0
-
height
,
bounds
.
Y
);
expectf_
(
width
,
bounds
.
Width
,
0
.
01
);
expectf
(
height
,
bounds
.
Height
);
rect
.
X
=
5
.
0
;
...
...
@@ -4143,6 +4310,24 @@ todo_wine
expectf_
(
width_rgn
,
bounds
.
Width
,
1
.
0
);
expectf_
(
height_rgn
,
bounds
.
Height
,
1
.
0
);
rect
.
X
=
5
.
0
;
rect
.
Y
=
5
.
0
;
rect
.
Width
=
0
.
0
;
rect
.
Height
=
0
.
0
;
status
=
GdipMeasureCharacterRanges
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
1
,
&
region
);
expect
(
Ok
,
status
);
set_rect_empty
(
&
bounds
);
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
bounds
);
expect
(
Ok
,
status
);
todo_wine
expectf_
(
5
.
0
-
width_rgn
,
bounds
.
X
,
2
.
0
);
todo_wine
expectf_
(
5
.
0
-
height_rgn
,
bounds
.
Y
,
1
.
0
);
todo_wine
expectf_
(
width_rgn
,
bounds
.
Width
,
1
.
0
);
todo_wine
expectf_
(
height_rgn
,
bounds
.
Height
,
1
.
0
);
status
=
GdipDeleteFont
(
font
);
expect
(
Ok
,
status
);
...
...
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