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
ce7c3b50
Commit
ce7c3b50
authored
Jan 27, 2004
by
Francois Gouget
Committed by
Alexandre Julliard
Jan 27, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add trailing '\n's to ok() calls.
parent
333ecf3b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
218 additions
and
218 deletions
+218
-218
file.c
dlls/kernel/tests/file.c
+0
-0
format_msg.c
dlls/kernel/tests/format_msg.c
+58
-58
access.c
dlls/netapi32/tests/access.c
+23
-23
apibuf.c
dlls/netapi32/tests/apibuf.c
+20
-20
wksta.c
dlls/netapi32/tests/wksta.c
+22
-22
clist.c
dlls/shlwapi/tests/clist.c
+0
-0
clsid.c
dlls/shlwapi/tests/clsid.c
+15
-15
path.c
dlls/shlwapi/tests/path.c
+7
-7
shreg.c
dlls/shlwapi/tests/shreg.c
+41
-41
string.c
dlls/shlwapi/tests/string.c
+32
-32
No files found.
dlls/kernel/tests/file.c
View file @
ce7c3b50
This diff is collapsed.
Click to expand it.
dlls/kernel/tests/format_msg.c
View file @
ce7c3b50
...
...
@@ -47,177 +47,177 @@ void test_message_from_string(void)
/* the basics */
r
=
FormatMessageA
(
FORMAT_MESSAGE_FROM_STRING
,
"test"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
NULL
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* using the format feature */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1!s!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
"test"
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* no format */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
"test"
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* two pieces */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1%2"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
"te"
,
"st"
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* three pieces */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1%3%2%1"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
"t"
,
"s"
,
"e"
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* s doesn't seem to work in format strings */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%!s!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
"test"
);
ok
(
!
strcmp
(
"!s!"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
3
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"!s!"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
3
,
"failed: r=%ld
\n
"
,
r
);
/* S is unicode */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1!S!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
szwTest
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* as characters */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1!c!%2!c!%3!c!%1!c!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
't'
,
'e'
,
's'
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* some numbers */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1!d!%2!d!%3!d!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
1
,
2
,
3
);
ok
(
!
strcmp
(
"123"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
3
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"123"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
3
,
"failed: r=%ld
\n
"
,
r
);
/* a single digit with some spacing */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1!4d!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
1
);
ok
(
!
strcmp
(
" 1"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
" 1"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* a single digit, left justified */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1!-4d!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
1
);
ok
(
!
strcmp
(
"1 "
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"1 "
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* two digit decimal number */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1!4d!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
11
);
ok
(
!
strcmp
(
" 11"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
" 11"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* a hex number */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1!4x!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
11
);
ok
(
!
strcmp
(
" b"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
" b"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* a hex number, upper case */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1!4X!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
11
);
ok
(
!
strcmp
(
" B"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
" B"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* a hex number, upper case, left justified */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1!-4X!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
11
);
ok
(
!
strcmp
(
"B "
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"B "
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* a long hex number, upper case */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1!4X!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
0x1ab
);
ok
(
!
strcmp
(
" 1AB"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
" 1AB"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* two percent... */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
" %%%% "
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
));
ok
(
!
strcmp
(
" %% "
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
" %% "
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* periods are special cases */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
" %.%. %1!d!"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
),
0x1ab
);
ok
(
!
strcmp
(
" .. 427"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
7
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
" .. 427"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
7
,
"failed: r=%ld
\n
"
,
r
);
/* %0 ends the line */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"test%0test"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
));
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"test"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* %! prints an exclaimation */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"yah%!%0 "
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
));
ok
(
!
strcmp
(
"yah!"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"yah!"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* %space */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"% % "
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
));
ok
(
!
strcmp
(
" "
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
" "
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* line feed */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"hi
\n
"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
));
ok
(
!
strcmp
(
"hi
\r\n
"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"hi
\r\n
"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* carriage return line feed */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"hi
\r\n
"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
));
ok
(
!
strcmp
(
"hi
\r\n
"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"hi
\r\n
"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* carriage return line feed */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"
\r
"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
));
ok
(
!
strcmp
(
"
\r\n
"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
2
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"
\r\n
"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
2
,
"failed: r=%ld
\n
"
,
r
);
/* carriage return line feed */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"
\r\r\n
"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
));
ok
(
!
strcmp
(
"
\r\n\r\n
"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"
\r\n\r\n
"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* change of pace... test the low byte of dwflags */
/* line feed */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
|
FORMAT_MESSAGE_MAX_WIDTH_MASK
,
"hi
\n
"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
));
ok
(
!
strcmp
(
"hi "
,
out
)
||
!
strcmp
(
"hi
\r\n
"
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
3
||
r
==
4
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"hi "
,
out
)
||
!
strcmp
(
"hi
\r\n
"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
3
||
r
==
4
,
"failed: r=%ld
\n
"
,
r
);
/* carriage return line feed */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
|
FORMAT_MESSAGE_MAX_WIDTH_MASK
,
"hi
\r\n
"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
));
ok
(
!
strcmp
(
"hi "
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
3
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
"hi "
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
3
,
"failed: r=%ld
\n
"
,
r
);
/* carriage return line feed */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
|
FORMAT_MESSAGE_MAX_WIDTH_MASK
,
"
\r
"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
));
ok
(
!
strcmp
(
" "
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
1
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
" "
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
1
,
"failed: r=%ld
\n
"
,
r
);
/* carriage return line feed */
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
|
FORMAT_MESSAGE_MAX_WIDTH_MASK
,
"
\r\r\n
"
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
CHAR
));
ok
(
!
strcmp
(
" "
,
out
),
"failed out=[%s]"
,
out
);
ok
(
r
==
2
,
"failed: r=%ld"
,
r
);
ok
(
!
strcmp
(
" "
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
2
,
"failed: r=%ld
\n
"
,
r
);
}
START_TEST
(
format_msg
)
...
...
dlls/netapi32/tests/access.c
View file @
ce7c3b50
...
...
@@ -56,11 +56,11 @@ static int init_access_tests(void)
rc
=
GetUserNameW
(
user_name
,
&
dwSize
);
if
(
rc
==
FALSE
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
return
0
;
ok
(
rc
,
"User Name Retrieved"
);
ok
(
rc
,
"User Name Retrieved
\n
"
);
computer_name
[
0
]
=
0
;
dwSize
=
sizeof
(
computer_name
);
ok
(
GetComputerNameW
(
computer_name
,
&
dwSize
),
"Computer Name Retrieved"
);
ok
(
GetComputerNameW
(
computer_name
,
&
dwSize
),
"Computer Name Retrieved
\n
"
);
return
1
;
}
...
...
@@ -77,45 +77,45 @@ void run_usergetinfo_tests(void)
/* Level 0 */
rc
=
pNetUserGetInfo
(
NULL
,
sAdminUserName
,
0
,
(
LPBYTE
*
)
&
ui0
);
ok
(
rc
==
NERR_Success
,
"NetUserGetInfo: rc=%ld"
,
rc
);
ok
(
!
lstrcmpW
(
sAdminUserName
,
ui0
->
usri0_name
),
"This is really user name"
);
ok
(
rc
==
NERR_Success
,
"NetUserGetInfo: rc=%ld
\n
"
,
rc
);
ok
(
!
lstrcmpW
(
sAdminUserName
,
ui0
->
usri0_name
),
"This is really user name
\n
"
);
pNetApiBufferSize
(
ui0
,
&
dwSize
);
ok
(
dwSize
>=
(
sizeof
(
USER_INFO_0
)
+
(
lstrlenW
(
ui0
->
usri0_name
)
+
1
)
*
sizeof
(
WCHAR
)),
"Is allocated with NetApiBufferAllocate"
);
"Is allocated with NetApiBufferAllocate
\n
"
);
/* Level 10 */
rc
=
pNetUserGetInfo
(
NULL
,
sAdminUserName
,
10
,
(
LPBYTE
*
)
&
ui10
);
ok
(
rc
==
NERR_Success
,
"NetUserGetInfo: rc=%ld"
,
rc
);
ok
(
!
lstrcmpW
(
sAdminUserName
,
ui10
->
usri10_name
),
"This is really user name"
);
ok
(
rc
==
NERR_Success
,
"NetUserGetInfo: rc=%ld
\n
"
,
rc
);
ok
(
!
lstrcmpW
(
sAdminUserName
,
ui10
->
usri10_name
),
"This is really user name
\n
"
);
pNetApiBufferSize
(
ui10
,
&
dwSize
);
ok
(
dwSize
>=
(
sizeof
(
USER_INFO_10
)
+
(
lstrlenW
(
ui10
->
usri10_name
)
+
1
+
lstrlenW
(
ui10
->
usri10_comment
)
+
1
+
lstrlenW
(
ui10
->
usri10_usr_comment
)
+
1
+
lstrlenW
(
ui10
->
usri10_full_name
)
+
1
)
*
sizeof
(
WCHAR
)),
"Is allocated with NetApiBufferAllocate"
);
"Is allocated with NetApiBufferAllocate
\n
"
);
pNetApiBufferFree
(
ui0
);
pNetApiBufferFree
(
ui10
);
/* errors handling */
rc
=
pNetUserGetInfo
(
NULL
,
sAdminUserName
,
10000
,
(
LPBYTE
*
)
&
ui0
);
ok
(
rc
==
ERROR_INVALID_LEVEL
,
"Invalid Level: rc=%ld"
,
rc
);
ok
(
rc
==
ERROR_INVALID_LEVEL
,
"Invalid Level: rc=%ld
\n
"
,
rc
);
rc
=
pNetUserGetInfo
(
NULL
,
sNonexistentUser
,
0
,
(
LPBYTE
*
)
&
ui0
);
ok
(
rc
==
NERR_UserNotFound
,
"Invalid User Name: rc=%ld"
,
rc
);
ok
(
rc
==
NERR_UserNotFound
,
"Invalid User Name: rc=%ld
\n
"
,
rc
);
todo_wine
{
/* FIXME - Currently Wine can't verify whether the network path is good or bad */
rc
=
pNetUserGetInfo
(
sBadNetPath
,
sAdminUserName
,
0
,
(
LPBYTE
*
)
&
ui0
);
ok
(
rc
==
ERROR_BAD_NETPATH
||
rc
==
ERROR_NETWORK_UNREACHABLE
,
"Bad Network Path: rc=%ld"
,
rc
);
"Bad Network Path: rc=%ld
\n
"
,
rc
);
}
rc
=
pNetUserGetInfo
(
sEmptyStr
,
sAdminUserName
,
0
,
(
LPBYTE
*
)
&
ui0
);
ok
(
rc
==
ERROR_BAD_NETPATH
,
"Bad Network Path: rc=%ld"
,
rc
);
ok
(
rc
==
ERROR_BAD_NETPATH
,
"Bad Network Path: rc=%ld
\n
"
,
rc
);
rc
=
pNetUserGetInfo
(
sInvalidName
,
sAdminUserName
,
0
,
(
LPBYTE
*
)
&
ui0
);
ok
(
rc
==
ERROR_INVALID_NAME
,
"Invalid Server Name: rc=%ld"
,
rc
);
ok
(
rc
==
ERROR_INVALID_NAME
,
"Invalid Server Name: rc=%ld
\n
"
,
rc
);
rc
=
pNetUserGetInfo
(
sInvalidName2
,
sAdminUserName
,
0
,
(
LPBYTE
*
)
&
ui0
);
ok
(
rc
==
ERROR_INVALID_NAME
,
"Invalid Server Name: rc=%ld"
,
rc
);
ok
(
rc
==
ERROR_INVALID_NAME
,
"Invalid Server Name: rc=%ld
\n
"
,
rc
);
}
/* checks Level 1 of NetQueryDisplayInformation */
...
...
@@ -137,22 +137,22 @@ void run_querydisplayinformation1_tests(void)
(
PVOID
*
)
&
Buffer
);
ok
((
Result
==
ERROR_SUCCESS
)
||
(
Result
==
ERROR_MORE_DATA
),
"Information Retrieved"
);
"Information Retrieved
\n
"
);
rec
=
Buffer
;
for
(;
EntryCount
>
0
;
EntryCount
--
)
{
if
(
!
lstrcmpW
(
rec
->
usri1_name
,
sAdminUserName
))
{
ok
(
!
hasAdmin
,
"One admin user"
);
ok
(
rec
->
usri1_flags
&
UF_SCRIPT
,
"UF_SCRIPT flag is set"
);
ok
(
rec
->
usri1_flags
&
UF_NORMAL_ACCOUNT
,
"UF_NORMAL_ACCOUNT flag is set"
);
ok
(
!
hasAdmin
,
"One admin user
\n
"
);
ok
(
rec
->
usri1_flags
&
UF_SCRIPT
,
"UF_SCRIPT flag is set
\n
"
);
ok
(
rec
->
usri1_flags
&
UF_NORMAL_ACCOUNT
,
"UF_NORMAL_ACCOUNT flag is set
\n
"
);
hasAdmin
=
TRUE
;
}
else
if
(
!
lstrcmpW
(
rec
->
usri1_name
,
sGuestUserName
))
{
ok
(
!
hasGuest
,
"One guest record"
);
ok
(
rec
->
usri1_flags
&
UF_SCRIPT
,
"UF_SCRIPT flag is set"
);
ok
(
rec
->
usri1_flags
&
UF_NORMAL_ACCOUNT
,
"UF_NORMAL_ACCOUNT flag is set"
);
ok
(
!
hasGuest
,
"One guest record
\n
"
);
ok
(
rec
->
usri1_flags
&
UF_SCRIPT
,
"UF_SCRIPT flag is set
\n
"
);
ok
(
rec
->
usri1_flags
&
UF_NORMAL_ACCOUNT
,
"UF_NORMAL_ACCOUNT flag is set
\n
"
);
hasGuest
=
TRUE
;
}
...
...
@@ -163,8 +163,8 @@ void run_querydisplayinformation1_tests(void)
pNetApiBufferFree
(
Buffer
);
}
while
(
Result
==
ERROR_MORE_DATA
);
ok
(
hasAdmin
,
"Has Administrator account"
);
ok
(
hasGuest
,
"Has Guest account"
);
ok
(
hasAdmin
,
"Has Administrator account
\n
"
);
ok
(
hasGuest
,
"Has Guest account
\n
"
);
}
START_TEST
(
access
)
...
...
dlls/netapi32/tests/apibuf.c
View file @
ce7c3b50
...
...
@@ -45,37 +45,37 @@ void run_apibuf_tests(void)
/* test normal logic */
ok
(
pNetApiBufferAllocate
(
1024
,
(
LPVOID
*
)
&
p
)
==
NERR_Success
,
"Reserved memory"
);
ok
(
pNetApiBufferSize
(
p
,
&
dwSize
)
==
NERR_Success
,
"Got size"
);
ok
(
dwSize
>=
1024
,
"The size is correct"
);
"Reserved memory
\n
"
);
ok
(
pNetApiBufferSize
(
p
,
&
dwSize
)
==
NERR_Success
,
"Got size
\n
"
);
ok
(
dwSize
>=
1024
,
"The size is correct
\n
"
);
ok
(
pNetApiBufferReallocate
(
p
,
1500
,
(
LPVOID
*
)
&
p
)
==
NERR_Success
,
"Reallocated"
);
ok
(
pNetApiBufferSize
(
p
,
&
dwSize
)
==
NERR_Success
,
"Got size"
);
ok
(
dwSize
>=
1500
,
"The size is correct"
);
"Reallocated
\n
"
);
ok
(
pNetApiBufferSize
(
p
,
&
dwSize
)
==
NERR_Success
,
"Got size
\n
"
);
ok
(
dwSize
>=
1500
,
"The size is correct
\n
"
);
ok
(
pNetApiBufferFree
(
p
)
==
NERR_Success
,
"Freed"
);
ok
(
pNetApiBufferFree
(
p
)
==
NERR_Success
,
"Freed
\n
"
);
/* test errors handling */
ok
(
pNetApiBufferFree
(
p
)
==
NERR_Success
,
"Freed"
);
ok
(
pNetApiBufferFree
(
p
)
==
NERR_Success
,
"Freed
\n
"
);
ok
(
pNetApiBufferSize
(
p
,
&
dwSize
)
==
NERR_Success
,
"Got size"
);
ok
(
dwSize
>=
0
,
"The size"
);
ok
(
pNetApiBufferSize
(
NULL
,
&
dwSize
)
==
ERROR_INVALID_PARAMETER
,
"Error for NULL pointer"
);
ok
(
pNetApiBufferSize
(
p
,
&
dwSize
)
==
NERR_Success
,
"Got size
\n
"
);
ok
(
dwSize
>=
0
,
"The size
\n
"
);
ok
(
pNetApiBufferSize
(
NULL
,
&
dwSize
)
==
ERROR_INVALID_PARAMETER
,
"Error for NULL pointer
\n
"
);
/* border reallocate cases */
ok
(
pNetApiBufferReallocate
(
0
,
1500
,
(
LPVOID
*
)
&
p
)
!=
NERR_Success
,
"(Re)allocated"
);
ok
(
p
==
NULL
,
"Some memory got allocated"
);
ok
(
pNetApiBufferAllocate
(
1024
,
(
LPVOID
*
)
&
p
)
==
NERR_Success
,
"Memory not reserved"
);
ok
(
pNetApiBufferReallocate
(
p
,
0
,
(
LPVOID
*
)
&
p
)
==
NERR_Success
,
"Not freed"
);
ok
(
p
==
NULL
,
"Pointer not cleared"
);
ok
(
pNetApiBufferReallocate
(
0
,
1500
,
(
LPVOID
*
)
&
p
)
!=
NERR_Success
,
"(Re)allocated
\n
"
);
ok
(
p
==
NULL
,
"Some memory got allocated
\n
"
);
ok
(
pNetApiBufferAllocate
(
1024
,
(
LPVOID
*
)
&
p
)
==
NERR_Success
,
"Memory not reserved
\n
"
);
ok
(
pNetApiBufferReallocate
(
p
,
0
,
(
LPVOID
*
)
&
p
)
==
NERR_Success
,
"Not freed
\n
"
);
ok
(
p
==
NULL
,
"Pointer not cleared
\n
"
);
/* 0-length buffer */
ok
(
pNetApiBufferAllocate
(
0
,
(
LPVOID
*
)
&
p
)
==
NERR_Success
,
"Reserved memory"
);
ok
(
pNetApiBufferSize
(
p
,
&
dwSize
)
==
NERR_Success
,
"Got size"
);
ok
((
dwSize
>=
0
)
&&
(
dwSize
<
0xFFFFFFFF
),
"The size of the 0-length buffer"
);
ok
(
pNetApiBufferFree
(
p
)
==
NERR_Success
,
"Freed"
);
"Reserved memory
\n
"
);
ok
(
pNetApiBufferSize
(
p
,
&
dwSize
)
==
NERR_Success
,
"Got size
\n
"
);
ok
((
dwSize
>=
0
)
&&
(
dwSize
<
0xFFFFFFFF
),
"The size of the 0-length buffer
\n
"
);
ok
(
pNetApiBufferFree
(
p
)
==
NERR_Success
,
"Freed
\n
"
);
}
START_TEST
(
apibuf
)
...
...
dlls/netapi32/tests/wksta.c
View file @
ce7c3b50
...
...
@@ -52,11 +52,11 @@ static int init_wksta_tests(void)
rc
=
GetUserNameW
(
user_name
,
&
dwSize
);
if
(
rc
==
FALSE
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
return
0
;
ok
(
rc
,
"User Name Retrieved"
);
ok
(
rc
,
"User Name Retrieved
\n
"
);
computer_name
[
0
]
=
0
;
dwSize
=
sizeof
(
computer_name
);
ok
(
GetComputerNameW
(
computer_name
,
&
dwSize
),
"Computer Name Retrieved"
);
ok
(
GetComputerNameW
(
computer_name
,
&
dwSize
),
"Computer Name Retrieved
\n
"
);
return
1
;
}
...
...
@@ -67,8 +67,8 @@ static void run_get_comp_name_tests(void)
if
(
!
pNetpGetComputerName
)
return
;
ok
(
pNetpGetComputerName
(
&
ws
)
==
NERR_Success
,
"Computer name is retrieved"
);
ok
(
!
lstrcmpW
(
computer_name
,
ws
),
"This is really computer name"
);
ok
(
pNetpGetComputerName
(
&
ws
)
==
NERR_Success
,
"Computer name is retrieved
\n
"
);
ok
(
!
lstrcmpW
(
computer_name
,
ws
),
"This is really computer name
\n
"
);
pNetApiBufferFree
(
ws
);
}
...
...
@@ -84,35 +84,35 @@ static void run_wkstausergetinfo_tests(void)
/* Level 0 */
ok
(
pNetWkstaUserGetInfo
(
NULL
,
0
,
(
LPBYTE
*
)
&
ui0
)
==
NERR_Success
,
"NetWkstaUserGetInfo is successful"
);
ok
(
!
lstrcmpW
(
user_name
,
ui0
->
wkui0_username
),
"This is really user name"
);
"NetWkstaUserGetInfo is successful
\n
"
);
ok
(
!
lstrcmpW
(
user_name
,
ui0
->
wkui0_username
),
"This is really user name
\n
"
);
pNetApiBufferSize
(
ui0
,
&
dwSize
);
ok
(
dwSize
>=
(
sizeof
(
WKSTA_USER_INFO_0
)
+
lstrlenW
(
ui0
->
wkui0_username
)
*
sizeof
(
WCHAR
)),
"Is allocated with NetApiBufferAllocate"
);
"Is allocated with NetApiBufferAllocate
\n
"
);
/* Level 1 */
ok
(
pNetWkstaUserGetInfo
(
NULL
,
1
,
(
LPBYTE
*
)
&
ui1
)
==
NERR_Success
,
"NetWkstaUserGetInfo is successful"
);
"NetWkstaUserGetInfo is successful
\n
"
);
ok
(
lstrcmpW
(
ui1
->
wkui1_username
,
ui0
->
wkui0_username
)
==
0
,
"the same name as returned for level 0"
);
"the same name as returned for level 0
\n
"
);
pNetApiBufferSize
(
ui1
,
&
dwSize
);
ok
(
dwSize
>=
(
sizeof
(
WKSTA_USER_INFO_1
)
+
(
lstrlenW
(
ui1
->
wkui1_username
)
+
lstrlenW
(
ui1
->
wkui1_logon_domain
)
+
lstrlenW
(
ui1
->
wkui1_oth_domains
)
+
lstrlenW
(
ui1
->
wkui1_logon_server
))
*
sizeof
(
WCHAR
)),
"Is allocated with NetApiBufferAllocate"
);
"Is allocated with NetApiBufferAllocate
\n
"
);
/* Level 1101 */
ok
(
pNetWkstaUserGetInfo
(
NULL
,
1101
,
(
LPBYTE
*
)
&
ui1101
)
==
NERR_Success
,
"NetWkstaUserGetInfo is successful"
);
"NetWkstaUserGetInfo is successful
\n
"
);
ok
(
lstrcmpW
(
ui1101
->
wkui1101_oth_domains
,
ui1
->
wkui1_oth_domains
)
==
0
,
"the same oth_domains as returned for level 1"
);
"the same oth_domains as returned for level 1
\n
"
);
pNetApiBufferSize
(
ui1101
,
&
dwSize
);
ok
(
dwSize
>=
(
sizeof
(
WKSTA_USER_INFO_1101
)
+
lstrlenW
(
ui1101
->
wkui1101_oth_domains
)
*
sizeof
(
WCHAR
)),
"Is allocated with NetApiBufferAllocate"
);
"Is allocated with NetApiBufferAllocate
\n
"
);
pNetApiBufferFree
(
ui0
);
pNetApiBufferFree
(
ui1
);
...
...
@@ -120,7 +120,7 @@ static void run_wkstausergetinfo_tests(void)
/* errors handling */
ok
(
pNetWkstaUserGetInfo
(
NULL
,
10000
,
(
LPBYTE
*
)
&
ui0
)
==
ERROR_INVALID_LEVEL
,
"Invalid level"
);
"Invalid level
\n
"
);
}
static
void
run_wkstatransportenum_tests
(
void
)
...
...
@@ -136,7 +136,7 @@ static void run_wkstatransportenum_tests(void)
apiReturn
=
pNetWkstaTransportEnum
(
NULL
,
1
,
NULL
,
MAX_PREFERRED_LENGTH
,
NULL
,
&
totalEntries
,
NULL
);
ok
(
apiReturn
==
ERROR_INVALID_LEVEL
||
apiReturn
==
ERROR_INVALID_PARAMETER
,
"NetWkstaTransportEnum returned %ld"
,
apiReturn
);
"NetWkstaTransportEnum returned %ld
\n
"
,
apiReturn
);
/* 2nd check: is param 5 passed? (only if level passes?) */
apiReturn
=
pNetWkstaTransportEnum
(
NULL
,
0
,
NULL
,
MAX_PREFERRED_LENGTH
,
...
...
@@ -147,30 +147,30 @@ static void run_wkstatransportenum_tests(void)
return
;
ok
(
apiReturn
==
STATUS_ACCESS_VIOLATION
||
apiReturn
==
ERROR_INVALID_PARAMETER
,
"NetWkstaTransportEnum returned %ld"
,
apiReturn
);
"NetWkstaTransportEnum returned %ld
\n
"
,
apiReturn
);
/* 3rd check: is param 3 passed? */
apiReturn
=
pNetWkstaTransportEnum
(
NULL
,
0
,
NULL
,
MAX_PREFERRED_LENGTH
,
NULL
,
NULL
,
NULL
);
ok
(
apiReturn
==
STATUS_ACCESS_VIOLATION
||
apiReturn
==
ERROR_INVALID_PARAMETER
,
"NetWkstaTransportEnum returned %ld"
,
apiReturn
);
"NetWkstaTransportEnum returned %ld
\n
"
,
apiReturn
);
/* 4th check: is param 6 passed? */
apiReturn
=
pNetWkstaTransportEnum
(
NULL
,
0
,
&
bufPtr
,
MAX_PREFERRED_LENGTH
,
&
entriesRead
,
NULL
,
NULL
);
ok
(
apiReturn
==
RPC_X_NULL_REF_POINTER
,
"null pointer"
);
ok
(
apiReturn
==
RPC_X_NULL_REF_POINTER
,
"null pointer
\n
"
);
/* final check: valid return, actually get data back */
apiReturn
=
pNetWkstaTransportEnum
(
NULL
,
0
,
&
bufPtr
,
MAX_PREFERRED_LENGTH
,
&
entriesRead
,
&
totalEntries
,
NULL
);
ok
(
apiReturn
==
NERR_Success
||
apiReturn
==
ERROR_NETWORK_UNREACHABLE
,
"NetWkstaTransportEnum returned %ld"
,
apiReturn
);
"NetWkstaTransportEnum returned %ld
\n
"
,
apiReturn
);
if
(
apiReturn
==
NERR_Success
)
{
/* WKSTA_TRANSPORT_INFO_0 *transports = (WKSTA_TRANSPORT_INFO_0 *)bufPtr; */
ok
(
bufPtr
!=
NULL
,
"got data back"
);
ok
(
entriesRead
>
0
,
"read at least one transport"
);
ok
(
totalEntries
>
0
,
"at least one transport"
);
ok
(
bufPtr
!=
NULL
,
"got data back
\n
"
);
ok
(
entriesRead
>
0
,
"read at least one transport
\n
"
);
ok
(
totalEntries
>
0
,
"at least one transport
\n
"
);
pNetApiBufferFree
(
bufPtr
);
}
}
...
...
dlls/shlwapi/tests/clist.c
View file @
ce7c3b50
This diff is collapsed.
Click to expand it.
dlls/shlwapi/tests/clsid.c
View file @
ce7c3b50
...
...
@@ -114,13 +114,13 @@ static void test_ClassIDs(void)
while
(
*
guids
)
{
dwLen
=
pSHLWAPI_23
(
*
guids
,
szBuff
,
256
);
ok
(
dwLen
==
39
,
"wrong size for id %d"
,
i
);
ok
(
dwLen
==
39
,
"wrong size for id %d
\n
"
,
i
);
bRet
=
pSHLWAPI_269
(
szBuff
,
&
guid
);
ok
(
bRet
!=
FALSE
,
"created invalid string '%s'"
,
szBuff
);
ok
(
bRet
!=
FALSE
,
"created invalid string '%s'
\n
"
,
szBuff
);
if
(
bRet
)
ok
(
IsEqualGUID
(
*
guids
,
&
guid
),
"GUID created wrong %d"
,
i
);
ok
(
IsEqualGUID
(
*
guids
,
&
guid
),
"GUID created wrong %d
\n
"
,
i
);
guids
++
;
i
++
;
...
...
@@ -128,42 +128,42 @@ static void test_ClassIDs(void)
/* Test endianess */
dwLen
=
pSHLWAPI_23
(
&
IID_Endianess
,
szBuff
,
256
);
ok
(
dwLen
==
39
,
"wrong size for IID_Endianess"
);
ok
(
dwLen
==
39
,
"wrong size for IID_Endianess
\n
"
);
ok
(
!
strcmp
(
szBuff
,
"{01020304-0506-0708-090A-0B0C0D0E0F0A}"
),
"Endianess Broken, got '%s'"
,
szBuff
);
"Endianess Broken, got '%s'
\n
"
,
szBuff
);
/* test lengths */
szBuff
[
0
]
=
':'
;
dwLen
=
pSHLWAPI_23
(
&
IID_Endianess
,
szBuff
,
0
);
ok
(
dwLen
==
0
,
"accepted bad length"
);
ok
(
szBuff
[
0
]
==
':'
,
"wrote to buffer with no length"
);
ok
(
dwLen
==
0
,
"accepted bad length
\n
"
);
ok
(
szBuff
[
0
]
==
':'
,
"wrote to buffer with no length
\n
"
);
szBuff
[
0
]
=
':'
;
dwLen
=
pSHLWAPI_23
(
&
IID_Endianess
,
szBuff
,
38
);
ok
(
dwLen
==
0
,
"accepted bad length"
);
ok
(
szBuff
[
0
]
==
':'
,
"wrote to buffer with no length"
);
ok
(
dwLen
==
0
,
"accepted bad length
\n
"
);
ok
(
szBuff
[
0
]
==
':'
,
"wrote to buffer with no length
\n
"
);
szBuff
[
0
]
=
':'
;
dwLen
=
pSHLWAPI_23
(
&
IID_Endianess
,
szBuff
,
39
);
ok
(
dwLen
==
39
,
"rejected ok length"
);
ok
(
szBuff
[
0
]
==
'{'
,
"Didn't write to buffer with ok length"
);
ok
(
dwLen
==
39
,
"rejected ok length
\n
"
);
ok
(
szBuff
[
0
]
==
'{'
,
"Didn't write to buffer with ok length
\n
"
);
/* Test string */
strcpy
(
szBuff
,
"{xxx-"
);
bRet
=
pSHLWAPI_269
(
szBuff
,
&
guid
);
ok
(
bRet
==
FALSE
,
"accepted invalid string"
);
ok
(
bRet
==
FALSE
,
"accepted invalid string
\n
"
);
dwLen
=
pSHLWAPI_23
(
&
IID_Endianess
,
szBuff
,
39
);
ok
(
dwLen
==
39
,
"rejected ok length"
);
ok
(
szBuff
[
0
]
==
'{'
,
"Didn't write to buffer with ok length"
);
ok
(
dwLen
==
39
,
"rejected ok length
\n
"
);
ok
(
szBuff
[
0
]
==
'{'
,
"Didn't write to buffer with ok length
\n
"
);
}
START_TEST
(
clsid
)
{
hShlwapi
=
LoadLibraryA
(
"shlwapi.dll"
);
ok
(
hShlwapi
!=
0
,
"LoadLibraryA failed"
);
ok
(
hShlwapi
!=
0
,
"LoadLibraryA failed
\n
"
);
if
(
hShlwapi
)
{
pSHLWAPI_269
=
(
void
*
)
GetProcAddress
(
hShlwapi
,
(
LPSTR
)
269
);
...
...
dlls/shlwapi/tests/path.c
View file @
ce7c3b50
...
...
@@ -56,12 +56,12 @@ static void hash_url(const char* szUrl)
DWORD
cbSize
=
sizeof
(
DWORD
);
DWORD
dwHash1
,
dwHash2
;
ok
(
UrlHashA
(
szTestUrl
,
(
LPBYTE
)
&
dwHash1
,
cbSize
)
==
S_OK
,
"UrlHashA didn't return S_OK"
);
ok
(
UrlHashW
(
wszTestUrl
,
(
LPBYTE
)
&
dwHash2
,
cbSize
)
==
S_OK
,
"UrlHashW didn't return S_OK"
);
ok
(
UrlHashA
(
szTestUrl
,
(
LPBYTE
)
&
dwHash1
,
cbSize
)
==
S_OK
,
"UrlHashA didn't return S_OK
\n
"
);
ok
(
UrlHashW
(
wszTestUrl
,
(
LPBYTE
)
&
dwHash2
,
cbSize
)
==
S_OK
,
"UrlHashW didn't return S_OK
\n
"
);
FreeWideString
(
wszTestUrl
);
ok
(
dwHash1
==
dwHash2
,
"Hashes didn't compare"
);
ok
(
dwHash1
==
dwHash2
,
"Hashes didn't compare
\n
"
);
}
static
void
test_UrlHash
(
void
)
...
...
@@ -81,13 +81,13 @@ static void test_url_part(const char* szUrl, DWORD dwPart, DWORD dwFlags, const
DWORD
dwSize
;
dwSize
=
INTERNET_MAX_URL_LENGTH
;
ok
(
UrlGetPartA
(
szUrl
,
szPart
,
&
dwSize
,
dwPart
,
dwFlags
)
==
S_OK
,
"UrlGetPartA didn't return S_OK"
);
ok
(
UrlGetPartA
(
szUrl
,
szPart
,
&
dwSize
,
dwPart
,
dwFlags
)
==
S_OK
,
"UrlGetPartA didn't return S_OK
\n
"
);
dwSize
=
INTERNET_MAX_URL_LENGTH
;
ok
(
UrlGetPartW
(
wszUrl
,
wszPart
,
&
dwSize
,
dwPart
,
dwFlags
)
==
S_OK
,
"UrlGetPartW didn't return S_OK"
);
ok
(
UrlGetPartW
(
wszUrl
,
wszPart
,
&
dwSize
,
dwPart
,
dwFlags
)
==
S_OK
,
"UrlGetPartW didn't return S_OK
\n
"
);
wszConvertedPart
=
GetWideString
(
szPart
);
ok
(
strcmpW
(
wszPart
,
wszConvertedPart
)
==
0
,
"Strings didn't match between ascii and unicode UrlGetPart!"
);
ok
(
strcmpW
(
wszPart
,
wszConvertedPart
)
==
0
,
"Strings didn't match between ascii and unicode UrlGetPart!
\n
"
);
FreeWideString
(
wszUrl
);
FreeWideString
(
wszConvertedPart
);
...
...
@@ -95,7 +95,7 @@ static void test_url_part(const char* szUrl, DWORD dwPart, DWORD dwFlags, const
/* Note that v6.0 and later don't return '?' with the query */
ok
(
strcmp
(
szPart
,
szExpected
)
==
0
||
(
*
szExpected
==
'?'
&&
!
strcmp
(
szPart
,
szExpected
+
1
)),
"Expected %s, but got %s"
,
szExpected
,
szPart
);
"Expected %s, but got %s
\n
"
,
szExpected
,
szPart
);
}
static
void
test_UrlGetPart
(
void
)
...
...
dlls/shlwapi/tests/shreg.c
View file @
ce7c3b50
...
...
@@ -78,13 +78,13 @@ static HKEY create_test_entries(void)
SetEnvironmentVariableA
(
"LONGSYSTEMVAR"
,
"bar"
);
SetEnvironmentVariableA
(
"FOO"
,
"ImARatherLongButIndeedNeededString"
);
ok
(
!
RegCreateKeyA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
&
hKey
),
"RegCreateKeyA failed"
);
ok
(
!
RegCreateKeyA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
&
hKey
),
"RegCreateKeyA failed
\n
"
);
if
(
hKey
)
{
ok
(
!
RegSetValueExA
(
hKey
,
"Test1"
,
0
,
REG_EXPAND_SZ
,
sTestpath1
,
strlen
(
sTestpath1
)
+
1
),
"RegSetValueExA failed"
);
ok
(
!
RegSetValueExA
(
hKey
,
"Test2"
,
0
,
REG_SZ
,
sTestpath1
,
strlen
(
sTestpath1
)
+
1
),
"RegSetValueExA failed"
);
ok
(
!
RegSetValueExA
(
hKey
,
"Test3"
,
0
,
REG_EXPAND_SZ
,
sTestpath2
,
strlen
(
sTestpath2
)
+
1
),
"RegSetValueExA failed"
);
ok
(
!
RegSetValueExA
(
hKey
,
"Test1"
,
0
,
REG_EXPAND_SZ
,
sTestpath1
,
strlen
(
sTestpath1
)
+
1
),
"RegSetValueExA failed
\n
"
);
ok
(
!
RegSetValueExA
(
hKey
,
"Test2"
,
0
,
REG_SZ
,
sTestpath1
,
strlen
(
sTestpath1
)
+
1
),
"RegSetValueExA failed
\n
"
);
ok
(
!
RegSetValueExA
(
hKey
,
"Test3"
,
0
,
REG_EXPAND_SZ
,
sTestpath2
,
strlen
(
sTestpath2
)
+
1
),
"RegSetValueExA failed
\n
"
);
}
sExpLen1
=
ExpandEnvironmentStringsA
(
sTestpath1
,
sExpTestpath1
,
sizeof
(
sExpTestpath1
));
...
...
@@ -104,16 +104,16 @@ static void test_SHGetValue(void)
strcpy
(
buf
,
sEmptyBuffer
);
dwSize
=
MAX_PATH
;
dwType
=
-
1
;
ok
(
!
SHGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
&
dwType
,
buf
,
&
dwSize
),
"SHGetValueA failed"
);
ok
(
0
==
strcmp
(
sExpTestpath1
,
buf
),
"(%s,%s)"
,
buf
,
sExpTestpath1
);
ok
(
REG_SZ
==
dwType
,
"(%lx)"
,
dwType
);
ok
(
!
SHGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
&
dwType
,
buf
,
&
dwSize
),
"SHGetValueA failed
\n
"
);
ok
(
0
==
strcmp
(
sExpTestpath1
,
buf
),
"(%s,%s)
\n
"
,
buf
,
sExpTestpath1
);
ok
(
REG_SZ
==
dwType
,
"(%lx)
\n
"
,
dwType
);
strcpy
(
buf
,
sEmptyBuffer
);
dwSize
=
MAX_PATH
;
dwType
=
-
1
;
ok
(
!
SHGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test2"
,
&
dwType
,
buf
,
&
dwSize
),
"SHGetValueA failed"
);
ok
(
0
==
strcmp
(
sTestpath1
,
buf
)
,
"(%s)"
,
buf
);
ok
(
REG_SZ
==
dwType
,
"(%lx)"
,
dwType
);
ok
(
!
SHGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test2"
,
&
dwType
,
buf
,
&
dwSize
),
"SHGetValueA failed
\n
"
);
ok
(
0
==
strcmp
(
sTestpath1
,
buf
)
,
"(%s)
\n
"
,
buf
);
ok
(
REG_SZ
==
dwType
,
"(%lx)
\n
"
,
dwType
);
}
static
void
test_SHGetRegPath
(
void
)
...
...
@@ -124,8 +124,8 @@ static void test_SHGetRegPath(void)
return
;
strcpy
(
buf
,
sEmptyBuffer
);
ok
(
!
(
*
pSHRegGetPathA
)(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
buf
,
0
),
"SHRegGetPathA failed"
);
ok
(
0
==
strcmp
(
sExpTestpath1
,
buf
)
,
"(%s)"
,
buf
);
ok
(
!
(
*
pSHRegGetPathA
)(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
buf
,
0
),
"SHRegGetPathA failed
\n
"
);
ok
(
0
==
strcmp
(
sExpTestpath1
,
buf
)
,
"(%s)
\n
"
,
buf
);
}
static
void
test_SHQUeryValueEx
(
void
)
...
...
@@ -138,7 +138,7 @@ static void test_SHQUeryValueEx(void)
const
char
*
sTestedFunction
=
""
;
DWORD
nUsedBuffer1
,
nUsedBuffer2
;
ok
(
!
RegOpenKeyExA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
0
,
KEY_QUERY_VALUE
,
&
hKey
),
"test4 RegOpenKey"
);
ok
(
!
RegOpenKeyExA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
0
,
KEY_QUERY_VALUE
,
&
hKey
),
"test4 RegOpenKey
\n
"
);
/****** SHQueryValueExA ******/
...
...
@@ -148,29 +148,29 @@ static void test_SHQUeryValueEx(void)
/*
* Case 1.1 All arguments are NULL
*/
ok
(
!
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
NULL
,
NULL
,
NULL
),
"SHQueryValueExA failed"
);
ok
(
!
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
NULL
,
NULL
,
NULL
),
"SHQueryValueExA failed
\n
"
);
/*
* Case 1.2 dwType is set
*/
dwType
=
-
1
;
ok
(
!
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
&
dwType
,
NULL
,
NULL
),
"SHQueryValueExA failed"
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
ok
(
!
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
&
dwType
,
NULL
,
NULL
),
"SHQueryValueExA failed
\n
"
);
ok
(
dwType
==
REG_SZ
,
"(%lu)
\n
"
,
dwType
);
/*
* dwSize is set
* dwExpanded < dwUnExpanded
*/
dwSize
=
6
;
ok
(
!
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
NULL
,
NULL
,
&
dwSize
),
"SHQueryValueExA failed"
);
ok
(
dwSize
==
nUsedBuffer1
,
"(%lu,%lu)"
,
dwSize
,
nUsedBuffer1
);
ok
(
!
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
NULL
,
NULL
,
&
dwSize
),
"SHQueryValueExA failed
\n
"
);
ok
(
dwSize
==
nUsedBuffer1
,
"(%lu,%lu)
\n
"
,
dwSize
,
nUsedBuffer1
);
/*
* dwExpanded > dwUnExpanded
*/
dwSize
=
6
;
ok
(
!
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
NULL
,
NULL
,
&
dwSize
),
"SHQueryValueExA failed"
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%lu)"
,
dwSize
,
nUsedBuffer2
);
ok
(
!
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
NULL
,
NULL
,
&
dwSize
),
"SHQueryValueExA failed
\n
"
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%lu)
\n
"
,
dwSize
,
nUsedBuffer2
);
/*
...
...
@@ -180,10 +180,10 @@ static void test_SHQUeryValueEx(void)
dwSize
=
6
;
dwType
=
-
1
;
dwRet
=
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
&
dwType
,
buf
,
&
dwSize
);
ok
(
dwRet
==
ERROR_MORE_DATA
,
"(%lu)"
,
dwRet
);
ok
(
0
==
strcmp
(
sEmptyBuffer
,
buf
),
"(%s)"
,
buf
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
ok
(
dwSize
==
nUsedBuffer1
,
"(%lu,%lu)"
,
dwSize
,
nUsedBuffer1
);
ok
(
dwRet
==
ERROR_MORE_DATA
,
"(%lu)
\n
"
,
dwRet
);
ok
(
0
==
strcmp
(
sEmptyBuffer
,
buf
),
"(%s)
\n
"
,
buf
);
ok
(
dwType
==
REG_SZ
,
"(%lu)
\n
"
,
dwType
);
ok
(
dwSize
==
nUsedBuffer1
,
"(%lu,%lu)
\n
"
,
dwSize
,
nUsedBuffer1
);
/*
* string grows during expanding
...
...
@@ -192,10 +192,10 @@ static void test_SHQUeryValueEx(void)
dwSize
=
6
;
dwType
=
-
1
;
dwRet
=
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
dwType
,
buf
,
&
dwSize
);
ok
(
ERROR_MORE_DATA
==
dwRet
,
"ERROR_MORE_DATA"
);
ok
(
0
==
strcmp
(
sEmptyBuffer
,
buf
),
"(%s)"
,
buf
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%lu)"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
ok
(
ERROR_MORE_DATA
==
dwRet
,
"ERROR_MORE_DATA
\n
"
);
ok
(
0
==
strcmp
(
sEmptyBuffer
,
buf
),
"(%s)
\n
"
,
buf
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%lu)
\n
"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwType
==
REG_SZ
,
"(%lu)
\n
"
,
dwType
);
/*
* if the unexpanded string fits into the buffer it can get cut when expanded
...
...
@@ -203,11 +203,11 @@ static void test_SHQUeryValueEx(void)
strcpy
(
buf
,
sEmptyBuffer
);
dwSize
=
sExpLen2
-
4
;
dwType
=
-
1
;
ok
(
ERROR_MORE_DATA
==
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
dwType
,
buf
,
&
dwSize
),
"Expected ERROR_MORE_DATA"
);
ok
(
0
==
strncmp
(
sExpTestpath2
,
buf
,
sExpLen2
-
4
-
1
),
"(%s)"
,
buf
);
ok
(
sExpLen2
-
4
-
1
==
strlen
(
buf
),
"(%s)"
,
buf
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%lu)"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
ok
(
ERROR_MORE_DATA
==
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
dwType
,
buf
,
&
dwSize
),
"Expected ERROR_MORE_DATA
\n
"
);
ok
(
0
==
strncmp
(
sExpTestpath2
,
buf
,
sExpLen2
-
4
-
1
),
"(%s)
\n
"
,
buf
);
ok
(
sExpLen2
-
4
-
1
==
strlen
(
buf
),
"(%s)
\n
"
,
buf
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%lu)
\n
"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwType
==
REG_SZ
,
"(%lu)
\n
"
,
dwType
);
/*
* The buffer is NULL but the size is set
...
...
@@ -216,9 +216,9 @@ static void test_SHQUeryValueEx(void)
dwSize
=
6
;
dwType
=
-
1
;
dwRet
=
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
dwType
,
NULL
,
&
dwSize
);
ok
(
ERROR_SUCCESS
==
dwRet
,
"(%lu)"
,
dwRet
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%lu)"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
ok
(
ERROR_SUCCESS
==
dwRet
,
"(%lu)
\n
"
,
dwRet
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%lu)
\n
"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwType
==
REG_SZ
,
"(%lu)
\n
"
,
dwType
);
RegCloseKey
(
hKey
);
...
...
@@ -239,20 +239,20 @@ static void test_SHCopyKey(void)
hKeyDst
=
NULL
;
if
(
RegCreateKeyA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
"
\\
CopyDestination"
,
&
hKeyDst
)
||
!
hKeyDst
)
{
ok
(
0
,
"didn't open dest"
);
ok
(
0
,
"didn't open dest
\n
"
);
return
;
}
hKeySrc
=
NULL
;
if
(
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
REG_CURRENT_VERSION
,
&
hKeySrc
)
||
!
hKeySrc
)
{
ok
(
0
,
"didn't open source"
);
ok
(
0
,
"didn't open source
\n
"
);
return
;
}
if
(
pSHCopyKeyA
)
ok
(
!
(
*
pSHCopyKeyA
)(
hKeyDst
,
NULL
,
hKeySrc
,
0
),
"failed copy"
);
ok
(
!
(
*
pSHCopyKeyA
)(
hKeyDst
,
NULL
,
hKeySrc
,
0
),
"failed copy
\n
"
);
RegCloseKey
(
hKeySrc
);
RegCloseKey
(
hKeyDst
);
...
...
@@ -261,12 +261,12 @@ static void test_SHCopyKey(void)
hKeyDst
=
NULL
;
if
(
RegOpenKeyA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
"
\\
CopyDestination
\\
AeDebug"
,
&
hKeyDst
)
||
!
hKeyDst
)
{
ok
(
0
,
"didn't open copy"
);
ok
(
0
,
"didn't open copy
\n
"
);
return
;
}
/* And the we copied the values too */
ok
(
!
SHQueryValueExA
(
hKeyDst
,
"Debugger"
,
NULL
,
NULL
,
NULL
,
NULL
),
"SHQueryValueExA failed"
);
ok
(
!
SHQueryValueExA
(
hKeyDst
,
"Debugger"
,
NULL
,
NULL
,
NULL
,
NULL
),
"SHQueryValueExA failed
\n
"
);
RegCloseKey
(
hKeyDst
);
}
...
...
dlls/shlwapi/tests/string.c
View file @
ce7c3b50
...
...
@@ -159,7 +159,7 @@ static void test_StrChrA(void)
WORD
count
;
/* this test crashes on win2k SP4 */
/*ok(!StrChrA(NULL,'\0'), "found a character in a NULL string!");*/
/*ok(!StrChrA(NULL,'\0'), "found a character in a NULL string!
\n
");*/
for
(
count
=
32
;
count
<
128
;
count
++
)
string
[
count
]
=
(
char
)
count
;
...
...
@@ -186,7 +186,7 @@ static void test_StrChrW(void)
WORD
count
;
/* this test crashes on win2k SP4 */
/*ok(!StrChrW(NULL,'\0'), "found a character in a NULL string!");*/
/*ok(!StrChrW(NULL,'\0'), "found a character in a NULL string!
\n
");*/
for
(
count
=
32
;
count
<
16384
;
count
++
)
string
[
count
]
=
count
;
...
...
@@ -195,13 +195,13 @@ static void test_StrChrW(void)
for
(
count
=
32
;
count
<
16384
;
count
++
)
{
LPWSTR
result
=
StrChrW
(
string
+
32
,
count
);
ok
((
result
-
string
)
==
count
,
"found char %d in wrong place"
,
count
);
ok
((
result
-
string
)
==
count
,
"found char %d in wrong place
\n
"
,
count
);
}
for
(
count
=
32
;
count
<
16384
;
count
++
)
{
LPWSTR
result
=
StrChrW
(
string
+
count
+
1
,
count
);
ok
(
!
result
,
"found char not in the string"
);
ok
(
!
result
,
"found char not in the string
\n
"
);
}
}
...
...
@@ -211,7 +211,7 @@ static void test_StrChrIA(void)
WORD
count
;
/* this test crashes on win2k SP4 */
/*ok(!StrChrIA(NULL,'\0'), "found a character in a NULL string!");*/
/*ok(!StrChrIA(NULL,'\0'), "found a character in a NULL string!
\n
");*/
for
(
count
=
32
;
count
<
128
;
count
++
)
string
[
count
]
=
(
char
)
count
;
...
...
@@ -221,14 +221,14 @@ static void test_StrChrIA(void)
{
LPSTR
result
=
StrChrIA
(
string
+
32
,
count
);
ok
(
result
-
string
==
count
,
"found char '%c' in wrong place"
,
count
);
ok
(
StrChrIA
(
result
,
count
)
!=
NULL
,
"didn't find lowercase '%c'"
,
count
);
ok
(
result
-
string
==
count
,
"found char '%c' in wrong place
\n
"
,
count
);
ok
(
StrChrIA
(
result
,
count
)
!=
NULL
,
"didn't find lowercase '%c'
\n
"
,
count
);
}
for
(
count
=
'a'
;
count
<
'z'
;
count
++
)
{
LPSTR
result
=
StrChrIA
(
string
+
count
+
1
,
count
);
ok
(
!
result
,
"found char not in the string"
);
ok
(
!
result
,
"found char not in the string
\n
"
);
}
}
...
...
@@ -238,7 +238,7 @@ static void test_StrChrIW(void)
WORD
count
;
/* this test crashes on win2k SP4 */
/*ok(!StrChrIA(NULL,'\0'), "found a character in a NULL string!");*/
/*ok(!StrChrIA(NULL,'\0'), "found a character in a NULL string!
\n
");*/
for
(
count
=
32
;
count
<
128
;
count
++
)
string
[
count
]
=
count
;
...
...
@@ -248,14 +248,14 @@ static void test_StrChrIW(void)
{
LPWSTR
result
=
StrChrIW
(
string
+
32
,
count
);
ok
(
result
-
string
==
count
,
"found char '%c' in wrong place"
,
count
);
ok
(
StrChrIW
(
result
,
count
)
!=
NULL
,
"didn't find lowercase '%c'"
,
count
);
ok
(
result
-
string
==
count
,
"found char '%c' in wrong place
\n
"
,
count
);
ok
(
StrChrIW
(
result
,
count
)
!=
NULL
,
"didn't find lowercase '%c'
\n
"
,
count
);
}
for
(
count
=
'a'
;
count
<
'z'
;
count
++
)
{
LPWSTR
result
=
StrChrIW
(
string
+
count
+
1
,
count
);
ok
(
!
result
,
"found char not in the string"
);
ok
(
!
result
,
"found char not in the string
\n
"
);
}
}
...
...
@@ -265,7 +265,7 @@ static void test_StrRChrA(void)
WORD
count
;
/* this test crashes on win2k SP4 */
/*ok(!StrRChrA(NULL, NULL,'\0'), "found a character in a NULL string!");*/
/*ok(!StrRChrA(NULL, NULL,'\0'), "found a character in a NULL string!
\n
");*/
for
(
count
=
32
;
count
<
128
;
count
++
)
string
[
count
]
=
(
char
)
count
;
...
...
@@ -274,19 +274,19 @@ static void test_StrRChrA(void)
for
(
count
=
32
;
count
<
128
;
count
++
)
{
LPSTR
result
=
StrRChrA
(
string
+
32
,
NULL
,
count
);
ok
(
result
-
string
==
count
,
"found char %d in wrong place"
,
count
);
ok
(
result
-
string
==
count
,
"found char %d in wrong place
\n
"
,
count
);
}
for
(
count
=
32
;
count
<
128
;
count
++
)
{
LPSTR
result
=
StrRChrA
(
string
+
count
+
1
,
NULL
,
count
);
ok
(
!
result
,
"found char not in the string"
);
ok
(
!
result
,
"found char not in the string
\n
"
);
}
for
(
count
=
32
;
count
<
128
;
count
++
)
{
LPSTR
result
=
StrRChrA
(
string
+
count
+
1
,
string
+
127
,
count
);
ok
(
!
result
,
"found char not in the string"
);
ok
(
!
result
,
"found char not in the string
\n
"
);
}
}
...
...
@@ -296,7 +296,7 @@ static void test_StrRChrW(void)
WORD
count
;
/* this test crashes on win2k SP4 */
/*ok(!StrRChrW(NULL, NULL,'\0'), "found a character in a NULL string!");*/
/*ok(!StrRChrW(NULL, NULL,'\0'), "found a character in a NULL string!
\n
");*/
for
(
count
=
32
;
count
<
128
;
count
++
)
string
[
count
]
=
count
;
...
...
@@ -335,7 +335,7 @@ static void test_StrCpyW(void)
MultiByteToWideChar
(
0
,
0
,
result
->
byte_size_64
,
-
1
,
szSrc
,
sizeof
(
szSrc
)
/
sizeof
(
WCHAR
));
StrCpyW
(
szBuff
,
szSrc
);
ok
(
!
StrCmpW
(
szSrc
,
szBuff
),
"Copied string %s wrong"
,
result
->
byte_size_64
);
ok
(
!
StrCmpW
(
szSrc
,
szBuff
),
"Copied string %s wrong
\n
"
,
result
->
byte_size_64
);
result
++
;
}
}
...
...
@@ -349,7 +349,7 @@ static void test_StrToIntA(void)
while
(
result
->
string
)
{
return_val
=
StrToIntA
(
result
->
string
);
ok
(
return_val
==
result
->
str_to_int
,
"converted '%s' wrong (%d)"
,
ok
(
return_val
==
result
->
str_to_int
,
"converted '%s' wrong (%d)
\n
"
,
result
->
string
,
return_val
);
result
++
;
}
...
...
@@ -365,7 +365,7 @@ static void test_StrToIntW(void)
{
MultiByteToWideChar
(
0
,
0
,
result
->
string
,
-
1
,
szBuff
,
sizeof
(
szBuff
)
/
sizeof
(
WCHAR
));
return_val
=
StrToIntW
(
szBuff
);
ok
(
return_val
==
result
->
str_to_int
,
"converted '%s' wrong (%d)"
,
ok
(
return_val
==
result
->
str_to_int
,
"converted '%s' wrong (%d)
\n
"
,
result
->
string
,
return_val
);
result
++
;
}
...
...
@@ -381,10 +381,10 @@ static void test_StrToIntExA(void)
{
return_val
=
-
1
;
bRet
=
StrToIntExA
(
result
->
string
,
0
,
&
return_val
);
ok
(
!
bRet
||
return_val
!=
-
1
,
"No result returned from '%s'"
,
ok
(
!
bRet
||
return_val
!=
-
1
,
"No result returned from '%s'
\n
"
,
result
->
string
);
if
(
bRet
)
ok
(
return_val
==
result
->
str_to_int_ex
,
"converted '%s' wrong (%d)"
,
ok
(
return_val
==
result
->
str_to_int_ex
,
"converted '%s' wrong (%d)
\n
"
,
result
->
string
,
return_val
);
result
++
;
}
...
...
@@ -394,10 +394,10 @@ static void test_StrToIntExA(void)
{
return_val
=
-
1
;
bRet
=
StrToIntExA
(
result
->
string
,
STIF_SUPPORT_HEX
,
&
return_val
);
ok
(
!
bRet
||
return_val
!=
-
1
,
"No result returned from '%s'"
,
ok
(
!
bRet
||
return_val
!=
-
1
,
"No result returned from '%s'
\n
"
,
result
->
string
);
if
(
bRet
)
ok
(
return_val
==
result
->
str_to_int_hex
,
"converted '%s' wrong (%d)"
,
ok
(
return_val
==
result
->
str_to_int_hex
,
"converted '%s' wrong (%d)
\n
"
,
result
->
string
,
return_val
);
result
++
;
}
...
...
@@ -415,10 +415,10 @@ static void test_StrToIntExW(void)
return_val
=
-
1
;
MultiByteToWideChar
(
0
,
0
,
result
->
string
,
-
1
,
szBuff
,
sizeof
(
szBuff
)
/
sizeof
(
WCHAR
));
bRet
=
StrToIntExW
(
szBuff
,
0
,
&
return_val
);
ok
(
!
bRet
||
return_val
!=
-
1
,
"No result returned from '%s'"
,
ok
(
!
bRet
||
return_val
!=
-
1
,
"No result returned from '%s'
\n
"
,
result
->
string
);
if
(
bRet
)
ok
(
return_val
==
result
->
str_to_int_ex
,
"converted '%s' wrong (%d)"
,
ok
(
return_val
==
result
->
str_to_int_ex
,
"converted '%s' wrong (%d)
\n
"
,
result
->
string
,
return_val
);
result
++
;
}
...
...
@@ -429,10 +429,10 @@ static void test_StrToIntExW(void)
return_val
=
-
1
;
MultiByteToWideChar
(
0
,
0
,
result
->
string
,
-
1
,
szBuff
,
sizeof
(
szBuff
)
/
sizeof
(
WCHAR
));
bRet
=
StrToIntExW
(
szBuff
,
STIF_SUPPORT_HEX
,
&
return_val
);
ok
(
!
bRet
||
return_val
!=
-
1
,
"No result returned from '%s'"
,
ok
(
!
bRet
||
return_val
!=
-
1
,
"No result returned from '%s'
\n
"
,
result
->
string
);
if
(
bRet
)
ok
(
return_val
==
result
->
str_to_int_hex
,
"converted '%s' wrong (%d)"
,
ok
(
return_val
==
result
->
str_to_int_hex
,
"converted '%s' wrong (%d)
\n
"
,
result
->
string
,
return_val
);
result
++
;
}
...
...
@@ -447,10 +447,10 @@ static void test_StrDupA()
{
lpszStr
=
StrDupA
(
result
->
byte_size_64
);
ok
(
lpszStr
!=
NULL
,
"Dup failed"
);
ok
(
lpszStr
!=
NULL
,
"Dup failed
\n
"
);
if
(
lpszStr
)
{
ok
(
!
strcmp
(
result
->
byte_size_64
,
lpszStr
),
"Copied string wrong"
);
ok
(
!
strcmp
(
result
->
byte_size_64
,
lpszStr
),
"Copied string wrong
\n
"
);
LocalFree
((
HLOCAL
)
lpszStr
);
}
result
++
;
...
...
@@ -460,7 +460,7 @@ static void test_StrDupA()
* returned an empty string (as Wine does).
*/
lpszStr
=
StrDupA
(
NULL
);
ok
(
lpszStr
==
NULL
||
*
lpszStr
==
'\0'
,
"NULL string returned %p"
,
lpszStr
);
ok
(
lpszStr
==
NULL
||
*
lpszStr
==
'\0'
,
"NULL string returned %p
\n
"
,
lpszStr
);
}
static
void
test_StrFormatByteSize64A
(
void
)
...
...
@@ -531,7 +531,7 @@ void test_StrFromTimeIntervalA(void)
{
StrFromTimeIntervalA
(
szBuff
,
256
,
result
->
ms
,
result
->
digits
);
ok
(
!
strcmp
(
result
->
time_interval
,
szBuff
),
"Formatted %ld %d wrong"
,
ok
(
!
strcmp
(
result
->
time_interval
,
szBuff
),
"Formatted %ld %d wrong
\n
"
,
result
->
ms
,
result
->
digits
);
result
++
;
}
...
...
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