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
5d113335
Commit
5d113335
authored
Jun 22, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Test setting SO_TYPE.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c5487167
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
sock.c
dlls/ws2_32/tests/sock.c
+28
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
5d113335
...
...
@@ -2294,23 +2294,51 @@ static void test_WSASocket(void)
sock
=
WSASocketA
(
0
,
0
,
0
,
&
pi
[
0
],
0
,
0
);
ok
(
sock
!=
INVALID_SOCKET
,
"Failed to create socket: %d
\n
"
,
WSAGetLastError
());
size
=
sizeof
(
socktype
);
socktype
=
0xdead
;
err
=
getsockopt
(
sock
,
SOL_SOCKET
,
SO_TYPE
,
(
char
*
)
&
socktype
,
&
size
);
ok
(
!
err
,
"getsockopt failed with %d
\n
"
,
WSAGetLastError
());
ok
(
socktype
==
SOCK_DGRAM
,
"Wrong socket type, expected %d received %d
\n
"
,
SOCK_DGRAM
,
socktype
);
socktype
=
SOCK_STREAM
;
WSASetLastError
(
0xdeadbeef
);
err
=
setsockopt
(
sock
,
SOL_SOCKET
,
SO_TYPE
,
(
char
*
)
&
socktype
,
sizeof
(
socktype
));
ok
(
err
==
-
1
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
WSAEINVAL
,
"got error %u
\n
"
,
WSAGetLastError
());
socktype
=
SOCK_DGRAM
;
WSASetLastError
(
0xdeadbeef
);
err
=
setsockopt
(
sock
,
SOL_SOCKET
,
SO_TYPE
,
(
char
*
)
&
socktype
,
sizeof
(
socktype
));
ok
(
err
==
-
1
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
WSAEINVAL
,
"got error %u
\n
"
,
WSAGetLastError
());
closesocket
(
sock
);
sock
=
WSASocketA
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
,
&
pi
[
0
],
0
,
0
);
ok
(
sock
!=
INVALID_SOCKET
,
"Failed to create socket: %d
\n
"
,
WSAGetLastError
());
size
=
sizeof
(
socktype
);
socktype
=
0xdead
;
err
=
getsockopt
(
sock
,
SOL_SOCKET
,
SO_TYPE
,
(
char
*
)
&
socktype
,
&
size
);
ok
(
!
err
,
"getsockopt failed with %d
\n
"
,
WSAGetLastError
());
ok
(
socktype
==
SOCK_STREAM
,
"Wrong socket type, expected %d received %d
\n
"
,
SOCK_STREAM
,
socktype
);
socktype
=
SOCK_STREAM
;
WSASetLastError
(
0xdeadbeef
);
err
=
setsockopt
(
sock
,
SOL_SOCKET
,
SO_TYPE
,
(
char
*
)
&
socktype
,
sizeof
(
socktype
));
ok
(
err
==
-
1
,
"expected failure
\n
"
);
ok
(
WSAGetLastError
()
==
WSAENOPROTOOPT
,
"got error %u
\n
"
,
WSAGetLastError
());
socktype
=
SOCK_DGRAM
;
WSASetLastError
(
0xdeadbeef
);
err
=
setsockopt
(
sock
,
SOL_SOCKET
,
SO_TYPE
,
(
char
*
)
&
socktype
,
sizeof
(
socktype
));
ok
(
err
==
-
1
,
"expected failure
\n
"
);
ok
(
WSAGetLastError
()
==
WSAENOPROTOOPT
,
"got error %u
\n
"
,
WSAGetLastError
());
closesocket
(
sock
);
HeapFree
(
GetProcessHeap
(),
0
,
pi
);
...
...
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