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
78ab293d
Commit
78ab293d
authored
Jun 02, 2011
by
Peter Urbanec
Committed by
Alexandre Julliard
Jun 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Socket error handling and reporting tests.
parent
0198b3d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
sock.c
dlls/ws2_32/tests/sock.c
+38
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
78ab293d
...
...
@@ -2258,6 +2258,43 @@ static VOID WINAPI SelectReadThread(select_thread_params *par)
par
->
ReadKilled
=
(
ret
==
1
);
}
static
void
test_errors
(
void
)
{
SOCKET
sock
;
SOCKADDR_IN
SockAddr
;
int
ret
,
err
;
WSASetLastError
(
NO_ERROR
);
sock
=
socket
(
PF_INET
,
SOCK_STREAM
,
0
);
ok
(
(
sock
!=
INVALID_SOCKET
),
"socket failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
memset
(
&
SockAddr
,
0
,
sizeof
(
SockAddr
));
SockAddr
.
sin_family
=
AF_INET
;
SockAddr
.
sin_port
=
htons
(
6924
);
SockAddr
.
sin_addr
.
s_addr
=
inet_addr
(
"127.0.0.1"
);
ret
=
connect
(
sock
,
(
PSOCKADDR
)
&
SockAddr
,
sizeof
(
SockAddr
));
ok
(
(
ret
==
SOCKET_ERROR
),
"expected SOCKET_ERROR, got: %d
\n
"
,
ret
);
if
(
ret
==
SOCKET_ERROR
)
{
err
=
WSAGetLastError
();
ok
(
(
err
==
WSAECONNREFUSED
),
"expected WSAECONNREFUSED, got: %d
\n
"
,
err
);
}
{
TIMEVAL
timeval
;
fd_set
set
=
{
1
,
{
sock
}};
timeval
.
tv_sec
=
0
;
timeval
.
tv_usec
=
50000
;
ret
=
select
(
1
,
NULL
,
&
set
,
NULL
,
&
timeval
);
todo_wine
ok
(
(
ret
==
0
),
"expected 0 (timeout), got: %d
\n
"
,
ret
);
}
ret
=
closesocket
(
sock
);
ok
(
(
ret
==
0
),
"closesocket failed unexpectedly: %d
\n
"
,
WSAGetLastError
());
}
static
void
test_select
(
void
)
{
SOCKET
fdRead
,
fdWrite
;
...
...
@@ -4907,6 +4944,7 @@ START_TEST( sock )
test_WSAStringToAddressA
();
test_WSAStringToAddressW
();
test_errors
();
test_select
();
test_accept
();
test_getpeername
();
...
...
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