Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
7485b09c
Commit
7485b09c
authored
Sep 06, 2013
by
Richard Newton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests on windows
parent
498dc379
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
test_security_curve.cpp
tests/test_security_curve.cpp
+1
-1
test_system.cpp
tests/test_system.cpp
+33
-0
No files found.
tests/test_security_curve.cpp
View file @
7485b09c
...
...
@@ -22,7 +22,7 @@
#include "testutil.hpp"
#include "../include/zmq_utils.h"
#include "../src/z85_codec.hpp"
#include "
../src/
platform.hpp"
#include "platform.hpp"
// Test keys from the zmq_curve man page
static
char
client_public
[]
=
"Yne@$w-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID"
;
...
...
tests/test_system.cpp
View file @
7485b09c
...
...
@@ -18,10 +18,40 @@
*/
#include "../include/zmq.h"
#include "platform.hpp"
#if defined (ZMQ_HAVE_WINDOWS)
#include <WinSock2.h>
#include <stdexcept>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <assert.h>
#endif
#if defined (ZMQ_HAVE_WINDOWS)
void
initialise_network
()
{
WSADATA
info
;
if
(
WSAStartup
(
MAKEWORD
(
2
,
0
),
&
info
)
!=
0
)
{
throw
std
::
runtime_error
(
"Could not start WSA"
);
}
}
int
close
(
int
fd
)
{
return
closesocket
(
fd
);
}
#else
void
initialise_network
()
{
}
#endif
// This test case stresses the system to shake out known configuration
// problems. We're not using libzmq here but direct system calls. Note
...
...
@@ -29,12 +59,15 @@
int
main
(
void
)
{
initialise_network
();
// Check that we can create 1,000 sockets
int
handle
[
1000
];
int
count
;
for
(
count
=
0
;
count
<
1000
;
count
++
)
{
handle
[
count
]
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
if
(
handle
[
count
]
==
-
1
)
{
int
err
=
::
WSAGetLastError
();
printf
(
"W: Only able to create %d sockets on this box
\n
"
,
count
);
printf
(
"I: Tune your system to increase maximum allowed file handles
\n
"
);
#if defined (ZMQ_HAVE_OSX)
...
...
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