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
3a56f9b9
Commit
3a56f9b9
authored
Dec 11, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add a test for inet_ntoa called from two threads.
parent
7fd3d9d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
sock.c
dlls/ws2_32/tests/sock.c
+47
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
3a56f9b9
...
...
@@ -7038,6 +7038,52 @@ static void test_completion_port(void)
CloseHandle
(
previous_port
);
}
static
DWORD
WINAPI
inet_ntoa_thread_proc
(
void
*
param
)
{
ULONG
addr
;
const
char
*
str
;
HANDLE
*
event
=
param
;
addr
=
inet_addr
(
"4.3.2.1"
);
ok
(
addr
==
htonl
(
0x04030201
),
"expected 0x04030201, got %08x
\n
"
,
addr
);
str
=
inet_ntoa
(
*
(
struct
in_addr
*
)
&
addr
);
ok
(
!
strcmp
(
str
,
"4.3.2.1"
),
"expected 4.3.2.1, got %s
\n
"
,
str
);
SetEvent
(
event
[
0
]);
WaitForSingleObject
(
event
[
1
],
3000
);
return
0
;
}
static
void
test_inet_ntoa
(
void
)
{
ULONG
addr
;
const
char
*
str
;
HANDLE
thread
,
event
[
2
];
DWORD
tid
;
addr
=
inet_addr
(
"1.2.3.4"
);
ok
(
addr
==
htonl
(
0x01020304
),
"expected 0x01020304, got %08x
\n
"
,
addr
);
str
=
inet_ntoa
(
*
(
struct
in_addr
*
)
&
addr
);
ok
(
!
strcmp
(
str
,
"1.2.3.4"
),
"expected 1.2.3.4, got %s
\n
"
,
str
);
event
[
0
]
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
event
[
1
]
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
thread
=
CreateThread
(
NULL
,
0
,
inet_ntoa_thread_proc
,
event
,
0
,
&
tid
);
WaitForSingleObject
(
event
[
0
],
3000
);
todo_wine
ok
(
!
strcmp
(
str
,
"1.2.3.4"
),
"expected 1.2.3.4, got %s
\n
"
,
str
);
SetEvent
(
event
[
1
]);
WaitForSingleObject
(
thread
,
3000
);
CloseHandle
(
event
[
0
]);
CloseHandle
(
event
[
1
]);
CloseHandle
(
thread
);
}
/**************** Main program ***************/
START_TEST
(
sock
)
...
...
@@ -7051,6 +7097,7 @@ START_TEST( sock )
Init
();
test_inet_ntoa
();
test_set_getsockopt
();
test_so_reuseaddr
();
test_ip_pktinfo
();
...
...
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