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
4edad545
Commit
4edad545
authored
Sep 06, 2013
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #648 from ricnewton/master
Fix tests on windows
parents
498dc379
a601b3f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
test_security_curve.cpp
tests/test_security_curve.cpp
+1
-1
test_system.cpp
tests/test_system.cpp
+32
-0
No files found.
tests/test_security_curve.cpp
View file @
4edad545
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#include "testutil.hpp"
#include "testutil.hpp"
#include "../include/zmq_utils.h"
#include "../include/zmq_utils.h"
#include "../src/z85_codec.hpp"
#include "../src/z85_codec.hpp"
#include "
../src/
platform.hpp"
#include "platform.hpp"
// Test keys from the zmq_curve man page
// Test keys from the zmq_curve man page
static
char
client_public
[]
=
"Yne@$w-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID"
;
static
char
client_public
[]
=
"Yne@$w-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID"
;
...
...
tests/test_system.cpp
View file @
4edad545
...
@@ -18,10 +18,40 @@
...
@@ -18,10 +18,40 @@
*/
*/
#include "../include/zmq.h"
#include "../include/zmq.h"
#include "platform.hpp"
#if defined (ZMQ_HAVE_WINDOWS)
#include <WinSock2.h>
#include <stdexcept>
#else
#include <sys/socket.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/in.h>
#include <unistd.h>
#include <unistd.h>
#include <assert.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
// This test case stresses the system to shake out known configuration
// problems. We're not using libzmq here but direct system calls. Note
// problems. We're not using libzmq here but direct system calls. Note
...
@@ -29,6 +59,8 @@
...
@@ -29,6 +59,8 @@
int
main
(
void
)
int
main
(
void
)
{
{
initialise_network
();
// Check that we can create 1,000 sockets
// Check that we can create 1,000 sockets
int
handle
[
1000
];
int
handle
[
1000
];
int
count
;
int
count
;
...
...
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