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
837660e0
Commit
837660e0
authored
May 19, 2021
by
Huw Davies
Committed by
Alexandre Julliard
May 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool/tests: Add tests for GetFormA().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0cddf6fe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
info.c
dlls/winspool.drv/tests/info.c
+23
-6
No files found.
dlls/winspool.drv/tests/info.c
View file @
837660e0
...
...
@@ -866,30 +866,47 @@ static void test_EnumForms(LPSTR pName)
ok
(
res
,
"(%d) returned %d with %d (expected '!=0')
\n
"
,
level
,
res
,
GetLastError
());
if
(
winetest_debug
>
1
)
{
trace
(
"dumping %d forms level %d
\n
"
,
pcReturned
,
level
);
pFI_1a
=
(
PFORM_INFO_1A
)
buffer
;
pFI_2a
=
(
PFORM_INFO_2A
)
buffer
;
for
(
i
=
0
;
i
<
pcReturned
;
i
++
)
{
/* first part is same in FORM_INFO_1 and FORM_INFO_2 */
formtype
=
(
pFI_1a
->
Flags
<=
FORMTYPE_MAX
)
?
formtypes
[
pFI_1a
->
Flags
]
:
formtypes
[
3
];
if
(
winetest_debug
>
1
)
trace
(
"%u (%s): %.03fmm x %.03fmm, %s
\n
"
,
i
,
pFI_1a
->
pName
,
(
float
)
pFI_1a
->
Size
.
cx
/
1000
,
(
float
)
pFI_1a
->
Size
.
cy
/
1000
,
formtype
);
if
(
level
==
1
)
pFI_1a
++
;
else
{
if
(
level
==
1
)
pFI_1a
++
;
else
{
BYTE
get_buffer
[
1000
];
FORM_INFO_2A
*
get_form
=
(
FORM_INFO_2A
*
)
get_buffer
;
DWORD
get_needed
;
/* output additional FORM_INFO_2 fields */
if
(
winetest_debug
>
1
)
trace
(
"
\t
keyword=%s strtype=%u muidll=%s resid=%u dispname=%s langid=%u
\n
"
,
pFI_2a
->
pKeyword
,
pFI_2a
->
StringType
,
pFI_2a
->
pMuiDll
,
pFI_2a
->
dwResourceId
,
pFI_2a
->
pDisplayName
,
pFI_2a
->
wLangId
);
if
(
pName
&&
i
==
0
)
/* GetForm() appears only to work on a printer handle */
{
res
=
GetFormA
(
hprinter
,
pFI_1a
->
pName
,
level
,
NULL
,
0
,
&
get_needed
);
ok
(
!
res
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"got %d gle %d
\n
"
,
res
,
GetLastError
()
);
if
(
get_needed
<=
sizeof
(
get_buffer
))
{
res
=
GetFormA
(
hprinter
,
pFI_1a
->
pName
,
level
,
get_buffer
,
get_needed
,
&
get_needed
);
ok
(
res
,
"got %d
\n
"
,
res
);
ok
(
!
strcmp
(
pFI_2a
->
pName
,
get_form
->
pName
),
"name mismatch
\n
"
);
res
=
GetFormA
(
hprinter
,
pFI_1a
->
pName
,
level
,
get_buffer
,
get_needed
-
1
,
&
get_needed
);
ok
(
!
res
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"got %d gle %d
\n
"
,
res
,
GetLastError
()
);
}
}
/* offset pointer pFI_1a by 1*sizeof(FORM_INFO_2A) Bytes */
pFI_2a
++
;
pFI_2a
++
;
pFI_1a
=
(
PFORM_INFO_1A
)
pFI_2a
;
}
}
}
SetLastError
(
0xdeadbeef
);
res
=
EnumFormsA
(
hprinter
,
level
,
buffer
,
cbBuf
+
1
,
&
pcbNeeded
,
&
pcReturned
);
...
...
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