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
2a5f290c
Commit
2a5f290c
authored
Dec 03, 2002
by
Martin Wilck
Committed by
Alexandre Julliard
Dec 03, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test to run fine (0 errors) on Win NT.
parent
c0e2c5ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
22 deletions
+30
-22
sock.c
dlls/winsock/tests/sock.c
+30
-22
No files found.
dlls/winsock/tests/sock.c
View file @
2a5f290c
...
...
@@ -18,13 +18,18 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef _WIN32
#include <winsock2.h>
#include <mswsock.h>
#include "wine/test.h"
#else
#include "wine/test.h"
#include <winbase.h>
#include <winnt.h>
#include <winerror.h>
#undef USE_WS_PREFIX
#include <winsock2.h>
#include <mswsock.h>
#endif
#define MAX_CLIENTS 4
/* Max number of clients */
#define NUM_TESTS 2
/* Number of tests performed */
...
...
@@ -503,30 +508,32 @@ static void WINAPI event_client ( client_params *par )
WSAEventSelect
(
mem
->
s
,
event
,
mask
);
}
}
else
if
(
wsa_events
.
lNetworkEvents
&
FD_READ
)
if
(
wsa_events
.
lNetworkEvents
&
FD_READ
)
{
err
=
wsa_events
.
iErrorCode
[
FD_READ_BIT
];
ok
(
err
==
0
,
"event_client (%x): FD_READ error code: %d
\n
"
,
id
,
err
);
if
(
err
!=
0
)
break
;
/* First read must succeed */
n
=
recv
(
mem
->
s
,
recv_p
,
min
(
recv_last
-
recv_p
,
par
->
buflen
),
0
);
wsa_ok
(
n
,
0
<=
,
"event_client (%lx): recv error: %d
\n
"
);
if
(
err
!=
0
||
n
<
0
)
break
;
else
if
(
n
==
0
)
{
ok
(
0
,
"event_client (%x): empty receive"
,
id
);
break
;
}
recv_p
+=
n
;
if
(
recv_p
==
recv_last
)
{
trace
(
"event_client (%x): all data received
\n
"
,
id
);
mask
&=
~
FD_READ
;
WSAEventSelect
(
mem
->
s
,
event
,
mask
);
while
(
n
>=
0
)
{
recv_p
+=
n
;
if
(
recv_p
==
recv_last
)
{
mask
&=
~
FD_READ
;
trace
(
"event_client (%x): all data received
\n
"
,
id
);
WSAEventSelect
(
mem
->
s
,
event
,
mask
);
break
;
}
n
=
recv
(
mem
->
s
,
recv_p
,
min
(
recv_last
-
recv_p
,
par
->
buflen
),
0
);
if
(
n
<
0
&&
(
err
=
WSAGetLastError
())
!=
WSAEWOULDBLOCK
)
ok
(
0
,
"event_client (%x): read error: %d
\n
"
,
id
,
err
);
}
}
else
if
(
wsa_events
.
lNetworkEvents
&
FD_CLOSE
)
}
if
(
wsa_events
.
lNetworkEvents
&
FD_CLOSE
)
{
trace
(
"event_client (%x): close event
\n
"
,
id
);
err
=
wsa_events
.
iErrorCode
[
FD_CLOSE_BIT
];
...
...
@@ -592,8 +599,8 @@ static void StartClients (LPTHREAD_START_ROUTINE routine,
static
void
do_test
(
test_setup
*
test
)
{
int
i
,
n
=
min
(
test
->
general
.
n_clients
,
MAX_CLIENTS
);
int
wait
;
DWORD
i
,
n
=
min
(
test
->
general
.
n_clients
,
MAX_CLIENTS
);
DWORD
wait
;
server_ready
=
CreateEventA
(
NULL
,
TRUE
,
FALSE
,
NULL
);
for
(
i
=
0
;
i
<=
n
;
i
++
)
...
...
@@ -604,9 +611,10 @@ static void do_test( test_setup *test )
WaitForSingleObject
(
server_ready
,
INFINITE
);
wait
=
WaitForMultipleObjects
(
1
+
n
,
thread
,
TRUE
,
1000
*
TEST_TIMEOUT
);
ok
(
wait
==
WAIT_OBJECT_0
,
"some threads have not completed
\n
"
);
ok
(
wait
>=
WAIT_OBJECT_0
&&
wait
<=
WAIT_OBJECT_0
+
n
,
"some threads have not completed: %lx
\n
"
,
wait
);
if
(
wait
==
WAIT_TIMEOUT
)
if
(
!
(
wait
>=
WAIT_OBJECT_0
&&
wait
<=
WAIT_OBJECT_0
+
n
)
)
{
for
(
i
=
0
;
i
<=
n
;
i
++
)
{
...
...
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