Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
f229c911
Commit
f229c911
authored
Jan 23, 2004
by
Francois Gouget
Committed by
Alexandre Julliard
Jan 23, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add trailing '\n's to ok() calls.
parent
399901e0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
78 deletions
+78
-78
atom.c
dlls/kernel/tests/atom.c
+32
-32
codepage.c
dlls/kernel/tests/codepage.c
+2
-2
sock.c
dlls/winsock/tests/sock.c
+34
-34
info.c
dlls/winspool/tests/info.c
+10
-10
No files found.
dlls/kernel/tests/atom.c
View file @
f229c911
...
...
@@ -39,13 +39,13 @@ static void test_add_atom(void)
SetLastError
(
0xdeadbeef
);
atom
=
GlobalAddAtomA
(
"foobar"
);
ok
(
atom
>=
0xc000
,
"bad atom id %x"
,
atom
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GlobalAddAtomA set last error"
);
ok
(
atom
>=
0xc000
,
"bad atom id %x
\n
"
,
atom
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GlobalAddAtomA set last error
\n
"
);
/* Verify that it can be found (or not) appropriately */
ok
(
GlobalFindAtomA
(
"foobar"
)
==
atom
,
"could not find atom foobar"
);
ok
(
GlobalFindAtomA
(
"FOOBAR"
)
==
atom
,
"could not find atom FOOBAR"
);
ok
(
!
GlobalFindAtomA
(
"_foobar"
),
"found _foobar"
);
ok
(
GlobalFindAtomA
(
"foobar"
)
==
atom
,
"could not find atom foobar
\n
"
);
ok
(
GlobalFindAtomA
(
"FOOBAR"
)
==
atom
,
"could not find atom FOOBAR
\n
"
);
ok
(
!
GlobalFindAtomA
(
"_foobar"
),
"found _foobar
\n
"
);
/* Add the same atom, specifying string as unicode; should
* find the first one, not add a new one */
...
...
@@ -58,16 +58,16 @@ static void test_add_atom(void)
if
(
unicode_OS
)
{
ok
(
w_atom
==
atom
,
"Unicode atom does not match ASCII"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GlobalAddAtomW set last error"
);
ok
(
w_atom
==
atom
,
"Unicode atom does not match ASCII
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GlobalAddAtomW set last error
\n
"
);
}
/* Verify that it can be found (or not) appropriately via unicode name */
if
(
unicode_OS
)
{
ok
(
GlobalFindAtomW
(
foobarW
)
==
atom
,
"could not find atom foobar"
);
ok
(
GlobalFindAtomW
(
FOOBARW
)
==
atom
,
"could not find atom FOOBAR"
);
ok
(
!
GlobalFindAtomW
(
_foobarW
),
"found _foobar"
);
ok
(
GlobalFindAtomW
(
foobarW
)
==
atom
,
"could not find atom foobar
\n
"
);
ok
(
GlobalFindAtomW
(
FOOBARW
)
==
atom
,
"could not find atom FOOBAR
\n
"
);
ok
(
!
GlobalFindAtomW
(
_foobarW
),
"found _foobar
\n
"
);
}
/* Test integer atoms
...
...
@@ -75,11 +75,11 @@ static void test_add_atom(void)
* (0xc000 .. 0xffff) should be invalid */
SetLastError
(
0xdeadbeef
);
ok
(
GlobalAddAtomA
(
0
)
==
0
&&
GetLastError
()
==
0xdeadbeef
,
"succeeded to add atom 0"
);
ok
(
GlobalAddAtomA
(
0
)
==
0
&&
GetLastError
()
==
0xdeadbeef
,
"succeeded to add atom 0
\n
"
);
if
(
unicode_OS
)
{
SetLastError
(
0xdeadbeef
);
ok
(
GlobalAddAtomW
(
0
)
==
0
&&
GetLastError
()
==
0xdeadbeef
,
"succeeded to add atom 0"
);
ok
(
GlobalAddAtomW
(
0
)
==
0
&&
GetLastError
()
==
0xdeadbeef
,
"succeeded to add atom 0
\n
"
);
}
SetLastError
(
0xdeadbeef
);
...
...
@@ -87,20 +87,20 @@ static void test_add_atom(void)
{
SetLastError
(
0xdeadbeef
);
ok
(
GlobalAddAtomA
((
LPCSTR
)
i
)
==
i
&&
GetLastError
()
==
0xdeadbeef
,
"failed to add atom %x"
,
i
);
"failed to add atom %x
\n
"
,
i
);
if
(
unicode_OS
)
{
SetLastError
(
0xdeadbeef
);
ok
(
GlobalAddAtomW
((
LPCWSTR
)
i
)
==
i
&&
GetLastError
()
==
0xdeadbeef
,
"failed to add atom %x"
,
i
);
"failed to add atom %x
\n
"
,
i
);
}
}
for
(
i
=
0xc000
;
i
<=
0xffff
;
i
++
)
{
ok
(
!
GlobalAddAtomA
((
LPCSTR
)
i
),
"succeeded adding %x"
,
i
);
ok
(
!
GlobalAddAtomA
((
LPCSTR
)
i
),
"succeeded adding %x
\n
"
,
i
);
if
(
unicode_OS
)
ok
(
!
GlobalAddAtomW
((
LPCWSTR
)
i
),
"succeeded adding %x"
,
i
);
ok
(
!
GlobalAddAtomW
((
LPCWSTR
)
i
),
"succeeded adding %x
\n
"
,
i
);
}
}
...
...
@@ -117,8 +117,8 @@ static void test_get_atom_name(void)
/* Get the name of the atom we added above */
memset
(
buf
,
'.'
,
sizeof
(
buf
)
);
len
=
GlobalGetAtomNameA
(
atom
,
buf
,
10
);
ok
(
len
==
strlen
(
"foobar"
),
"bad length %d"
,
len
);
ok
(
!
memcmp
(
buf
,
"foobar
\0
..."
,
10
),
"bad buffer contents"
);
ok
(
len
==
strlen
(
"foobar"
),
"bad length %d
\n
"
,
len
);
ok
(
!
memcmp
(
buf
,
"foobar
\0
..."
,
10
),
"bad buffer contents
\n
"
);
/* Repeat, unicode-style */
if
(
unicode_OS
)
...
...
@@ -126,23 +126,23 @@ static void test_get_atom_name(void)
for
(
i
=
0
;
i
<
10
;
i
++
)
bufW
[
i
]
=
'.'
;
SetLastError
(
0xdeadbeef
);
len
=
GlobalGetAtomNameW
(
atom
,
bufW
,
10
);
ok
(
len
&&
GetLastError
()
==
0xdeadbeef
,
"GlobalGetAtomNameW failed"
);
ok
(
len
==
lstrlenW
(
foobarW
),
"bad length %d"
,
len
);
ok
(
!
memcmp
(
bufW
,
resultW
,
10
*
sizeof
(
WCHAR
)
),
"bad buffer contents"
);
ok
(
len
&&
GetLastError
()
==
0xdeadbeef
,
"GlobalGetAtomNameW failed
\n
"
);
ok
(
len
==
lstrlenW
(
foobarW
),
"bad length %d
\n
"
,
len
);
ok
(
!
memcmp
(
bufW
,
resultW
,
10
*
sizeof
(
WCHAR
)
),
"bad buffer contents
\n
"
);
}
/* Check error code returns */
memset
(
buf
,
'.'
,
10
);
ok
(
!
GlobalGetAtomNameA
(
atom
,
buf
,
0
),
"succeeded"
);
ok
(
!
memcmp
(
buf
,
".........."
,
10
),
"should not touch buffer"
);
ok
(
!
GlobalGetAtomNameA
(
atom
,
buf
,
0
),
"succeeded
\n
"
);
ok
(
!
memcmp
(
buf
,
".........."
,
10
),
"should not touch buffer
\n
"
);
if
(
unicode_OS
)
{
static
const
WCHAR
sampleW
[
10
]
=
{
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
};
for
(
i
=
0
;
i
<
10
;
i
++
)
bufW
[
i
]
=
'.'
;
ok
(
!
GlobalGetAtomNameW
(
atom
,
bufW
,
0
),
"succeeded"
);
ok
(
!
memcmp
(
bufW
,
sampleW
,
10
*
sizeof
(
WCHAR
)
),
"should not touch buffer"
);
ok
(
!
GlobalGetAtomNameW
(
atom
,
bufW
,
0
),
"succeeded
\n
"
);
ok
(
!
memcmp
(
bufW
,
sampleW
,
10
*
sizeof
(
WCHAR
)
),
"should not touch buffer
\n
"
);
}
/* Test integer atoms */
...
...
@@ -153,13 +153,13 @@ static void test_get_atom_name(void)
if
(
i
)
{
char
res
[
20
];
ok
(
(
len
>
1
)
&&
(
len
<
7
),
"bad length %d"
,
len
);
ok
(
(
len
>
1
)
&&
(
len
<
7
),
"bad length %d
\n
"
,
len
);
sprintf
(
res
,
"#%d"
,
i
);
memset
(
res
+
strlen
(
res
)
+
1
,
'a'
,
10
);
ok
(
!
memcmp
(
res
,
buf
,
10
),
"bad buffer contents %s"
,
buf
);
ok
(
!
memcmp
(
res
,
buf
,
10
),
"bad buffer contents %s
\n
"
,
buf
);
}
else
ok
(
!
len
,
"bad length %d"
,
len
);
ok
(
!
len
,
"bad length %d
\n
"
,
len
);
}
}
...
...
@@ -171,15 +171,15 @@ static void test_error_handling(void)
memset
(
buffer
,
'a'
,
256
);
buffer
[
256
]
=
0
;
ok
(
!
GlobalAddAtomA
(
buffer
),
"add succeeded"
);
ok
(
!
GlobalFindAtomA
(
buffer
),
"find succeeded"
);
ok
(
!
GlobalAddAtomA
(
buffer
),
"add succeeded
\n
"
);
ok
(
!
GlobalFindAtomA
(
buffer
),
"find succeeded
\n
"
);
if
(
unicode_OS
)
{
for
(
i
=
0
;
i
<
256
;
i
++
)
bufferW
[
i
]
=
'b'
;
bufferW
[
256
]
=
0
;
ok
(
!
GlobalAddAtomW
(
bufferW
),
"add succeeded"
);
ok
(
!
GlobalFindAtomW
(
bufferW
),
"find succeeded"
);
ok
(
!
GlobalAddAtomW
(
bufferW
),
"add succeeded
\n
"
);
ok
(
!
GlobalFindAtomW
(
bufferW
),
"find succeeded
\n
"
);
}
}
...
...
dlls/kernel/tests/codepage.c
View file @
f229c911
...
...
@@ -47,13 +47,13 @@ static void test_negative_source_length(void)
memset
(
buf
,
'x'
,
sizeof
(
buf
));
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
foobarW
,
-
2002
,
buf
,
10
,
NULL
,
NULL
);
ok
(
len
==
7
&&
!
lstrcmpA
(
buf
,
"foobar"
)
&&
GetLastError
()
==
0xdeadbeef
,
"WideCharToMultiByte(-2002): len=%d error=%ld"
,
len
,
GetLastError
());
"WideCharToMultiByte(-2002): len=%d error=%ld
\n
"
,
len
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
memset
(
bufW
,
'x'
,
sizeof
(
bufW
));
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
"foobar"
,
-
2002
,
bufW
,
10
);
ok
(
len
==
7
&&
!
mylstrcmpW
(
bufW
,
foobarW
)
&&
GetLastError
()
==
0xdeadbeef
,
"MultiByteToWideChar(-2002): len=%d error=%ld"
,
len
,
GetLastError
());
"MultiByteToWideChar(-2002): len=%d error=%ld
\n
"
,
len
,
GetLastError
());
}
START_TEST
(
codepage
)
...
...
dlls/winsock/tests/sock.c
View file @
f229c911
...
...
@@ -135,11 +135,11 @@ static void set_so_opentype ( BOOL overlapped )
ok
(
setsockopt
(
INVALID_SOCKET
,
SOL_SOCKET
,
SO_OPENTYPE
,
(
LPVOID
)
&
optval
,
sizeof
(
optval
)
)
==
0
,
"setting SO_OPENTYPE failed"
);
"setting SO_OPENTYPE failed
\n
"
);
ok
(
getsockopt
(
INVALID_SOCKET
,
SOL_SOCKET
,
SO_OPENTYPE
,
(
LPVOID
)
&
newval
,
&
len
)
==
0
,
"getting SO_OPENTYPE failed"
);
ok
(
optval
==
newval
,
"failed to set SO_OPENTYPE"
);
"getting SO_OPENTYPE failed
\n
"
);
ok
(
optval
==
newval
,
"failed to set SO_OPENTYPE
\n
"
);
}
static
int
set_blocking
(
SOCKET
s
,
BOOL
blocking
)
...
...
@@ -186,7 +186,7 @@ static int do_synchronous_send ( SOCKET s, char *buf, int buflen, int sendlen )
int
n
=
1
;
for
(
p
=
buf
;
n
>
0
&&
p
<
last
;
p
+=
n
)
n
=
send
(
s
,
p
,
min
(
sendlen
,
last
-
p
),
0
);
wsa_ok
(
n
,
0
<=
,
"do_synchronous_send (%lx): error %d"
);
wsa_ok
(
n
,
0
<=
,
"do_synchronous_send (%lx): error %d
\n
"
);
return
p
-
buf
;
}
...
...
@@ -196,7 +196,7 @@ static int do_synchronous_recv ( SOCKET s, char *buf, int buflen, int recvlen )
int
n
=
1
;
for
(
p
=
buf
;
n
>
0
&&
p
<
last
;
p
+=
n
)
n
=
recv
(
s
,
p
,
min
(
recvlen
,
last
-
p
),
0
);
wsa_ok
(
n
,
0
<=
,
"do_synchronous_recv (%lx): error %d:"
);
wsa_ok
(
n
,
0
<=
,
"do_synchronous_recv (%lx): error %d:
\n
"
);
return
p
-
buf
;
}
...
...
@@ -209,7 +209,7 @@ static void check_so_opentype (void)
int
tmp
=
1
,
len
;
len
=
sizeof
(
tmp
);
getsockopt
(
INVALID_SOCKET
,
SOL_SOCKET
,
SO_OPENTYPE
,
(
LPVOID
)
&
tmp
,
&
len
);
ok
(
tmp
==
0
,
"check_so_opentype: wrong startup value of SO_OPENTYPE: %d"
,
tmp
);
ok
(
tmp
==
0
,
"check_so_opentype: wrong startup value of SO_OPENTYPE: %d
\n
"
,
tmp
);
}
/**************** Server utility functions ***************/
...
...
@@ -242,7 +242,7 @@ static void server_start ( server_params *par )
TlsSetValue
(
tls
,
mem
);
mem
->
s
=
WSASocketA
(
AF_INET
,
gen
->
sock_type
,
gen
->
sock_prot
,
NULL
,
0
,
par
->
sock_flags
);
ok
(
mem
->
s
!=
INVALID_SOCKET
,
"Server: WSASocket failed"
);
ok
(
mem
->
s
!=
INVALID_SOCKET
,
"Server: WSASocket failed
\n
"
);
mem
->
addr
.
sin_family
=
AF_INET
;
mem
->
addr
.
sin_addr
.
s_addr
=
inet_addr
(
gen
->
inet_addr
);
...
...
@@ -270,7 +270,7 @@ static void server_stop (void)
if
(
mem
->
sock
[
i
].
s
!=
INVALID_SOCKET
)
closesocket
(
mem
->
sock
[
i
].
s
);
}
ok
(
closesocket
(
mem
->
s
)
==
0
,
"closesocket failed"
);
ok
(
closesocket
(
mem
->
s
)
==
0
,
"closesocket failed
\n
"
);
LocalFree
(
(
HANDLE
)
mem
);
ExitThread
(
GetCurrentThreadId
()
);
}
...
...
@@ -293,7 +293,7 @@ static void client_start ( client_params *par )
mem
->
addr
.
sin_addr
.
s_addr
=
inet_addr
(
gen
->
inet_addr
);
mem
->
addr
.
sin_port
=
htons
(
gen
->
inet_port
);
ok
(
mem
->
s
!=
INVALID_SOCKET
,
"Client: WSASocket failed"
);
ok
(
mem
->
s
!=
INVALID_SOCKET
,
"Client: WSASocket failed
\n
"
);
mem
->
send_buf
=
(
LPVOID
)
LocalAlloc
(
LPTR
,
2
*
gen
->
n_chunks
*
gen
->
chunk_size
);
mem
->
recv_buf
=
mem
->
send_buf
+
gen
->
n_chunks
*
gen
->
chunk_size
;
...
...
@@ -332,8 +332,8 @@ static VOID WINAPI simple_server ( server_params *par )
server_start
(
par
);
mem
=
TlsGetValue
(
tls
);
wsa_ok
(
set_blocking
(
mem
->
s
,
TRUE
),
0
==
,
"simple_server (%lx): failed to set blocking mode: %d"
);
wsa_ok
(
listen
(
mem
->
s
,
SOMAXCONN
),
0
==
,
"simple_server (%lx): listen failed: %d"
);
wsa_ok
(
set_blocking
(
mem
->
s
,
TRUE
),
0
==
,
"simple_server (%lx): failed to set blocking mode: %d
\n
"
);
wsa_ok
(
listen
(
mem
->
s
,
SOMAXCONN
),
0
==
,
"simple_server (%lx): listen failed: %d
\n
"
);
trace
(
"simple_server (%x) ready
\n
"
,
id
);
SetEvent
(
server_ready
);
/* notify clients */
...
...
@@ -345,26 +345,26 @@ static VOID WINAPI simple_server ( server_params *par )
/* accept a single connection */
tmp
=
sizeof
(
mem
->
sock
[
0
].
peer
);
mem
->
sock
[
0
].
s
=
accept
(
mem
->
s
,
(
struct
sockaddr
*
)
&
mem
->
sock
[
0
].
peer
,
&
tmp
);
wsa_ok
(
mem
->
sock
[
0
].
s
,
INVALID_SOCKET
!=
,
"simple_server (%lx): accept failed: %d"
);
wsa_ok
(
mem
->
sock
[
0
].
s
,
INVALID_SOCKET
!=
,
"simple_server (%lx): accept failed: %d
\n
"
);
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
\n
"
,
id
);
/* Receive data & check it */
n_recvd
=
do_synchronous_recv
(
mem
->
sock
[
0
].
s
,
mem
->
sock
[
0
].
buf
,
n_expected
,
par
->
buflen
);
ok
(
n_recvd
==
n_expected
,
"simple_server (%x): received less data th
en expected: %d of %d
"
,
id
,
n_recvd
,
n_expected
);
"simple_server (%x): received less data th
an expected: %d of %d
\n
"
,
id
,
n_recvd
,
n_expected
);
p
=
test_buffer
(
mem
->
sock
[
0
].
buf
,
gen
->
chunk_size
,
gen
->
n_chunks
);
ok
(
p
==
NULL
,
"simple_server (%x): test pattern error: %d"
,
id
,
p
-
mem
->
sock
[
0
].
buf
);
ok
(
p
==
NULL
,
"simple_server (%x): test pattern error: %d
\n
"
,
id
,
p
-
mem
->
sock
[
0
].
buf
);
/* Echo data back */
n_sent
=
do_synchronous_send
(
mem
->
sock
[
0
].
s
,
mem
->
sock
[
0
].
buf
,
n_expected
,
par
->
buflen
);
ok
(
n_sent
==
n_expected
,
"simple_server (%x): sent less data th
en expected: %d of %d
"
,
id
,
n_sent
,
n_expected
);
"simple_server (%x): sent less data th
an expected: %d of %d
\n
"
,
id
,
n_sent
,
n_expected
);
/* cleanup */
read_zero_bytes
(
mem
->
sock
[
0
].
s
);
wsa_ok
(
closesocket
(
mem
->
sock
[
0
].
s
),
0
==
,
"simple_server (%lx): closesocket error: %d"
);
wsa_ok
(
closesocket
(
mem
->
sock
[
0
].
s
),
0
==
,
"simple_server (%lx): closesocket error: %d
\n
"
);
mem
->
sock
[
0
].
s
=
INVALID_SOCKET
;
}
...
...
@@ -397,27 +397,27 @@ static VOID WINAPI simple_client ( client_params *par )
/* Connect */
wsa_ok
(
connect
(
mem
->
s
,
(
struct
sockaddr
*
)
&
mem
->
addr
,
sizeof
(
mem
->
addr
)
),
0
==
,
"simple_client (%lx): connect error: %d"
);
0
==
,
"simple_client (%lx): connect error: %d
\n
"
);
ok
(
set_blocking
(
mem
->
s
,
TRUE
)
==
0
,
"simple_client (%x): failed to set blocking mode"
,
id
);
"simple_client (%x): failed to set blocking mode
\n
"
,
id
);
trace
(
"simple_client (%x) connected
\n
"
,
id
);
/* send data to server */
n_sent
=
do_synchronous_send
(
mem
->
s
,
mem
->
send_buf
,
n_expected
,
par
->
buflen
);
ok
(
n_sent
==
n_expected
,
"simple_client (%x): sent less data th
en expected: %d of %d
"
,
id
,
n_sent
,
n_expected
);
"simple_client (%x): sent less data th
an expected: %d of %d
\n
"
,
id
,
n_sent
,
n_expected
);
/* shutdown send direction */
wsa_ok
(
shutdown
(
mem
->
s
,
SD_SEND
),
0
==
,
"simple_client (%lx): shutdown failed: %d"
);
wsa_ok
(
shutdown
(
mem
->
s
,
SD_SEND
),
0
==
,
"simple_client (%lx): shutdown failed: %d
\n
"
);
/* Receive data echoed back & check it */
n_recvd
=
do_synchronous_recv
(
mem
->
s
,
mem
->
recv_buf
,
n_expected
,
par
->
buflen
);
ok
(
n_recvd
==
n_expected
,
"simple_client (%x): received less data th
en expected: %d of %d
"
,
id
,
n_recvd
,
n_expected
);
"simple_client (%x): received less data th
an expected: %d of %d
\n
"
,
id
,
n_recvd
,
n_expected
);
/* check data */
p
=
test_buffer
(
mem
->
recv_buf
,
gen
->
chunk_size
,
gen
->
n_chunks
);
ok
(
p
==
NULL
,
"simple_client (%x): test pattern error: %d"
,
id
,
p
-
mem
->
recv_buf
);
ok
(
p
==
NULL
,
"simple_client (%x): test pattern error: %d
\n
"
,
id
,
p
-
mem
->
recv_buf
);
/* cleanup */
read_zero_bytes
(
mem
->
s
);
...
...
@@ -450,15 +450,15 @@ static void WINAPI event_client ( client_params *par )
WSAEventSelect
(
mem
->
s
,
event
,
FD_CONNECT
);
tmp
=
connect
(
mem
->
s
,
(
struct
sockaddr
*
)
&
mem
->
addr
,
sizeof
(
mem
->
addr
)
);
if
(
tmp
!=
0
&&
(
err
=
WSAGetLastError
()
)
!=
WSAEWOULDBLOCK
)
ok
(
0
,
"event_client (%x): connect error: %d"
,
id
,
err
);
ok
(
0
,
"event_client (%x): connect error: %d
\n
"
,
id
,
err
);
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
\n
"
,
id
,
tmp
);
err
=
WSAEnumNetworkEvents
(
mem
->
s
,
event
,
&
wsa_events
);
wsa_ok
(
err
,
0
==
,
"event_client (%lx): WSAEnumNetworkEvents error: %d
\n
"
);
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
\n
"
,
id
,
err
);
if
(
err
)
goto
out
;
trace
(
"event_client (%x) connected
\n
"
,
id
);
...
...
@@ -473,7 +473,7 @@ static void WINAPI event_client ( client_params *par )
while
(
TRUE
)
{
err
=
WaitForSingleObject
(
event
,
INFINITE
);
ok
(
err
==
WAIT_OBJECT_0
,
"event_client (%x): wait failed"
,
id
);
ok
(
err
==
WAIT_OBJECT_0
,
"event_client (%x): wait failed
\n
"
,
id
);
err
=
WSAEnumNetworkEvents
(
mem
->
s
,
event
,
&
wsa_events
);
wsa_ok
(
err
,
0
==
,
"event_client (%lx): WSAEnumNetworkEvents error: %d
\n
"
);
...
...
@@ -540,13 +540,13 @@ static void WINAPI event_client ( client_params *par )
}
ok
(
send_p
==
send_last
,
"simple_client (%x): sent less data th
en expected: %d of %d
"
,
"simple_client (%x): sent less data th
an expected: %d of %d
\n
"
,
id
,
send_p
-
mem
->
send_buf
,
n_expected
);
ok
(
recv_p
==
recv_last
,
"simple_client (%x): received less data th
en expected: %d of %d
"
,
"simple_client (%x): received less data th
an expected: %d of %d
\n
"
,
id
,
recv_p
-
mem
->
recv_buf
,
n_expected
);
recv_p
=
test_buffer
(
mem
->
recv_buf
,
gen
->
chunk_size
,
gen
->
n_chunks
);
ok
(
recv_p
==
NULL
,
"event_client (%x): test pattern error: %d"
,
id
,
recv_p
-
mem
->
recv_buf
);
ok
(
recv_p
==
NULL
,
"event_client (%x): test pattern error: %d
\n
"
,
id
,
recv_p
-
mem
->
recv_buf
);
out:
WSACloseEvent
(
event
);
...
...
@@ -561,14 +561,14 @@ static void Init (void)
WORD
ver
=
MAKEWORD
(
2
,
2
);
WSADATA
data
;
ok
(
WSAStartup
(
ver
,
&
data
)
==
0
,
"WSAStartup failed"
);
ok
(
WSAStartup
(
ver
,
&
data
)
==
0
,
"WSAStartup failed
\n
"
);
tls
=
TlsAlloc
();
}
static
void
Exit
(
void
)
{
TlsFree
(
tls
);
ok
(
WSACleanup
()
==
0
,
"WSACleanup failed"
);
ok
(
WSACleanup
()
==
0
,
"WSACleanup failed
\n
"
);
}
static
void
StartServer
(
LPTHREAD_START_ROUTINE
routine
,
...
...
@@ -576,7 +576,7 @@ static void StartServer (LPTHREAD_START_ROUTINE routine,
{
par
->
general
=
general
;
thread
[
0
]
=
CreateThread
(
NULL
,
0
,
routine
,
par
,
0
,
&
thread_id
[
0
]
);
ok
(
thread
[
0
]
!=
NULL
,
"Failed to create server thread"
);
ok
(
thread
[
0
]
!=
NULL
,
"Failed to create server thread
\n
"
);
}
static
void
StartClients
(
LPTHREAD_START_ROUTINE
routine
,
...
...
@@ -588,7 +588,7 @@ static void StartClients (LPTHREAD_START_ROUTINE routine,
{
client_id
=
i
-
1
;
thread
[
i
]
=
CreateThread
(
NULL
,
0
,
routine
,
par
,
0
,
&
thread_id
[
i
]
);
ok
(
thread
[
i
]
!=
NULL
,
"Failed to create client thread"
);
ok
(
thread
[
i
]
!=
NULL
,
"Failed to create client thread
\n
"
);
/* Make sure the client is up and running */
WaitForSingleObject
(
client_ready
[
client_id
],
INFINITE
);
};
...
...
dlls/winspool/tests/info.c
View file @
f229c911
...
...
@@ -35,21 +35,21 @@ static void test_printer_directory(ivoid)
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cbBuf
*
2
);
res
=
GetPrinterDriverDirectoryA
(
NULL
,
NULL
,
1
,
buffer
,
cbBuf
,
&
pcbNeeded
);
ok
(
res
,
"expected result != 0, got %d"
,
res
);
ok
(
cbBuf
==
pcbNeeded
,
"pcbNeeded set to %ld instead of %ld"
,
ok
(
res
,
"expected result != 0, got %d
\n
"
,
res
);
ok
(
cbBuf
==
pcbNeeded
,
"pcbNeeded set to %ld instead of %ld
\n
"
,
pcbNeeded
,
cbBuf
);
res
=
GetPrinterDriverDirectoryA
(
NULL
,
NULL
,
1
,
buffer
,
cbBuf
*
2
,
&
pcbNeeded
);
ok
(
res
,
"expected result != 0, got %d"
,
res
);
ok
(
cbBuf
==
pcbNeeded
,
"pcbNeeded set to %ld instead of %ld"
,
ok
(
res
,
"expected result != 0, got %d
\n
"
,
res
);
ok
(
cbBuf
==
pcbNeeded
,
"pcbNeeded set to %ld instead of %ld
\n
"
,
pcbNeeded
,
cbBuf
);
res
=
GetPrinterDriverDirectoryA
(
NULL
,
NULL
,
1
,
buffer
,
cbBuf
-
1
,
&
pcbNeeded
);
ok
(
!
res
,
"expected result == 0, got %d"
,
res
);
ok
(
cbBuf
==
pcbNeeded
,
"pcbNeeded set to %ld instead of %ld"
,
ok
(
!
res
,
"expected result == 0, got %d
\n
"
,
res
);
ok
(
cbBuf
==
pcbNeeded
,
"pcbNeeded set to %ld instead of %ld
\n
"
,
pcbNeeded
,
cbBuf
);
ok
(
ERROR_INSUFFICIENT_BUFFER
==
GetLastError
(),
"last error set to %ld instead of ERROR_INSUFFICIENT_BUFFER"
,
"last error set to %ld instead of ERROR_INSUFFICIENT_BUFFER
\n
"
,
GetLastError
());
res
=
GetPrinterDriverDirectoryA
(
NULL
,
NULL
,
1
,
NULL
,
cbBuf
,
&
pcbNeeded
);
...
...
@@ -58,13 +58,13 @@ static void test_printer_directory(ivoid)
"expected either result == 0 and "
"last error == ERROR_INVALID_USER_BUFFER "
"or result != 0 and last error == ERROR_INVALID_PARAMETER "
"got result %d and last error == %ld"
,
res
,
GetLastError
());
"got result %d and last error == %ld
\n
"
,
res
,
GetLastError
());
res
=
GetPrinterDriverDirectoryA
(
NULL
,
NULL
,
1
,
buffer
,
cbBuf
,
NULL
);
ok
(
(
!
res
&&
RPC_X_NULL_REF_POINTER
==
GetLastError
())
||
res
,
"expected either result == 0 and "
"last error == RPC_X_NULL_REF_POINTER or result != 0 "
"got result %d and last error == %ld"
,
res
,
GetLastError
());
"got result %d and last error == %ld
\n
"
,
res
,
GetLastError
());
res
=
GetPrinterDriverDirectoryA
(
NULL
,
NULL
,
1
,
NULL
,
cbBuf
,
NULL
);
ok
(
(
!
res
&&
RPC_X_NULL_REF_POINTER
==
GetLastError
())
||
...
...
@@ -72,7 +72,7 @@ static void test_printer_directory(ivoid)
"expected either result == 0 and "
"last error == RPC_X_NULL_REF_POINTER "
"or result != 0 and last error == ERROR_INVALID_PARAMETER "
"got result %d and last error == %ld"
,
res
,
GetLastError
());
"got result %d and last error == %ld
\n
"
,
res
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
...
...
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