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
d7a0284f
Commit
d7a0284f
authored
Nov 17, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool/tests: Avoid sizeof in traces.
parent
bbf0af45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
info.c
dlls/winspool.drv/tests/info.c
+13
-16
No files found.
dlls/winspool.drv/tests/info.c
View file @
d7a0284f
...
...
@@ -2367,15 +2367,14 @@ static void test_GetPrinterData(void)
len
=
lstrlenA
(
buffer
)
+
sizeof
(
CHAR
);
/* NT4 and w2k require a buffer to save the UNICODE result also for the ANSI function */
ok
(
!
res
&&
(
type
==
REG_SZ
)
&&
((
needed
==
len
)
||
(
needed
==
(
len
*
sizeof
(
WCHAR
)))),
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d
or %d
)
\n
"
,
res
,
type
,
needed
,
buffer
,
len
,
len
*
sizeof
(
WCHAR
)
);
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)
\n
"
,
res
,
type
,
needed
,
buffer
,
len
);
needed
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrinterDataA
(
hprn
,
defaultspooldirectory
,
NULL
,
NULL
,
0
,
&
needed
);
ok
(
(
res
==
ERROR_MORE_DATA
)
&&
((
needed
==
len
)
||
(
needed
==
(
len
*
sizeof
(
WCHAR
)))),
"got %d, needed: %d (expected ERROR_MORE_DATA and %d or %d)
\n
"
,
res
,
needed
,
len
,
len
*
sizeof
(
WCHAR
));
"got %d, needed: %d (expected ERROR_MORE_DATA and %d)
\n
"
,
res
,
needed
,
len
);
/* ToDo: test SPLREG_* */
...
...
@@ -2423,8 +2422,8 @@ static void test_GetPrinterDataEx(void)
len
=
lstrlenA
(
buffer
)
+
sizeof
(
CHAR
);
/* NT4 and w2k require a buffer to save the UNICODE result also for the ANSI function */
ok
(
!
res
&&
(
type
==
REG_SZ
)
&&
((
needed
==
len
)
||
(
needed
==
(
len
*
sizeof
(
WCHAR
)))),
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d
or %d
)
\n
"
,
res
,
type
,
needed
,
buffer
,
len
,
len
*
sizeof
(
WCHAR
)
);
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)
\n
"
,
res
,
type
,
needed
,
buffer
,
len
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
));
buffer
[
MAX_PATH
]
=
0
;
...
...
@@ -2435,8 +2434,8 @@ static void test_GetPrinterDataEx(void)
(
LPBYTE
)
buffer
,
sizeof
(
buffer
),
&
needed
);
len
=
lstrlenA
(
buffer
)
+
sizeof
(
CHAR
);
ok
(
!
res
&&
(
type
==
REG_SZ
)
&&
((
needed
==
len
)
||
(
needed
==
(
len
*
sizeof
(
WCHAR
)))),
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d
or %d
)
\n
"
,
res
,
type
,
needed
,
buffer
,
len
,
len
*
sizeof
(
WCHAR
)
);
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)
\n
"
,
res
,
type
,
needed
,
buffer
,
len
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
));
buffer
[
MAX_PATH
]
=
0
;
...
...
@@ -2448,8 +2447,8 @@ static void test_GetPrinterDataEx(void)
&
type
,
(
LPBYTE
)
buffer
,
sizeof
(
buffer
),
&
needed
);
len
=
lstrlenA
(
buffer
)
+
sizeof
(
CHAR
);
ok
(
!
res
&&
(
type
==
REG_SZ
)
&&
((
needed
==
len
)
||
(
needed
==
(
len
*
sizeof
(
WCHAR
)))),
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d
or %d
)
\n
"
,
res
,
type
,
needed
,
buffer
,
len
,
len
*
sizeof
(
WCHAR
)
);
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)
\n
"
,
res
,
type
,
needed
,
buffer
,
len
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
));
...
...
@@ -2461,8 +2460,8 @@ static void test_GetPrinterDataEx(void)
(
LPBYTE
)
buffer
,
sizeof
(
buffer
),
&
needed
);
len
=
lstrlenA
(
buffer
)
+
sizeof
(
CHAR
);
ok
(
!
res
&&
(
type
==
REG_SZ
)
&&
((
needed
==
len
)
||
(
needed
==
(
len
*
sizeof
(
WCHAR
)))),
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d
or %d
)
\n
"
,
res
,
type
,
needed
,
buffer
,
len
,
len
*
sizeof
(
WCHAR
)
);
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)
\n
"
,
res
,
type
,
needed
,
buffer
,
len
);
needed
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
...
...
@@ -2471,16 +2470,14 @@ static void test_GetPrinterDataEx(void)
res
=
pGetPrinterDataExA
(
hprn
,
NULL
,
defaultspooldirectory
,
NULL
,
NULL
,
0
,
&
needed
);
ok
(
((
res
==
ERROR_MORE_DATA
)
||
broken
(
res
==
0xdeadbeef
))
&&
((
needed
==
len
)
||
(
needed
==
(
len
*
sizeof
(
WCHAR
)))),
"got %d, needed: %d (expected ERROR_MORE_DATA and %d or %d)
\n
"
,
res
,
needed
,
len
,
len
*
sizeof
(
WCHAR
));
"got %d, needed: %d (expected ERROR_MORE_DATA and %d)
\n
"
,
res
,
needed
,
len
);
needed
=
0xdeadbeef
;
SetLastError
(
0xdeaddead
);
res
=
pGetPrinterDataExA
(
hprn
,
NULL
,
defaultspooldirectory
,
NULL
,
NULL
,
0
,
&
needed
);
ok
(
((
res
==
ERROR_MORE_DATA
)
||
broken
(
res
==
0xdeaddead
))
&&
((
needed
==
len
)
||
(
needed
==
(
len
*
sizeof
(
WCHAR
)))),
"got %d, needed: %d (expected ERROR_MORE_DATA and %d or %d)
\n
"
,
res
,
needed
,
len
,
len
*
sizeof
(
WCHAR
));
"got %d, needed: %d (expected ERROR_MORE_DATA and %d)
\n
"
,
res
,
needed
,
len
);
SetLastError
(
0xdeadbeef
);
res
=
ClosePrinter
(
hprn
);
...
...
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