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
75de8fe1
Commit
75de8fe1
authored
Jun 22, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added printf format checking to the ok() and trace() macros, and fixed
the resulting warnings.
parent
ff9b9d4e
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
114 additions
and
106 deletions
+114
-106
file.c
dlls/kernel/tests/file.c
+23
-23
path.c
dlls/kernel/tests/path.c
+22
-22
process.c
dlls/kernel/tests/process.c
+4
-4
thread.c
dlls/kernel/tests/thread.c
+2
-4
shreg.c
dlls/shlwapi/tests/shreg.c
+20
-20
class.c
dlls/user/tests/class.c
+7
-7
sock.c
dlls/winsock/tests/sock.c
+15
-15
test.h
include/wine/test.h
+19
-7
wtmain.c
programs/winetest/wtmain.c
+2
-4
No files found.
dlls/kernel/tests/file.c
View file @
75de8fe1
...
@@ -54,7 +54,7 @@ static void test__hread( void )
...
@@ -54,7 +54,7 @@ static void test__hread( void )
filehandle
=
_lcreat
(
filename
,
0
);
filehandle
=
_lcreat
(
filename
,
0
);
if
(
filehandle
==
HFILE_ERROR
)
if
(
filehandle
==
HFILE_ERROR
)
{
{
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%d)"
,
filename
,
GetLastError
());
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%
l
d)"
,
filename
,
GetLastError
());
return
;
return
;
}
}
...
@@ -64,7 +64,7 @@ static void test__hread( void )
...
@@ -64,7 +64,7 @@ static void test__hread( void )
filehandle
=
_lopen
(
filename
,
OF_READ
);
filehandle
=
_lopen
(
filename
,
OF_READ
);
ok
(
HFILE_ERROR
!=
filehandle
,
"couldn't open file
\"
%s
\"
again (err=%d)"
,
filename
,
GetLastError
(
)
);
ok
(
HFILE_ERROR
!=
filehandle
,
"couldn't open file
\"
%s
\"
again (err=%
l
d)"
,
filename
,
GetLastError
(
)
);
bytes_read
=
_hread
(
filehandle
,
buffer
,
2
*
strlen
(
sillytext
)
);
bytes_read
=
_hread
(
filehandle
,
buffer
,
2
*
strlen
(
sillytext
)
);
...
@@ -82,7 +82,7 @@ static void test__hread( void )
...
@@ -82,7 +82,7 @@ static void test__hread( void )
ok
(
HFILE_ERROR
!=
_lclose
(
filehandle
),
"_lclose complains"
);
ok
(
HFILE_ERROR
!=
_lclose
(
filehandle
),
"_lclose complains"
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%d)"
,
GetLastError
(
)
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%
l
d)"
,
GetLastError
(
)
);
}
}
...
@@ -101,7 +101,7 @@ static void test__hwrite( void )
...
@@ -101,7 +101,7 @@ static void test__hwrite( void )
filehandle
=
_lcreat
(
filename
,
0
);
filehandle
=
_lcreat
(
filename
,
0
);
if
(
filehandle
==
HFILE_ERROR
)
if
(
filehandle
==
HFILE_ERROR
)
{
{
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%d)"
,
filename
,
GetLastError
());
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%
l
d)"
,
filename
,
GetLastError
());
return
;
return
;
}
}
...
@@ -165,7 +165,7 @@ static void test__hwrite( void )
...
@@ -165,7 +165,7 @@ static void test__hwrite( void )
ok
(
HFILE_ERROR
!=
_lclose
(
filehandle
),
"_lclose complains"
);
ok
(
HFILE_ERROR
!=
_lclose
(
filehandle
),
"_lclose complains"
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%d)"
,
GetLastError
(
)
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%
l
d)"
,
GetLastError
(
)
);
}
}
...
@@ -176,7 +176,7 @@ static void test__lclose( void )
...
@@ -176,7 +176,7 @@ static void test__lclose( void )
filehandle
=
_lcreat
(
filename
,
0
);
filehandle
=
_lcreat
(
filename
,
0
);
if
(
filehandle
==
HFILE_ERROR
)
if
(
filehandle
==
HFILE_ERROR
)
{
{
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%d)"
,
filename
,
GetLastError
());
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%
l
d)"
,
filename
,
GetLastError
());
return
;
return
;
}
}
...
@@ -188,7 +188,7 @@ static void test__lclose( void )
...
@@ -188,7 +188,7 @@ static void test__lclose( void )
ok
(
HFILE_ERROR
==
_lclose
(
filehandle
),
"_lclose should whine about this"
);
ok
(
HFILE_ERROR
==
_lclose
(
filehandle
),
"_lclose should whine about this"
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%d)"
,
GetLastError
(
)
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%
l
d)"
,
GetLastError
(
)
);
}
}
...
@@ -201,7 +201,7 @@ static void test__lcreat( void )
...
@@ -201,7 +201,7 @@ static void test__lcreat( void )
filehandle
=
_lcreat
(
filename
,
0
);
filehandle
=
_lcreat
(
filename
,
0
);
if
(
filehandle
==
HFILE_ERROR
)
if
(
filehandle
==
HFILE_ERROR
)
{
{
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%d)"
,
filename
,
GetLastError
());
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%
l
d)"
,
filename
,
GetLastError
());
return
;
return
;
}
}
...
@@ -215,10 +215,10 @@ static void test__lcreat( void )
...
@@ -215,10 +215,10 @@ static void test__lcreat( void )
ok
(
INVALID_HANDLE_VALUE
!=
FindFirstFileA
(
filename
,
&
search_results
),
"should be able to find file"
);
ok
(
INVALID_HANDLE_VALUE
!=
FindFirstFileA
(
filename
,
&
search_results
),
"should be able to find file"
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%d)"
,
GetLastError
());
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%
l
d)"
,
GetLastError
());
filehandle
=
_lcreat
(
filename
,
1
);
/* readonly */
filehandle
=
_lcreat
(
filename
,
1
);
/* readonly */
ok
(
HFILE_ERROR
!=
filehandle
,
"couldn't create file
\"
%s
\"
(err=%d)"
,
filename
,
GetLastError
(
)
);
ok
(
HFILE_ERROR
!=
filehandle
,
"couldn't create file
\"
%s
\"
(err=%
l
d)"
,
filename
,
GetLastError
(
)
);
ok
(
HFILE_ERROR
!=
_hwrite
(
filehandle
,
sillytext
,
strlen
(
sillytext
)
),
"_hwrite shouldn't be able to write never the less"
);
ok
(
HFILE_ERROR
!=
_hwrite
(
filehandle
,
sillytext
,
strlen
(
sillytext
)
),
"_hwrite shouldn't be able to write never the less"
);
...
@@ -233,7 +233,7 @@ static void test__lcreat( void )
...
@@ -233,7 +233,7 @@ static void test__lcreat( void )
ok
(
DeleteFileA
(
filename
)
!=
0
,
"now it should be possible to delete the file!"
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"now it should be possible to delete the file!"
);
filehandle
=
_lcreat
(
filename
,
2
);
filehandle
=
_lcreat
(
filename
,
2
);
ok
(
HFILE_ERROR
!=
filehandle
,
"couldn't create file
\"
%s
\"
(err=%d)"
,
filename
,
GetLastError
(
)
);
ok
(
HFILE_ERROR
!=
filehandle
,
"couldn't create file
\"
%s
\"
(err=%
l
d)"
,
filename
,
GetLastError
(
)
);
ok
(
HFILE_ERROR
!=
_hwrite
(
filehandle
,
sillytext
,
strlen
(
sillytext
)
),
"_hwrite complains"
);
ok
(
HFILE_ERROR
!=
_hwrite
(
filehandle
,
sillytext
,
strlen
(
sillytext
)
),
"_hwrite complains"
);
...
@@ -245,10 +245,10 @@ static void test__lcreat( void )
...
@@ -245,10 +245,10 @@ static void test__lcreat( void )
ok
(
INVALID_HANDLE_VALUE
!=
FindFirstFileA
(
filename
,
&
search_results
),
"should STILL be able to find file"
);
ok
(
INVALID_HANDLE_VALUE
!=
FindFirstFileA
(
filename
,
&
search_results
),
"should STILL be able to find file"
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%d)"
,
GetLastError
(
)
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%
l
d)"
,
GetLastError
(
)
);
filehandle
=
_lcreat
(
filename
,
4
);
/* SYSTEM file */
filehandle
=
_lcreat
(
filename
,
4
);
/* SYSTEM file */
ok
(
HFILE_ERROR
!=
filehandle
,
"couldn't create file
\"
%s
\"
(err=%d)"
,
filename
,
GetLastError
(
)
);
ok
(
HFILE_ERROR
!=
filehandle
,
"couldn't create file
\"
%s
\"
(err=%
l
d)"
,
filename
,
GetLastError
(
)
);
ok
(
HFILE_ERROR
!=
_hwrite
(
filehandle
,
sillytext
,
strlen
(
sillytext
)
),
"_hwrite complains"
);
ok
(
HFILE_ERROR
!=
_hwrite
(
filehandle
,
sillytext
,
strlen
(
sillytext
)
),
"_hwrite complains"
);
...
@@ -260,7 +260,7 @@ static void test__lcreat( void )
...
@@ -260,7 +260,7 @@ static void test__lcreat( void )
ok
(
INVALID_HANDLE_VALUE
!=
FindFirstFileA
(
filename
,
&
search_results
),
"should STILL be able to find file"
);
ok
(
INVALID_HANDLE_VALUE
!=
FindFirstFileA
(
filename
,
&
search_results
),
"should STILL be able to find file"
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%d)"
,
GetLastError
(
)
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%
l
d)"
,
GetLastError
(
)
);
}
}
...
@@ -274,7 +274,7 @@ void test__llseek( void )
...
@@ -274,7 +274,7 @@ void test__llseek( void )
filehandle
=
_lcreat
(
filename
,
0
);
filehandle
=
_lcreat
(
filename
,
0
);
if
(
filehandle
==
HFILE_ERROR
)
if
(
filehandle
==
HFILE_ERROR
)
{
{
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%d)"
,
filename
,
GetLastError
());
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%
l
d)"
,
filename
,
GetLastError
());
return
;
return
;
}
}
...
@@ -296,7 +296,7 @@ void test__llseek( void )
...
@@ -296,7 +296,7 @@ void test__llseek( void )
ok
(
HFILE_ERROR
!=
_llseek
(
filehandle
,
1000000
,
FILE_END
),
"should be able to seek past file; poor, poor Windows programmers"
);
ok
(
HFILE_ERROR
!=
_llseek
(
filehandle
,
1000000
,
FILE_END
),
"should be able to seek past file; poor, poor Windows programmers"
);
ok
(
HFILE_ERROR
!=
_lclose
(
filehandle
),
"_lclose complains"
);
ok
(
HFILE_ERROR
!=
_lclose
(
filehandle
),
"_lclose complains"
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%d)"
,
GetLastError
(
)
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%
l
d)"
,
GetLastError
(
)
);
}
}
...
@@ -309,7 +309,7 @@ static void test__llopen( void )
...
@@ -309,7 +309,7 @@ static void test__llopen( void )
filehandle
=
_lcreat
(
filename
,
0
);
filehandle
=
_lcreat
(
filename
,
0
);
if
(
filehandle
==
HFILE_ERROR
)
if
(
filehandle
==
HFILE_ERROR
)
{
{
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%d)"
,
filename
,
GetLastError
());
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%
l
d)"
,
filename
,
GetLastError
());
return
;
return
;
}
}
...
@@ -333,7 +333,7 @@ static void test__llopen( void )
...
@@ -333,7 +333,7 @@ static void test__llopen( void )
ok
(
HFILE_ERROR
!=
_hwrite
(
filehandle
,
sillytext
,
strlen
(
sillytext
)
),
"_hwrite should write just fine"
);
ok
(
HFILE_ERROR
!=
_hwrite
(
filehandle
,
sillytext
,
strlen
(
sillytext
)
),
"_hwrite should write just fine"
);
ok
(
HFILE_ERROR
!=
_lclose
(
filehandle
),
"_lclose complains"
);
ok
(
HFILE_ERROR
!=
_lclose
(
filehandle
),
"_lclose complains"
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%d)"
,
GetLastError
(
)
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%
l
d)"
,
GetLastError
(
)
);
/* TODO - add tests for the SHARE modes - use two processes to pull this one off */
/* TODO - add tests for the SHARE modes - use two processes to pull this one off */
}
}
...
@@ -349,7 +349,7 @@ static void test__lread( void )
...
@@ -349,7 +349,7 @@ static void test__lread( void )
filehandle
=
_lcreat
(
filename
,
0
);
filehandle
=
_lcreat
(
filename
,
0
);
if
(
filehandle
==
HFILE_ERROR
)
if
(
filehandle
==
HFILE_ERROR
)
{
{
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%d)"
,
filename
,
GetLastError
());
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%
l
d)"
,
filename
,
GetLastError
());
return
;
return
;
}
}
...
@@ -359,7 +359,7 @@ static void test__lread( void )
...
@@ -359,7 +359,7 @@ static void test__lread( void )
filehandle
=
_lopen
(
filename
,
OF_READ
);
filehandle
=
_lopen
(
filename
,
OF_READ
);
ok
(
HFILE_ERROR
!=
filehandle
,
"couldn't open file
\"
%s
\"
again (err=%d)"
,
filename
,
GetLastError
());
ok
(
HFILE_ERROR
!=
filehandle
,
"couldn't open file
\"
%s
\"
again (err=%
l
d)"
,
filename
,
GetLastError
());
bytes_read
=
_lread
(
filehandle
,
buffer
,
2
*
strlen
(
sillytext
)
);
bytes_read
=
_lread
(
filehandle
,
buffer
,
2
*
strlen
(
sillytext
)
);
...
@@ -377,7 +377,7 @@ static void test__lread( void )
...
@@ -377,7 +377,7 @@ static void test__lread( void )
ok
(
HFILE_ERROR
!=
_lclose
(
filehandle
),
"_lclose complains"
);
ok
(
HFILE_ERROR
!=
_lclose
(
filehandle
),
"_lclose complains"
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%d)"
,
GetLastError
(
)
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%
l
d)"
,
GetLastError
(
)
);
}
}
...
@@ -396,7 +396,7 @@ static void test__lwrite( void )
...
@@ -396,7 +396,7 @@ static void test__lwrite( void )
filehandle
=
_lcreat
(
filename
,
0
);
filehandle
=
_lcreat
(
filename
,
0
);
if
(
filehandle
==
HFILE_ERROR
)
if
(
filehandle
==
HFILE_ERROR
)
{
{
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%d)"
,
filename
,
GetLastError
());
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%
l
d)"
,
filename
,
GetLastError
());
return
;
return
;
}
}
...
@@ -460,7 +460,7 @@ static void test__lwrite( void )
...
@@ -460,7 +460,7 @@ static void test__lwrite( void )
ok
(
HFILE_ERROR
!=
_lclose
(
filehandle
),
"_lclose complains"
);
ok
(
HFILE_ERROR
!=
_lclose
(
filehandle
),
"_lclose complains"
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%d)"
,
GetLastError
(
)
);
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%
l
d)"
,
GetLastError
(
)
);
}
}
...
...
dlls/kernel/tests/path.c
View file @
75de8fe1
...
@@ -252,12 +252,12 @@ static void test_FunnyChars(CHAR *curdir,CHAR *filename,
...
@@ -252,12 +252,12 @@ static void test_FunnyChars(CHAR *curdir,CHAR *filename,
if
(
todo
)
{
if
(
todo
)
{
todo_wine
{
todo_wine
{
ok
(
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
ok
(
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
"%s: GetShortPathA returned %d and not %d"
,
"%s: GetShortPathA returned %
l
d and not %d"
,
errstr
,
passfail
.
shorterror
,
ERROR_FILE_NOT_FOUND
);
errstr
,
passfail
.
shorterror
,
ERROR_FILE_NOT_FOUND
);
}
}
}
else
{
}
else
{
ok
(
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
ok
(
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
"%s: GetShortPathA returned %d and not %d"
,
"%s: GetShortPathA returned %
l
d and not %d"
,
errstr
,
passfail
.
shorterror
,
ERROR_FILE_NOT_FOUND
);
errstr
,
passfail
.
shorterror
,
ERROR_FILE_NOT_FOUND
);
}
}
}
else
{
}
else
{
...
@@ -266,13 +266,13 @@ static void test_FunnyChars(CHAR *curdir,CHAR *filename,
...
@@ -266,13 +266,13 @@ static void test_FunnyChars(CHAR *curdir,CHAR *filename,
/* Win2k returns ERROR_INVALID_NAME, Win98, wine return ERROR_FILE_NOT_FOUND */
/* Win2k returns ERROR_INVALID_NAME, Win98, wine return ERROR_FILE_NOT_FOUND */
ok
(
passfail
.
shorterror
==
ERROR_INVALID_NAME
||
ok
(
passfail
.
shorterror
==
ERROR_INVALID_NAME
||
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
"%s: GetShortPathA returned %d and not %d or %d"
,
"%s: GetShortPathA returned %
l
d and not %d or %d"
,
errstr
,
passfail
.
shorterror
,
ERROR_INVALID_NAME
,
ERROR_FILE_NOT_FOUND
);
errstr
,
passfail
.
shorterror
,
ERROR_INVALID_NAME
,
ERROR_FILE_NOT_FOUND
);
}
}
}
else
{
}
else
{
ok
(
passfail
.
shorterror
==
ERROR_INVALID_NAME
||
ok
(
passfail
.
shorterror
==
ERROR_INVALID_NAME
||
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
"%s: GetShortPathA returned %d and not %d or %d"
,
"%s: GetShortPathA returned %
l
d and not %d or %d"
,
errstr
,
passfail
.
shorterror
,
ERROR_INVALID_NAME
,
ERROR_FILE_NOT_FOUND
);
errstr
,
passfail
.
shorterror
,
ERROR_INVALID_NAME
,
ERROR_FILE_NOT_FOUND
);
}
}
}
}
...
@@ -280,12 +280,12 @@ static void test_FunnyChars(CHAR *curdir,CHAR *filename,
...
@@ -280,12 +280,12 @@ static void test_FunnyChars(CHAR *curdir,CHAR *filename,
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
if
(
valid
)
{
if
(
valid
)
{
ok
(
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
ok
(
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
"%s: GetLongPathA returned %d and not %d"
,
"%s: GetLongPathA returned %
l
d and not %d"
,
errstr
,
passfail
.
longerror
,
ERROR_FILE_NOT_FOUND
);
errstr
,
passfail
.
longerror
,
ERROR_FILE_NOT_FOUND
);
}
else
{
}
else
{
ok
(
passfail
.
longerror
==
ERROR_INVALID_NAME
||
ok
(
passfail
.
longerror
==
ERROR_INVALID_NAME
||
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
"%s: GetLongPathA returned %d and not %d or %d'"
,
"%s: GetLongPathA returned %
l
d and not %d or %d'"
,
errstr
,
passfail
.
longerror
,
ERROR_INVALID_NAME
,
ERROR_FILE_NOT_FOUND
);
errstr
,
passfail
.
longerror
,
ERROR_INVALID_NAME
,
ERROR_FILE_NOT_FOUND
);
}
}
}
}
...
@@ -312,7 +312,7 @@ static void test_setdir(CHAR *olddir,CHAR *newdir,
...
@@ -312,7 +312,7 @@ static void test_setdir(CHAR *olddir,CHAR *newdir,
"%s: SetCurrentDirectory did not change the directory, though it passed"
,
"%s: SetCurrentDirectory did not change the directory, though it passed"
,
errstr
);
errstr
);
ok
(
SetCurrentDirectoryA
(
olddir
),
ok
(
SetCurrentDirectoryA
(
olddir
),
"%s: Couldn't set directory to it's original value"
);
"%s: Couldn't set directory to it's original value"
,
errstr
);
}
else
{
}
else
{
/* else thest that it fails correctly */
/* else thest that it fails correctly */
chklen
=
lstrlenA
(
olddir
);
chklen
=
lstrlenA
(
olddir
);
...
@@ -343,7 +343,7 @@ static void test_InitPathA(CHAR *newdir)
...
@@ -343,7 +343,7 @@ static void test_InitPathA(CHAR *newdir)
lstrcpyA
(
tmpstr
,
"aaaaaaaa"
);
lstrcpyA
(
tmpstr
,
"aaaaaaaa"
);
len1
=
GetTempPathA
(
len
,
tmpstr
);
len1
=
GetTempPathA
(
len
,
tmpstr
);
ok
(
len1
==
len
+
1
,
ok
(
len1
==
len
+
1
,
"GetTempPathA should return string length %
d instead of %
d"
,
len
+
1
,
len1
);
"GetTempPathA should return string length %
ld instead of %l
d"
,
len
+
1
,
len1
);
if
(
WIN2K_PLUS
(
version
))
{
if
(
WIN2K_PLUS
(
version
))
{
/* in Win2k, the path won't be modified, but in win98, wine it is */
/* in Win2k, the path won't be modified, but in win98, wine it is */
todo_wine
{
todo_wine
{
...
@@ -419,7 +419,7 @@ static void test_CurrentDirectoryA(CHAR *origdir, CHAR *newdir)
...
@@ -419,7 +419,7 @@ static void test_CurrentDirectoryA(CHAR *origdir, CHAR *newdir)
*/
*/
lstrcpyA
(
tmpstr
,
"aaaaaaa"
);
lstrcpyA
(
tmpstr
,
"aaaaaaa"
);
len1
=
GetCurrentDirectoryA
(
len
,
tmpstr
);
len1
=
GetCurrentDirectoryA
(
len
,
tmpstr
);
ok
(
len1
==
len
+
1
,
"GetCurrentDirectoryA returned %
d instead of %
d"
,
len1
,
len
+
1
);
ok
(
len1
==
len
+
1
,
"GetCurrentDirectoryA returned %
ld instead of %l
d"
,
len1
,
len
+
1
);
ok
(
lstrcmpiA
(
tmpstr
,
"aaaaaaa"
)
==
0
,
ok
(
lstrcmpiA
(
tmpstr
,
"aaaaaaa"
)
==
0
,
"GetCurrentDirectoryA should not have modified the buffer"
);
"GetCurrentDirectoryA should not have modified the buffer"
);
/* SetCurrentDirectoryA shouldn't care whether the string has a
/* SetCurrentDirectoryA shouldn't care whether the string has a
...
@@ -571,14 +571,14 @@ static void test_PathNameA(CHAR *curdir)
...
@@ -571,14 +571,14 @@ static void test_PathNameA(CHAR *curdir)
ok
(
passfail
.
shortlen
==
0
,
"GetShortPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
shortlen
==
0
,
"GetShortPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
shorterror
==
ERROR_PATH_NOT_FOUND
||
ok
(
passfail
.
shorterror
==
ERROR_PATH_NOT_FOUND
||
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
"GetShortPathA returned %d and not 'ERROR_PATH_NOT_FOUND'"
,
"GetShortPathA returned %
l
d and not 'ERROR_PATH_NOT_FOUND'"
,
passfail
.
shorterror
);
passfail
.
shorterror
);
}
}
if
(
pGetLongPathNameA
)
{
if
(
pGetLongPathNameA
)
{
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longerror
==
ERROR_PATH_NOT_FOUND
||
ok
(
passfail
.
longerror
==
ERROR_PATH_NOT_FOUND
||
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
"GetLongPathA returned %d and not 'ERROR_PATH_NOT_FOUND'"
,
"GetLongPathA returned %
l
d and not 'ERROR_PATH_NOT_FOUND'"
,
passfail
.
longerror
);
passfail
.
longerror
);
}
}
/* Now try a 8.3 directory, long file name */
/* Now try a 8.3 directory, long file name */
...
@@ -586,13 +586,13 @@ static void test_PathNameA(CHAR *curdir)
...
@@ -586,13 +586,13 @@ static void test_PathNameA(CHAR *curdir)
ok
(
passfail
.
shortlen
==
0
,
"GetShortPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
shortlen
==
0
,
"GetShortPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
shorterror
==
ERROR_PATH_NOT_FOUND
||
ok
(
passfail
.
shorterror
==
ERROR_PATH_NOT_FOUND
||
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
"GetShortPathA returned %d and not 'ERROR_PATH_NOT_FOUND'"
,
"GetShortPathA returned %
l
d and not 'ERROR_PATH_NOT_FOUND'"
,
passfail
.
shorterror
);
passfail
.
shorterror
);
if
(
pGetLongPathNameA
)
{
if
(
pGetLongPathNameA
)
{
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longerror
==
ERROR_PATH_NOT_FOUND
||
ok
(
passfail
.
longerror
==
ERROR_PATH_NOT_FOUND
||
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
"GetLongPathA returned %d and not 'ERROR_PATH_NOT_FOUND'"
,
"GetLongPathA returned %
l
d and not 'ERROR_PATH_NOT_FOUND'"
,
passfail
.
longerror
);
passfail
.
longerror
);
}
}
/* Next is a long directory, 8.3 file */
/* Next is a long directory, 8.3 file */
...
@@ -600,13 +600,13 @@ static void test_PathNameA(CHAR *curdir)
...
@@ -600,13 +600,13 @@ static void test_PathNameA(CHAR *curdir)
ok
(
passfail
.
shortlen
==
0
,
"GetShortPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
shortlen
==
0
,
"GetShortPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
shorterror
==
ERROR_PATH_NOT_FOUND
||
ok
(
passfail
.
shorterror
==
ERROR_PATH_NOT_FOUND
||
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
"GetShortPathA returned %d and not 'ERROR_PATH_NOT_FOUND'"
,
"GetShortPathA returned %
l
d and not 'ERROR_PATH_NOT_FOUND'"
,
passfail
.
shorterror
);
passfail
.
shorterror
);
if
(
pGetLongPathNameA
)
{
if
(
pGetLongPathNameA
)
{
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longerror
==
ERROR_PATH_NOT_FOUND
||
ok
(
passfail
.
longerror
==
ERROR_PATH_NOT_FOUND
||
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
"GetLongPathA returned %d and not 'ERROR_PATH_NOT_FOUND'"
,
"GetLongPathA returned %
l
d and not 'ERROR_PATH_NOT_FOUND'"
,
passfail
.
longerror
);
passfail
.
longerror
);
}
}
/*Lastly a long directory, long file */
/*Lastly a long directory, long file */
...
@@ -614,13 +614,13 @@ static void test_PathNameA(CHAR *curdir)
...
@@ -614,13 +614,13 @@ static void test_PathNameA(CHAR *curdir)
ok
(
passfail
.
shortlen
==
0
,
"GetShortPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
shortlen
==
0
,
"GetShortPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
shorterror
==
ERROR_PATH_NOT_FOUND
||
ok
(
passfail
.
shorterror
==
ERROR_PATH_NOT_FOUND
||
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
"GetShortPathA returned %d and not 'ERROR_PATH_NOT_FOUND'"
,
"GetShortPathA returned %
l
d and not 'ERROR_PATH_NOT_FOUND'"
,
passfail
.
shorterror
);
passfail
.
shorterror
);
if
(
pGetLongPathNameA
)
{
if
(
pGetLongPathNameA
)
{
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longerror
==
ERROR_PATH_NOT_FOUND
||
ok
(
passfail
.
longerror
==
ERROR_PATH_NOT_FOUND
||
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
"GetLongPathA returned %d and not 'ERROR_PATH_NOT_FOUND'"
,
"GetLongPathA returned %
l
d and not 'ERROR_PATH_NOT_FOUND'"
,
passfail
.
longerror
);
passfail
.
longerror
);
}
}
/* Next try directories ending with '\\' */
/* Next try directories ending with '\\' */
...
@@ -635,25 +635,25 @@ static void test_PathNameA(CHAR *curdir)
...
@@ -635,25 +635,25 @@ static void test_PathNameA(CHAR *curdir)
todo_wine
{
todo_wine
{
ok
(
passfail
.
shortlen
==
0
,
"GetShortPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
shortlen
==
0
,
"GetShortPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
ok
(
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
"GetShortPathA returned %d and not 'ERROR_FILE_NOT_FOUND'"
,
"GetShortPathA returned %
l
d and not 'ERROR_FILE_NOT_FOUND'"
,
passfail
.
shorterror
);
passfail
.
shorterror
);
}
}
if
(
pGetLongPathNameA
)
{
if
(
pGetLongPathNameA
)
{
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
ok
(
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
"GetLongPathA returned %d and not 'ERROR_FILE_NOT_FOUND'"
,
"GetLongPathA returned %
l
d and not 'ERROR_FILE_NOT_FOUND'"
,
passfail
.
longerror
);
passfail
.
longerror
);
}
}
sprintf
(
tmpstr
,
"%s
\\
"
,
NONDIR_LONG
);
sprintf
(
tmpstr
,
"%s
\\
"
,
NONDIR_LONG
);
test_ValidPathA
(
curdir
,
""
,
tmpstr
,
tmpstr1
,
&
passfail
,
"test16"
);
test_ValidPathA
(
curdir
,
""
,
tmpstr
,
tmpstr1
,
&
passfail
,
"test16"
);
ok
(
passfail
.
shortlen
==
0
,
"GetShortPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
shortlen
==
0
,
"GetShortPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
ok
(
passfail
.
shorterror
==
ERROR_FILE_NOT_FOUND
,
"GetShortPathA returned %d and not 'ERROR_FILE_NOT_FOUND'"
,
"GetShortPathA returned %
l
d and not 'ERROR_FILE_NOT_FOUND'"
,
passfail
.
shorterror
);
passfail
.
shorterror
);
if
(
pGetLongPathNameA
)
{
if
(
pGetLongPathNameA
)
{
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longlen
==
0
,
"GetLongPathNameA passed when it shouldn't have"
);
ok
(
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
ok
(
passfail
.
longerror
==
ERROR_FILE_NOT_FOUND
,
"GetLongPathA returned %d and not 'ERROR_FILE_NOT_FOUND'"
,
"GetLongPathA returned %
l
d and not 'ERROR_FILE_NOT_FOUND'"
,
passfail
.
longerror
);
passfail
.
longerror
);
}
}
/* Now try some relative paths */
/* Now try some relative paths */
...
@@ -718,7 +718,7 @@ START_TEST(path)
...
@@ -718,7 +718,7 @@ START_TEST(path)
{
{
CHAR
origdir
[
MAX_PATH
],
curdir
[
MAX_PATH
];
CHAR
origdir
[
MAX_PATH
],
curdir
[
MAX_PATH
];
version
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOA
);
version
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOA
);
ok
(
GetVersionExA
(
&
version
),
"GetVersionEx failed: %d"
,
GetLastError
());
ok
(
GetVersionExA
(
&
version
),
"GetVersionEx failed: %
l
d"
,
GetLastError
());
pGetLongPathNameA
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
),
pGetLongPathNameA
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
),
"GetLongPathNameA"
);
"GetLongPathNameA"
);
test_InitPathA
(
curdir
);
test_InitPathA
(
curdir
);
...
...
dlls/kernel/tests/process.c
View file @
75de8fe1
...
@@ -331,8 +331,8 @@ static int strCmp(const char* s1, const char* s2, BOOL sensitive)
...
@@ -331,8 +331,8 @@ static int strCmp(const char* s1, const char* s2, BOOL sensitive)
#define okChildString(sect, key, expect) \
#define okChildString(sect, key, expect) \
do { \
do { \
char* result = getChildString(
sect, key
); \
char* result = getChildString(
(sect), (key)
); \
ok(strCmp(result, expect, 1) == 0, "%s:%s expected %s, got %s",
sect, key, expect
, result); \
ok(strCmp(result, expect, 1) == 0, "%s:%s expected %s, got %s",
(sect), (key), (expect)?(expect):"(null)"
, result); \
} while (0)
} while (0)
#define okChildIString(sect, key, expect) \
#define okChildIString(sect, key, expect) \
...
@@ -346,8 +346,8 @@ static int strCmp(const char* s1, const char* s2, BOOL sensitive)
...
@@ -346,8 +346,8 @@ static int strCmp(const char* s1, const char* s2, BOOL sensitive)
*/
*/
#define okChildInt(sect, key, expect) \
#define okChildInt(sect, key, expect) \
do { \
do { \
int result = GetPrivateProfileIntA(
sect, key, !expect
, resfile); \
int result = GetPrivateProfileIntA(
(sect), (key), !(expect)
, resfile); \
ok(result == expect, "%s:%s expected %d, but got %d\n",
sect, key, expect
, result); \
ok(result == expect, "%s:%s expected %d, but got %d\n",
(sect), (key), (int)(expect)
, result); \
} while (0)
} while (0)
static
void
test_Startup
(
void
)
static
void
test_Startup
(
void
)
...
...
dlls/kernel/tests/thread.c
View file @
75de8fe1
...
@@ -182,14 +182,12 @@ VOID test_CreateThread_basic(DWORD version)
...
@@ -182,14 +182,12 @@ VOID test_CreateThread_basic(DWORD version)
for
(
i
=
0
;
i
<
NUM_THREADS
;
i
++
)
{
for
(
i
=
0
;
i
<
NUM_THREADS
;
i
++
)
{
error
=
WaitForSingleObject
(
thread
[
i
],
5000
);
error
=
WaitForSingleObject
(
thread
[
i
],
5000
);
ok
(
error
==
WAIT_OBJECT_0
,
"Thread did not complete within timelimit"
);
ok
(
error
==
WAIT_OBJECT_0
,
"Thread did not complete within timelimit"
);
if
(
ok
!=
WAIT_OBJECT_0
)
{
if
(
error
!=
WAIT_OBJECT_0
)
{
TerminateThread
(
thread
[
i
],
1
);
TerminateThread
(
thread
[
i
],
i
+
NUM_THREADS
);
}
}
ok
(
GetExitCodeThread
(
thread
[
i
],
&
exitCode
),
"Could not retrieve ext code"
);
ok
(
GetExitCodeThread
(
thread
[
i
],
&
exitCode
),
"Could not retrieve ext code"
);
todo_wine
{
ok
(
exitCode
==
i
+
NUM_THREADS
,
"Thread returned an incorrect exit code"
);
ok
(
exitCode
==
i
+
NUM_THREADS
,
"Thread returned an incorrect exit code"
);
}
}
}
/* Test that each thread executed in its parent's address space
/* Test that each thread executed in its parent's address space
(it was able to change threadmem and pass that change back to its parent)
(it was able to change threadmem and pass that change back to its parent)
and that each thread id was independant). Note that we prove that the
and that each thread id was independant). Note that we prove that the
...
...
dlls/shlwapi/tests/shreg.c
View file @
75de8fe1
...
@@ -40,19 +40,19 @@ static void create_test_entrys()
...
@@ -40,19 +40,19 @@ static void create_test_entrys()
{
{
HKEY
hKey
;
HKEY
hKey
;
ok
(
!
RegCreateKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
&
hKey
),
""
);
ok
(
!
RegCreateKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
&
hKey
),
"
RegCreateKeyA failed
"
);
if
(
hKey
)
if
(
hKey
)
{
{
ok
(
!
RegSetValueExA
(
hKey
,
"Test1"
,
0
,
REG_EXPAND_SZ
,
sTestpath1
,
strlen
(
sTestpath1
)),
""
);
ok
(
!
RegSetValueExA
(
hKey
,
"Test1"
,
0
,
REG_EXPAND_SZ
,
sTestpath1
,
strlen
(
sTestpath1
)),
"
RegSetValueExA failed
"
);
ok
(
!
RegSetValueExA
(
hKey
,
"Test2"
,
0
,
REG_SZ
,
sTestpath1
,
strlen
(
sTestpath1
)),
""
);
ok
(
!
RegSetValueExA
(
hKey
,
"Test2"
,
0
,
REG_SZ
,
sTestpath1
,
strlen
(
sTestpath1
)),
"
RegSetValueExA failed
"
);
ok
(
!
RegSetValueExA
(
hKey
,
"Test3"
,
0
,
REG_EXPAND_SZ
,
sTestpath2
,
strlen
(
sTestpath2
)),
""
);
ok
(
!
RegSetValueExA
(
hKey
,
"Test3"
,
0
,
REG_EXPAND_SZ
,
sTestpath2
,
strlen
(
sTestpath2
)),
"
RegSetValueExA failed
"
);
RegCloseKey
(
hKey
);
RegCloseKey
(
hKey
);
}
}
ExpandEnvironmentStringsA
(
sTestpath1
,
sExpTestpath1
,
sizeof
(
sExpTestpath1
));
ExpandEnvironmentStringsA
(
sTestpath1
,
sExpTestpath1
,
sizeof
(
sExpTestpath1
));
ExpandEnvironmentStringsA
(
sTestpath2
,
sExpTestpath2
,
sizeof
(
sExpTestpath2
));
ExpandEnvironmentStringsA
(
sTestpath2
,
sExpTestpath2
,
sizeof
(
sExpTestpath2
));
ok
(
strlen
(
sExpTestpath2
)
>
25
,
"%
USERPROFILE
% is set to a short value on this machine. we cant perform all tests."
);
ok
(
strlen
(
sExpTestpath2
)
>
25
,
"%
%USERPROFILE%
% is set to a short value on this machine. we cant perform all tests."
);
}
}
static
void
test_SHGetValue
(
void
)
static
void
test_SHGetValue
(
void
)
...
@@ -64,14 +64,14 @@ static void test_SHGetValue(void)
...
@@ -64,14 +64,14 @@ static void test_SHGetValue(void)
strcpy
(
buf
,
sEmptyBuffer
);
strcpy
(
buf
,
sEmptyBuffer
);
dwSize
=
MAX_PATH
;
dwSize
=
MAX_PATH
;
dwType
=
-
1
;
dwType
=
-
1
;
ok
(
!
SHGetValueA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
"Test1"
,
&
dwType
,
buf
,
&
dwSize
),
""
);
ok
(
!
SHGetValueA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
"Test1"
,
&
dwType
,
buf
,
&
dwSize
),
"
SHGetValueA failed
"
);
ok
(
0
==
strcmp
(
sExpTestpath1
,
buf
),
"(%s,%s)"
,
buf
,
sExpTestpath1
);
ok
(
0
==
strcmp
(
sExpTestpath1
,
buf
),
"(%s,%s)"
,
buf
,
sExpTestpath1
);
ok
(
REG_SZ
==
dwType
,
"(%lx)"
,
dwType
);
ok
(
REG_SZ
==
dwType
,
"(%lx)"
,
dwType
);
strcpy
(
buf
,
sEmptyBuffer
);
strcpy
(
buf
,
sEmptyBuffer
);
dwSize
=
MAX_PATH
;
dwSize
=
MAX_PATH
;
dwType
=
-
1
;
dwType
=
-
1
;
ok
(
!
SHGetValueA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
"Test2"
,
&
dwType
,
buf
,
&
dwSize
),
""
);
ok
(
!
SHGetValueA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
"Test2"
,
&
dwType
,
buf
,
&
dwSize
),
"
SHGetValueA failed
"
);
ok
(
0
==
strcmp
(
sTestpath1
,
buf
)
,
"(%s)"
,
buf
);
ok
(
0
==
strcmp
(
sTestpath1
,
buf
)
,
"(%s)"
,
buf
);
ok
(
REG_SZ
==
dwType
,
"(%lx)"
,
dwType
);
ok
(
REG_SZ
==
dwType
,
"(%lx)"
,
dwType
);
}
}
...
@@ -81,7 +81,7 @@ static void test_SHGetTegPath(void)
...
@@ -81,7 +81,7 @@ static void test_SHGetTegPath(void)
char
buf
[
MAX_PATH
];
char
buf
[
MAX_PATH
];
strcpy
(
buf
,
sEmptyBuffer
);
strcpy
(
buf
,
sEmptyBuffer
);
ok
(
!
SHRegGetPathA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
"Test1"
,
buf
,
0
),
""
);
ok
(
!
SHRegGetPathA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
"Test1"
,
buf
,
0
),
"
SHRegGetPathA failed
"
);
ok
(
0
==
strcmp
(
sExpTestpath1
,
buf
)
,
"(%s)"
,
buf
);
ok
(
0
==
strcmp
(
sExpTestpath1
,
buf
)
,
"(%s)"
,
buf
);
}
}
...
@@ -106,13 +106,13 @@ static void test_SHQUeryValueEx(void)
...
@@ -106,13 +106,13 @@ static void test_SHQUeryValueEx(void)
/*
/*
* Case 1.1 All arguments are NULL
* Case 1.1 All arguments are NULL
*/
*/
ok
(
!
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
NULL
,
NULL
,
NULL
),
""
);
ok
(
!
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
NULL
,
NULL
,
NULL
),
"
SHQueryValueExA failed
"
);
/*
/*
* Case 1.2 dwType is set
* Case 1.2 dwType is set
*/
*/
dwType
=
-
1
;
dwType
=
-
1
;
ok
(
!
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
&
dwType
,
NULL
,
NULL
),
""
);
ok
(
!
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
&
dwType
,
NULL
,
NULL
),
"
SHQueryValueExA failed
"
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
/*
/*
...
@@ -120,15 +120,15 @@ static void test_SHQUeryValueEx(void)
...
@@ -120,15 +120,15 @@ static void test_SHQUeryValueEx(void)
* dwExpanded < dwUnExpanded
* dwExpanded < dwUnExpanded
*/
*/
dwSize
=
6
;
dwSize
=
6
;
ok
(
!
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
NULL
,
NULL
,
&
dwSize
),
""
);
ok
(
!
SHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
NULL
,
NULL
,
&
dwSize
),
"
SHQueryValueExA failed
"
);
ok
(
dwSize
==
nUsedBuffer1
,
"(%lu,%
l
u)"
,
dwSize
,
nUsedBuffer1
);
ok
(
dwSize
==
nUsedBuffer1
,
"(%lu,%u)"
,
dwSize
,
nUsedBuffer1
);
/*
/*
* dwExpanded > dwUnExpanded
* dwExpanded > dwUnExpanded
*/
*/
dwSize
=
6
;
dwSize
=
6
;
ok
(
!
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
NULL
,
NULL
,
&
dwSize
),
""
);
ok
(
!
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
NULL
,
NULL
,
&
dwSize
),
"
SHQueryValueExA failed
"
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%
l
u)"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%u)"
,
dwSize
,
nUsedBuffer2
);
/*
/*
...
@@ -141,7 +141,7 @@ static void test_SHQUeryValueEx(void)
...
@@ -141,7 +141,7 @@ static void test_SHQUeryValueEx(void)
ok
(
dwRet
==
ERROR_MORE_DATA
,
"(%lu)"
,
dwRet
);
ok
(
dwRet
==
ERROR_MORE_DATA
,
"(%lu)"
,
dwRet
);
ok
(
0
==
strcmp
(
sEmptyBuffer
,
buf
),
"(%s)"
,
buf
);
ok
(
0
==
strcmp
(
sEmptyBuffer
,
buf
),
"(%s)"
,
buf
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
ok
(
dwSize
==
nUsedBuffer1
,
"(%lu,%
l
u)"
,
dwSize
,
nUsedBuffer1
);
ok
(
dwSize
==
nUsedBuffer1
,
"(%lu,%u)"
,
dwSize
,
nUsedBuffer1
);
/*
/*
* string grows during expanding
* string grows during expanding
...
@@ -150,9 +150,9 @@ static void test_SHQUeryValueEx(void)
...
@@ -150,9 +150,9 @@ static void test_SHQUeryValueEx(void)
dwSize
=
6
;
dwSize
=
6
;
dwType
=
-
1
;
dwType
=
-
1
;
dwRet
=
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
dwType
,
buf
,
&
dwSize
);
dwRet
=
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
dwType
,
buf
,
&
dwSize
);
ok
(
ERROR_MORE_DATA
==
dwRet
,
""
);
ok
(
ERROR_MORE_DATA
==
dwRet
,
"
ERROR_MORE_DATA
"
);
ok
(
0
==
strcmp
(
sEmptyBuffer
,
buf
),
"(%s)"
,
buf
);
ok
(
0
==
strcmp
(
sEmptyBuffer
,
buf
),
"(%s)"
,
buf
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%
l
u)"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%u)"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
/*
/*
...
@@ -161,10 +161,10 @@ static void test_SHQUeryValueEx(void)
...
@@ -161,10 +161,10 @@ static void test_SHQUeryValueEx(void)
strcpy
(
buf
,
sEmptyBuffer
);
strcpy
(
buf
,
sEmptyBuffer
);
dwSize
=
24
;
dwSize
=
24
;
dwType
=
-
1
;
dwType
=
-
1
;
ok
(
ERROR_MORE_DATA
==
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
dwType
,
buf
,
&
dwSize
),
""
);
ok
(
ERROR_MORE_DATA
==
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
dwType
,
buf
,
&
dwSize
),
"
Expected ERROR_MORE_DATA
"
);
ok
(
0
==
strncmp
(
sExpTestpath2
,
buf
,
24
-
1
),
"(%s)"
,
buf
);
ok
(
0
==
strncmp
(
sExpTestpath2
,
buf
,
24
-
1
),
"(%s)"
,
buf
);
ok
(
24
-
1
==
strlen
(
buf
),
"(%s)"
,
buf
);
ok
(
24
-
1
==
strlen
(
buf
),
"(%s)"
,
buf
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%
l
u)"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%u)"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
/*
/*
...
@@ -175,7 +175,7 @@ static void test_SHQUeryValueEx(void)
...
@@ -175,7 +175,7 @@ static void test_SHQUeryValueEx(void)
dwType
=
-
1
;
dwType
=
-
1
;
dwRet
=
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
dwType
,
NULL
,
&
dwSize
);
dwRet
=
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
dwType
,
NULL
,
&
dwSize
);
ok
(
ERROR_SUCCESS
==
dwRet
,
"(%lu)"
,
dwRet
);
ok
(
ERROR_SUCCESS
==
dwRet
,
"(%lu)"
,
dwRet
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%
l
u)"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%u)"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
...
...
dlls/user/tests/class.c
View file @
75de8fe1
...
@@ -108,9 +108,9 @@ BOOL ClassTest(HINSTANCE hInstance, BOOL global)
...
@@ -108,9 +108,9 @@ BOOL ClassTest(HINSTANCE hInstance, BOOL global)
{
{
SetLastError
(
0
);
SetLastError
(
0
);
ok
(
!
SetClassLongW
(
hTestWnd
,
i
*
sizeof
(
DWORD
),
i
+
1
),
ok
(
!
SetClassLongW
(
hTestWnd
,
i
*
sizeof
(
DWORD
),
i
+
1
),
"GetClassLongW(%
d) initial value nonzero!"
);
"GetClassLongW(%
ld) initial value nonzero!"
,
i
*
sizeof
(
DWORD
)
);
ok
(
!
GetLastError
(),
ok
(
!
GetLastError
(),
"SetClassLongW(%
d) failed!"
);
"SetClassLongW(%
ld) failed!"
,
i
*
sizeof
(
DWORD
)
);
}
}
/* test values of valid classwords that we set */
/* test values of valid classwords that we set */
...
@@ -153,15 +153,15 @@ BOOL ClassTest(HINSTANCE hInstance, BOOL global)
...
@@ -153,15 +153,15 @@ BOOL ClassTest(HINSTANCE hInstance, BOOL global)
if
(
GetClassInfoW
(
0
,
str
,
&
wc
))
if
(
GetClassInfoW
(
0
,
str
,
&
wc
))
{
{
ok
(
wc
.
cbClsExtra
==
cls
.
cbClsExtra
,
ok
(
wc
.
cbClsExtra
==
cls
.
cbClsExtra
,
"cbClsExtra did not match %x!=%x"
);
"cbClsExtra did not match %x!=%x"
,
wc
.
cbClsExtra
,
cls
.
cbClsExtra
);
ok
(
wc
.
cbWndExtra
==
cls
.
cbWndExtra
,
ok
(
wc
.
cbWndExtra
==
cls
.
cbWndExtra
,
"cbWndExtra did not match %x!=%x"
);
"cbWndExtra did not match %x!=%x"
,
wc
.
cbWndExtra
,
cls
.
cbWndExtra
);
ok
(
wc
.
hbrBackground
==
cls
.
hbrBackground
,
ok
(
wc
.
hbrBackground
==
cls
.
hbrBackground
,
"hbrBackground did not match %x!=%x"
);
"hbrBackground did not match %x!=%x"
,
wc
.
hbrBackground
,
cls
.
hbrBackground
);
ok
(
wc
.
hCursor
==
cls
.
hCursor
,
ok
(
wc
.
hCursor
==
cls
.
hCursor
,
"hCursor did not match %x!=%x"
);
"hCursor did not match %x!=%x"
,
wc
.
hCursor
,
cls
.
hCursor
);
ok
(
!
wc
.
hInstance
,
ok
(
!
wc
.
hInstance
,
"hInstance not zero for global class %x"
);
"hInstance not zero for global class %x"
,
wc
.
hInstance
);
}
}
else
else
ok
(
FALSE
,
"GetClassInfo (0) failed for global class!"
);
ok
(
FALSE
,
"GetClassInfo (0) failed for global class!"
);
...
...
dlls/winsock/tests/sock.c
View file @
75de8fe1
...
@@ -184,7 +184,7 @@ static int do_synchronous_send ( SOCKET s, char *buf, int buflen, int sendlen )
...
@@ -184,7 +184,7 @@ static int do_synchronous_send ( SOCKET s, char *buf, int buflen, int sendlen )
int
n
=
1
;
int
n
=
1
;
for
(
p
=
buf
;
n
>
0
&&
p
<
last
;
p
+=
n
)
for
(
p
=
buf
;
n
>
0
&&
p
<
last
;
p
+=
n
)
n
=
send
(
s
,
p
,
min
(
sendlen
,
last
-
p
),
0
);
n
=
send
(
s
,
p
,
min
(
sendlen
,
last
-
p
),
0
);
wsa_ok
(
n
,
0
<=
,
"do_synchronous_send (%x): error %d"
);
wsa_ok
(
n
,
0
<=
,
"do_synchronous_send (%
l
x): error %d"
);
return
p
-
buf
;
return
p
-
buf
;
}
}
...
@@ -194,7 +194,7 @@ static int do_synchronous_recv ( SOCKET s, char *buf, int buflen, int recvlen )
...
@@ -194,7 +194,7 @@ static int do_synchronous_recv ( SOCKET s, char *buf, int buflen, int recvlen )
int
n
=
1
;
int
n
=
1
;
for
(
p
=
buf
;
n
>
0
&&
p
<
last
;
p
+=
n
)
for
(
p
=
buf
;
n
>
0
&&
p
<
last
;
p
+=
n
)
n
=
recv
(
s
,
p
,
min
(
recvlen
,
last
-
p
),
0
);
n
=
recv
(
s
,
p
,
min
(
recvlen
,
last
-
p
),
0
);
wsa_ok
(
n
,
0
<=
,
"do_synchronous_recv (%x): error %d:"
);
wsa_ok
(
n
,
0
<=
,
"do_synchronous_recv (%
l
x): error %d:"
);
return
p
-
buf
;
return
p
-
buf
;
}
}
...
@@ -305,7 +305,7 @@ static void client_start ( client_params *par )
...
@@ -305,7 +305,7 @@ static void client_start ( client_params *par )
static
void
client_stop
(
void
)
static
void
client_stop
(
void
)
{
{
client_memory
*
mem
=
TlsGetValue
(
tls
);
client_memory
*
mem
=
TlsGetValue
(
tls
);
wsa_ok
(
closesocket
(
mem
->
s
),
0
==
,
"closesocket error (%x): %d
\n
"
);
wsa_ok
(
closesocket
(
mem
->
s
),
0
==
,
"closesocket error (%
l
x): %d
\n
"
);
LocalFree
(
(
HANDLE
)
mem
->
send_buf
);
LocalFree
(
(
HANDLE
)
mem
->
send_buf
);
LocalFree
(
(
HANDLE
)
mem
);
LocalFree
(
(
HANDLE
)
mem
);
ExitThread
(
0
);
ExitThread
(
0
);
...
@@ -330,8 +330,8 @@ static VOID WINAPI simple_server ( server_params *par )
...
@@ -330,8 +330,8 @@ static VOID WINAPI simple_server ( server_params *par )
server_start
(
par
);
server_start
(
par
);
mem
=
TlsGetValue
(
tls
);
mem
=
TlsGetValue
(
tls
);
wsa_ok
(
set_blocking
(
mem
->
s
,
TRUE
),
0
==
,
"simple_server (%x): failed to set blocking mode: %d"
);
wsa_ok
(
set_blocking
(
mem
->
s
,
TRUE
),
0
==
,
"simple_server (%
l
x): failed to set blocking mode: %d"
);
wsa_ok
(
listen
(
mem
->
s
,
SOMAXCONN
),
0
==
,
"simple_server (%x): listen failed: %d"
);
wsa_ok
(
listen
(
mem
->
s
,
SOMAXCONN
),
0
==
,
"simple_server (%
l
x): listen failed: %d"
);
trace
(
"simple_server (%x) ready
\n
"
,
id
);
trace
(
"simple_server (%x) ready
\n
"
,
id
);
SetEvent
(
server_ready
);
/* notify clients */
SetEvent
(
server_ready
);
/* notify clients */
...
@@ -343,7 +343,7 @@ static VOID WINAPI simple_server ( server_params *par )
...
@@ -343,7 +343,7 @@ static VOID WINAPI simple_server ( server_params *par )
/* accept a single connection */
/* accept a single connection */
tmp
=
sizeof
(
mem
->
sock
[
0
].
peer
);
tmp
=
sizeof
(
mem
->
sock
[
0
].
peer
);
mem
->
sock
[
0
].
s
=
accept
(
mem
->
s
,
(
struct
sockaddr
*
)
&
mem
->
sock
[
0
].
peer
,
&
tmp
);
mem
->
sock
[
0
].
s
=
accept
(
mem
->
s
,
(
struct
sockaddr
*
)
&
mem
->
sock
[
0
].
peer
,
&
tmp
);
wsa_ok
(
mem
->
sock
[
0
].
s
,
INVALID_SOCKET
!=
,
"simple_server (%x): accept failed: %d"
);
wsa_ok
(
mem
->
sock
[
0
].
s
,
INVALID_SOCKET
!=
,
"simple_server (%
l
x): accept failed: %d"
);
ok
(
mem
->
sock
[
0
].
peer
.
sin_addr
.
s_addr
==
inet_addr
(
gen
->
inet_addr
),
ok
(
mem
->
sock
[
0
].
peer
.
sin_addr
.
s_addr
==
inet_addr
(
gen
->
inet_addr
),
"simple_server (%x): strange peer address"
,
id
);
"simple_server (%x): strange peer address"
,
id
);
...
@@ -353,7 +353,7 @@ static VOID WINAPI simple_server ( server_params *par )
...
@@ -353,7 +353,7 @@ static VOID WINAPI simple_server ( server_params *par )
ok
(
n_recvd
==
n_expected
,
ok
(
n_recvd
==
n_expected
,
"simple_server (%x): received less data then expected: %d of %d"
,
id
,
n_recvd
,
n_expected
);
"simple_server (%x): received less data then expected: %d of %d"
,
id
,
n_recvd
,
n_expected
);
p
=
test_buffer
(
mem
->
sock
[
0
].
buf
,
gen
->
chunk_size
,
gen
->
n_chunks
);
p
=
test_buffer
(
mem
->
sock
[
0
].
buf
,
gen
->
chunk_size
,
gen
->
n_chunks
);
ok
(
p
==
NULL
,
"simple_server (%x): test pattern error: %d"
,
p
-
mem
->
sock
[
0
].
buf
);
ok
(
p
==
NULL
,
"simple_server (%x): test pattern error: %d"
,
id
,
p
-
mem
->
sock
[
0
].
buf
);
/* Echo data back */
/* Echo data back */
n_sent
=
do_synchronous_send
(
mem
->
sock
[
0
].
s
,
mem
->
sock
[
0
].
buf
,
n_expected
,
par
->
buflen
);
n_sent
=
do_synchronous_send
(
mem
->
sock
[
0
].
s
,
mem
->
sock
[
0
].
buf
,
n_expected
,
par
->
buflen
);
...
@@ -362,7 +362,7 @@ static VOID WINAPI simple_server ( server_params *par )
...
@@ -362,7 +362,7 @@ static VOID WINAPI simple_server ( server_params *par )
/* cleanup */
/* cleanup */
read_zero_bytes
(
mem
->
sock
[
0
].
s
);
read_zero_bytes
(
mem
->
sock
[
0
].
s
);
wsa_ok
(
closesocket
(
mem
->
sock
[
0
].
s
),
0
==
,
"simple_server (%x): closesocket error: %d"
);
wsa_ok
(
closesocket
(
mem
->
sock
[
0
].
s
),
0
==
,
"simple_server (%
l
x): closesocket error: %d"
);
mem
->
sock
[
0
].
s
=
INVALID_SOCKET
;
mem
->
sock
[
0
].
s
=
INVALID_SOCKET
;
}
}
...
@@ -395,7 +395,7 @@ static VOID WINAPI simple_client ( client_params *par )
...
@@ -395,7 +395,7 @@ static VOID WINAPI simple_client ( client_params *par )
/* Connect */
/* Connect */
wsa_ok
(
connect
(
mem
->
s
,
(
struct
sockaddr
*
)
&
mem
->
addr
,
sizeof
(
mem
->
addr
)
),
wsa_ok
(
connect
(
mem
->
s
,
(
struct
sockaddr
*
)
&
mem
->
addr
,
sizeof
(
mem
->
addr
)
),
0
==
,
"simple_client (%x): connect error: %d"
);
0
==
,
"simple_client (%
l
x): connect error: %d"
);
ok
(
set_blocking
(
mem
->
s
,
TRUE
)
==
0
,
ok
(
set_blocking
(
mem
->
s
,
TRUE
)
==
0
,
"simple_client (%x): failed to set blocking mode"
,
id
);
"simple_client (%x): failed to set blocking mode"
,
id
);
trace
(
"simple_client (%x) connected
\n
"
,
id
);
trace
(
"simple_client (%x) connected
\n
"
,
id
);
...
@@ -406,7 +406,7 @@ static VOID WINAPI simple_client ( client_params *par )
...
@@ -406,7 +406,7 @@ static VOID WINAPI simple_client ( client_params *par )
"simple_client (%x): sent less data then expected: %d of %d"
,
id
,
n_sent
,
n_expected
);
"simple_client (%x): sent less data then expected: %d of %d"
,
id
,
n_sent
,
n_expected
);
/* shutdown send direction */
/* shutdown send direction */
wsa_ok
(
shutdown
(
mem
->
s
,
SD_SEND
),
0
==
,
"simple_client (%x): shutdown failed: %d"
);
wsa_ok
(
shutdown
(
mem
->
s
,
SD_SEND
),
0
==
,
"simple_client (%
l
x): shutdown failed: %d"
);
/* Receive data echoed back & check it */
/* Receive data echoed back & check it */
n_recvd
=
do_synchronous_recv
(
mem
->
s
,
mem
->
recv_buf
,
n_expected
,
par
->
buflen
);
n_recvd
=
do_synchronous_recv
(
mem
->
s
,
mem
->
recv_buf
,
n_expected
,
par
->
buflen
);
...
@@ -453,7 +453,7 @@ static void WINAPI event_client ( client_params *par )
...
@@ -453,7 +453,7 @@ static void WINAPI event_client ( client_params *par )
tmp
=
WaitForSingleObject
(
event
,
INFINITE
);
tmp
=
WaitForSingleObject
(
event
,
INFINITE
);
ok
(
tmp
==
WAIT_OBJECT_0
,
"event_client (%x): wait for connect event failed: %d"
,
id
,
tmp
);
ok
(
tmp
==
WAIT_OBJECT_0
,
"event_client (%x): wait for connect event failed: %d"
,
id
,
tmp
);
err
=
WSAEnumNetworkEvents
(
mem
->
s
,
event
,
&
wsa_events
);
err
=
WSAEnumNetworkEvents
(
mem
->
s
,
event
,
&
wsa_events
);
wsa_ok
(
err
,
0
==
,
"event_client (%x): WSAEnumNetworkEvents error: %d
\n
"
);
wsa_ok
(
err
,
0
==
,
"event_client (%
l
x): WSAEnumNetworkEvents error: %d
\n
"
);
err
=
wsa_events
.
iErrorCode
[
FD_CONNECT_BIT
];
err
=
wsa_events
.
iErrorCode
[
FD_CONNECT_BIT
];
ok
(
err
==
0
,
"event_client (%x): connect error: %d"
,
id
,
err
);
ok
(
err
==
0
,
"event_client (%x): connect error: %d"
,
id
,
err
);
...
@@ -471,10 +471,10 @@ static void WINAPI event_client ( client_params *par )
...
@@ -471,10 +471,10 @@ static void WINAPI event_client ( client_params *par )
while
(
TRUE
)
while
(
TRUE
)
{
{
err
=
WaitForSingleObject
(
event
,
INFINITE
);
err
=
WaitForSingleObject
(
event
,
INFINITE
);
ok
(
err
==
WAIT_OBJECT_0
,
"event_client (%x): wait failed"
,
id
,
tmp
);
ok
(
err
==
WAIT_OBJECT_0
,
"event_client (%x): wait failed"
,
id
);
err
=
WSAEnumNetworkEvents
(
mem
->
s
,
event
,
&
wsa_events
);
err
=
WSAEnumNetworkEvents
(
mem
->
s
,
event
,
&
wsa_events
);
wsa_ok
(
err
,
0
==
,
"event_client (%x): WSAEnumNetworkEvents error: %d
\n
"
);
wsa_ok
(
err
,
0
==
,
"event_client (%
l
x): WSAEnumNetworkEvents error: %d
\n
"
);
if
(
wsa_events
.
lNetworkEvents
&
FD_WRITE
)
if
(
wsa_events
.
lNetworkEvents
&
FD_WRITE
)
{
{
...
@@ -509,7 +509,7 @@ static void WINAPI event_client ( client_params *par )
...
@@ -509,7 +509,7 @@ static void WINAPI event_client ( client_params *par )
ok
(
err
==
0
,
"event_client (%x): FD_READ error code: %d
\n
"
,
id
,
err
);
ok
(
err
==
0
,
"event_client (%x): FD_READ error code: %d
\n
"
,
id
,
err
);
n
=
recv
(
mem
->
s
,
recv_p
,
min
(
recv_last
-
recv_p
,
par
->
buflen
),
0
);
n
=
recv
(
mem
->
s
,
recv_p
,
min
(
recv_last
-
recv_p
,
par
->
buflen
),
0
);
wsa_ok
(
n
,
0
<=
,
"event_client (%x): recv error: %d
\n
"
);
wsa_ok
(
n
,
0
<=
,
"event_client (%
l
x): recv error: %d
\n
"
);
if
(
err
!=
0
||
n
<
0
)
if
(
err
!=
0
||
n
<
0
)
break
;
break
;
else
if
(
n
==
0
)
else
if
(
n
==
0
)
...
@@ -610,7 +610,7 @@ static void do_test( test_setup *test )
...
@@ -610,7 +610,7 @@ static void do_test( test_setup *test )
{
{
for
(
i
=
0
;
i
<=
n
;
i
++
)
for
(
i
=
0
;
i
<=
n
;
i
++
)
{
{
trace
(
"terminating thread %08x
\n
"
,
thread_id
[
i
]);
trace
(
"terminating thread %08
l
x
\n
"
,
thread_id
[
i
]);
if
(
WaitForSingleObject
(
thread
[
i
],
0
)
!=
WAIT_OBJECT_0
)
if
(
WaitForSingleObject
(
thread
[
i
],
0
)
!=
WAIT_OBJECT_0
)
TerminateThread
(
thread
[
i
],
0
);
TerminateThread
(
thread
[
i
],
0
);
}
}
...
...
include/wine/test.h
View file @
75de8fe1
...
@@ -30,11 +30,8 @@ extern int winetest_debug;
...
@@ -30,11 +30,8 @@ extern int winetest_debug;
/* current platform */
/* current platform */
extern
const
char
*
winetest_platform
;
extern
const
char
*
winetest_platform
;
typedef
int
(
*
winetest_ok_funcptr
)(
int
condition
,
const
char
*
msg
,
...);
extern
void
winetest_set_ok_location
(
const
char
*
file
,
int
line
);
typedef
void
(
*
winetest_trace_funcptr
)(
const
char
*
msg
,
...);
extern
void
winetest_set_trace_location
(
const
char
*
file
,
int
line
);
extern
winetest_ok_funcptr
winetest_set_ok_location
(
const
char
*
file
,
int
line
);
extern
winetest_trace_funcptr
winetest_set_trace_location
(
const
char
*
file
,
int
line
);
extern
void
winetest_start_todo
(
const
char
*
platform
);
extern
void
winetest_start_todo
(
const
char
*
platform
);
extern
int
winetest_loop_todo
(
void
);
extern
int
winetest_loop_todo
(
void
);
extern
void
winetest_end_todo
(
const
char
*
platform
);
extern
void
winetest_end_todo
(
const
char
*
platform
);
...
@@ -42,8 +39,23 @@ extern int winetest_get_mainargs( char*** pargv );
...
@@ -42,8 +39,23 @@ extern int winetest_get_mainargs( char*** pargv );
#define START_TEST(name) void func_##name(void)
#define START_TEST(name) void func_##name(void)
#define ok (*winetest_set_ok_location(__FILE__, __LINE__))
#ifdef __GNUC__
#define trace (*winetest_set_trace_location(__FILE__, __LINE__))
extern
int
winetest_ok
(
int
condition
,
const
char
*
msg
,
...
)
__attribute__
((
format
(
printf
,
2
,
3
)
));
extern
void
winetest_trace
(
const
char
*
msg
,
...
)
__attribute__
((
format
(
printf
,
1
,
2
)));
#define ok(cond,args...) (winetest_set_ok_location(__FILE__, __LINE__), winetest_ok((cond),args))
#define trace(args...) (winetest_set_trace_location(__FILE__, __LINE__), winetest_trace(args))
#else
/* __GNUC__ */
extern
int
winetest_ok
(
int
condition
,
const
char
*
msg
,
...
);
extern
void
winetest_trace
(
const
char
*
msg
,
...
);
#define ok (winetest_set_ok_location(__FILE__, __LINE__), 0) ? 0 : winetest_ok
#define trace (winetest_set_trace_location(__FILE__, __LINE__), 0) ? (void)0 : winetest_trace
#endif
/* __GNUC__ */
#define todo(platform) for (winetest_start_todo(platform); \
#define todo(platform) for (winetest_start_todo(platform); \
winetest_loop_todo(); \
winetest_loop_todo(); \
...
...
programs/winetest/wtmain.c
View file @
75de8fe1
...
@@ -148,12 +148,11 @@ int winetest_ok( int condition, const char *msg, ... )
...
@@ -148,12 +148,11 @@ int winetest_ok( int condition, const char *msg, ... )
return
1
;
return
1
;
}
}
winetest_ok_funcptr
winetest_set_ok_location
(
const
char
*
file
,
int
line
)
void
winetest_set_ok_location
(
const
char
*
file
,
int
line
)
{
{
tls_data
*
data
=
get_tls_data
();
tls_data
*
data
=
get_tls_data
();
data
->
current_file
=
file
;
data
->
current_file
=
file
;
data
->
current_line
=
line
;
data
->
current_line
=
line
;
return
&
winetest_ok
;
}
}
void
winetest_trace
(
const
char
*
msg
,
...
)
void
winetest_trace
(
const
char
*
msg
,
...
)
...
@@ -170,12 +169,11 @@ void winetest_trace( const char *msg, ... )
...
@@ -170,12 +169,11 @@ void winetest_trace( const char *msg, ... )
}
}
}
}
winetest_trace_funcptr
winetest_set_trace_location
(
const
char
*
file
,
int
line
)
void
winetest_set_trace_location
(
const
char
*
file
,
int
line
)
{
{
tls_data
*
data
=
get_tls_data
();
tls_data
*
data
=
get_tls_data
();
data
->
current_file
=
file
;
data
->
current_file
=
file
;
data
->
current_line
=
line
;
data
->
current_line
=
line
;
return
&
winetest_trace
;
}
}
void
winetest_start_todo
(
const
char
*
platform
)
void
winetest_start_todo
(
const
char
*
platform
)
...
...
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