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
3cf5eb6d
Commit
3cf5eb6d
authored
May 03, 2009
by
Austin English
Committed by
Alexandre Julliard
May 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add initial tests for WSAStartup.
parent
efa55559
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
sock.c
dlls/ws2_32/tests/sock.c
+37
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
3cf5eb6d
...
...
@@ -836,6 +836,37 @@ out:
client_stop
();
}
/* Tests for WSAStartup */
/* This should fail. WSAStartup should be called before any network function is used. */
static
void
test_WithoutWSAStartup
(
void
)
{
LPVOID
ptr
;
WSASetLastError
(
0xdeadbeef
);
ptr
=
gethostbyname
(
"localhost"
);
todo_wine
ok
(
ptr
==
NULL
,
"gethostbyname() succeeded unexpectedly: %d
\n
"
,
WSAGetLastError
());
todo_wine
ok
(
WSAGetLastError
()
==
WSANOTINITIALISED
,
"gethostbyname() failed with unexpected error: %d
\n
"
,
WSAGetLastError
());
}
static
void
test_WithWSAStartup
(
void
)
{
WSADATA
data
;
WORD
version
=
MAKEWORD
(
2
,
2
);
INT
res
;
LPVOID
ptr
;
res
=
WSAStartup
(
version
,
&
data
);
ok
(
res
==
0
,
"WSAStartup() failed unexpectedly: %d
\n
"
,
res
);
ptr
=
gethostbyname
(
"localhost"
);
ok
(
ptr
!=
NULL
,
"gethostbyname() failed unexpectedly: %d
\n
"
,
WSAGetLastError
());
WSACleanup
();
}
/**************** Main program utility functions ***************/
static
void
Init
(
void
)
...
...
@@ -2513,6 +2544,12 @@ static void test_GetAddrInfoW(void)
START_TEST
(
sock
)
{
int
i
;
/* Leave these tests at the beginning. They depend on WSAStartup not having been
* called, which is done by Init() below. */
test_WithoutWSAStartup
();
test_WithWSAStartup
();
Init
();
test_set_getsockopt
();
...
...
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