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
a1e22940
Commit
a1e22940
authored
Jan 06, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Jan 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Show that the last WSACleanup must destroy sockets.
parent
7e4d075e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
sock.c
dlls/ws2_32/tests/sock.c
+27
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
a1e22940
...
...
@@ -1027,6 +1027,8 @@ static void test_WithWSAStartup(void)
WORD
version
=
MAKEWORD
(
2
,
2
);
INT
res
;
LPVOID
ptr
;
SOCKET
src
,
dst
;
DWORD
error
;
res
=
WSAStartup
(
version
,
&
data
);
ok
(
res
==
0
,
"WSAStartup() failed unexpectedly: %d
\n
"
,
res
);
...
...
@@ -1034,6 +1036,31 @@ static void test_WithWSAStartup(void)
ptr
=
gethostbyname
(
"localhost"
);
ok
(
ptr
!=
NULL
,
"gethostbyname() failed unexpectedly: %d
\n
"
,
WSAGetLastError
());
ok
(
!
tcp_socketpair
(
&
src
,
&
dst
),
"creating socket pair failed
\n
"
);
res
=
send
(
src
,
"TEST"
,
4
,
0
);
ok
(
res
==
4
,
"send failed with error %d
\n
"
,
WSAGetLastError
());
WSACleanup
();
res
=
WSAStartup
(
version
,
&
data
);
ok
(
res
==
0
,
"WSAStartup() failed unexpectedly: %d
\n
"
,
res
);
/* show that sockets are destroyed automatically after WSACleanup */
todo_wine
{
SetLastError
(
0xdeadbeef
);
res
=
send
(
src
,
"TEST"
,
4
,
0
);
error
=
WSAGetLastError
();
ok
(
res
==
SOCKET_ERROR
,
"send should have failed
\n
"
);
ok
(
error
==
WSAENOTSOCK
,
"expected 10038, got %d
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
res
=
closesocket
(
dst
);
error
=
WSAGetLastError
();
ok
(
res
==
SOCKET_ERROR
,
"closesocket should have failed
\n
"
);
ok
(
error
==
WSAENOTSOCK
,
"expected 10038, got %d
\n
"
,
error
);
}
WSACleanup
();
}
...
...
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