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
8c928934
Commit
8c928934
authored
Jan 31, 2013
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed use of deprecated zmq_init/term
parent
5f009e52
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
56 additions
and
41 deletions
+56
-41
test_connect_resolve.cpp
tests/test_connect_resolve.cpp
+2
-2
test_hwm.cpp
tests/test_hwm.cpp
+2
-2
test_invalid_rep.cpp
tests/test_invalid_rep.cpp
+5
-2
test_last_endpoint.cpp
tests/test_last_endpoint.cpp
+10
-1
test_monitor.cpp
tests/test_monitor.cpp
+2
-2
test_msg_flags.cpp
tests/test_msg_flags.cpp
+8
-2
test_pair_inproc.cpp
tests/test_pair_inproc.cpp
+2
-2
test_pair_ipc.cpp
tests/test_pair_ipc.cpp
+2
-2
test_pair_tcp.cpp
tests/test_pair_tcp.cpp
+2
-2
test_raw_sock.cpp
tests/test_raw_sock.cpp
+0
-1
test_reqrep_device.cpp
tests/test_reqrep_device.cpp
+2
-2
test_reqrep_inproc.cpp
tests/test_reqrep_inproc.cpp
+2
-2
test_reqrep_ipc.cpp
tests/test_reqrep_ipc.cpp
+2
-2
test_reqrep_tcp.cpp
tests/test_reqrep_tcp.cpp
+2
-2
test_router_mandatory.cpp
tests/test_router_mandatory.cpp
+2
-2
test_shutdown_stress.cpp
tests/test_shutdown_stress.cpp
+3
-3
test_sub_forward.cpp
tests/test_sub_forward.cpp
+2
-2
test_term_endpoint.cpp
tests/test_term_endpoint.cpp
+4
-6
test_timeo.cpp
tests/test_timeo.cpp
+2
-2
No files found.
tests/test_connect_resolve.cpp
View file @
8c928934
...
...
@@ -29,7 +29,7 @@ int main (void)
{
fprintf
(
stderr
,
"test_connect_resolve running...
\n
"
);
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
// Create pair of socket, each with high watermark of 2. Thus the total
...
...
@@ -47,7 +47,7 @@ int main (void)
rc
=
zmq_close
(
sock
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_hwm.cpp
View file @
8c928934
...
...
@@ -26,7 +26,7 @@ int main (void)
{
fprintf
(
stderr
,
"test_hwm running...
\n
"
);
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
// Create pair of socket, each with high watermark of 2. Thus the total
...
...
@@ -76,7 +76,7 @@ int main (void)
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_invalid_rep.cpp
View file @
8c928934
...
...
@@ -30,12 +30,15 @@ int main (void)
fprintf
(
stderr
,
"test_invalid_rep running...
\n
"
);
// Create REQ/ROUTER wiring.
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
void
*
router_socket
=
zmq_socket
(
ctx
,
ZMQ_ROUTER
);
assert
(
router_socket
);
void
*
req_socket
=
zmq_socket
(
ctx
,
ZMQ_REQ
);
assert
(
req_socket
);
int
linger
=
0
;
int
rc
=
zmq_setsockopt
(
router_socket
,
ZMQ_LINGER
,
&
linger
,
sizeof
(
int
));
assert
(
rc
==
0
);
...
...
@@ -84,7 +87,7 @@ int main (void)
assert
(
rc
==
0
);
rc
=
zmq_close
(
req_socket
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_last_endpoint.cpp
View file @
8c928934
...
...
@@ -38,16 +38,25 @@ static void do_bind_and_verify (void *s, const char *endpoint)
int
main
(
void
)
{
// Create the infrastructure
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
void
*
sb
=
zmq_socket
(
ctx
,
ZMQ_ROUTER
);
assert
(
sb
);
int
val
=
0
;
int
rc
=
zmq_setsockopt
(
sb
,
ZMQ_LINGER
,
&
val
,
sizeof
(
val
));
assert
(
rc
==
0
);
do_bind_and_verify
(
sb
,
"tcp://127.0.0.1:5560"
);
do_bind_and_verify
(
sb
,
"tcp://127.0.0.1:5561"
);
do_bind_and_verify
(
sb
,
"ipc:///tmp/testep"
);
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_ctx_term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
}
tests/test_monitor.cpp
View file @
8c928934
...
...
@@ -192,7 +192,7 @@ int main (void)
addr
=
"tcp://127.0.0.1:5560"
;
// Create the infrastructure
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
// REP socket
...
...
@@ -266,7 +266,7 @@ int main (void)
// Allow for closed or disconnected events to bubble up
zmq_sleep
(
1
);
zmq_term
(
ctx
);
zmq_
ctx_
term
(
ctx
);
// Expected REP socket events
assert
(
rep_socket_events
&
ZMQ_EVENT_LISTENING
);
...
...
tests/test_msg_flags.cpp
View file @
8c928934
...
...
@@ -28,14 +28,18 @@
int
main
(
void
)
{
// Create the infrastructure
void
*
ctx
=
zmq_
init
(
0
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
void
*
sb
=
zmq_socket
(
ctx
,
ZMQ_ROUTER
);
assert
(
sb
);
int
rc
=
zmq_bind
(
sb
,
"inproc://a"
);
assert
(
rc
==
0
);
void
*
sc
=
zmq_socket
(
ctx
,
ZMQ_DEALER
);
assert
(
sc
);
rc
=
zmq_connect
(
sc
,
"inproc://a"
);
assert
(
rc
==
0
);
...
...
@@ -69,9 +73,11 @@ int main (void)
// Deallocate the infrastructure.
rc
=
zmq_close
(
sc
);
assert
(
rc
==
0
);
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_ctx_term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
}
...
...
tests/test_pair_inproc.cpp
View file @
8c928934
...
...
@@ -25,7 +25,7 @@ int main (void)
{
fprintf
(
stderr
,
"test_pair_inproc running...
\n
"
);
void
*
ctx
=
zmq_
init
(
0
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
void
*
sb
=
zmq_socket
(
ctx
,
ZMQ_PAIR
);
...
...
@@ -46,7 +46,7 @@ int main (void)
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_pair_ipc.cpp
View file @
8c928934
...
...
@@ -25,7 +25,7 @@ int main (void)
{
fprintf
(
stderr
,
"test_pair_ipc running...
\n
"
);
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
void
*
sb
=
zmq_socket
(
ctx
,
ZMQ_PAIR
);
...
...
@@ -46,7 +46,7 @@ int main (void)
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_pair_tcp.cpp
View file @
8c928934
...
...
@@ -26,7 +26,7 @@ int main (void)
{
fprintf
(
stderr
,
"test_pair_tcp running...
\n
"
);
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
void
*
sb
=
zmq_socket
(
ctx
,
ZMQ_PAIR
);
...
...
@@ -47,7 +47,7 @@ int main (void)
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_raw_sock.cpp
View file @
8c928934
/*
Copyright (c) 2007-2012 iMatix Corporation
Copyright (c) 2011 250bpm s.r.o.
Copyright (c) 2007-2012 Other contributors as noted in the AUTHORS file
This file is part of 0MQ.
...
...
tests/test_reqrep_device.cpp
View file @
8c928934
...
...
@@ -30,7 +30,7 @@ int main (void)
{
fprintf
(
stderr
,
"test_reqrep_device running...
\n
"
);
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
// Create a req/rep device.
...
...
@@ -136,7 +136,7 @@ int main (void)
assert
(
rc
==
0
);
rc
=
zmq_close
(
dealer
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_reqrep_inproc.cpp
View file @
8c928934
...
...
@@ -25,7 +25,7 @@ int main (void)
{
fprintf
(
stderr
,
"test_reqrep_inproc running...
\n
"
);
void
*
ctx
=
zmq_
init
(
0
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
void
*
sb
=
zmq_socket
(
ctx
,
ZMQ_REP
);
...
...
@@ -46,7 +46,7 @@ int main (void)
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_reqrep_ipc.cpp
View file @
8c928934
...
...
@@ -25,7 +25,7 @@ int main (void)
{
fprintf
(
stderr
,
"test_reqrep_ipc running...
\n
"
);
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
void
*
sb
=
zmq_socket
(
ctx
,
ZMQ_REP
);
...
...
@@ -46,7 +46,7 @@ int main (void)
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_reqrep_tcp.cpp
View file @
8c928934
...
...
@@ -26,7 +26,7 @@ int main (void)
{
fprintf
(
stderr
,
"test_reqrep_tcp running...
\n
"
);
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
void
*
sb
=
zmq_socket
(
ctx
,
ZMQ_REP
);
...
...
@@ -47,7 +47,7 @@ int main (void)
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_router_mandatory.cpp
View file @
8c928934
...
...
@@ -27,7 +27,7 @@ int main (void)
{
fprintf
(
stderr
,
"test_router_mandatory running...
\n
"
);
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
// Creating the first socket.
...
...
@@ -98,7 +98,7 @@ int main (void)
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_shutdown_stress.cpp
View file @
8c928934
...
...
@@ -48,7 +48,6 @@ extern "C"
int
main
(
void
)
{
void
*
ctx
;
void
*
s1
;
void
*
s2
;
int
i
;
...
...
@@ -61,8 +60,9 @@ int main (void)
for
(
j
=
0
;
j
!=
10
;
j
++
)
{
// Check the shutdown with many parallel I/O threads.
ctx
=
zmq_init
(
7
);
void
*
ctx
=
zmq_ctx_new
(
);
assert
(
ctx
);
zmq_ctx_set
(
ctx
,
ZMQ_IO_THREADS
,
7
);
s1
=
zmq_socket
(
ctx
,
ZMQ_PUB
);
assert
(
s1
);
...
...
@@ -85,7 +85,7 @@ int main (void)
rc
=
zmq_close
(
s1
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
}
...
...
tests/test_sub_forward.cpp
View file @
8c928934
...
...
@@ -30,7 +30,7 @@ int main (void)
{
fprintf
(
stderr
,
"test_sub_forward running...
\n
"
);
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
// First, create an intermediate device.
...
...
@@ -92,7 +92,7 @@ int main (void)
assert
(
rc
==
0
);
rc
=
zmq_close
(
sub
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_term_endpoint.cpp
View file @
8c928934
...
...
@@ -36,7 +36,7 @@ int main (void)
fprintf
(
stderr
,
"unbind endpoint test running...
\n
"
);
// Create infrastructure.
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
void
*
push
=
zmq_socket
(
ctx
,
ZMQ_PUSH
);
assert
(
push
);
...
...
@@ -69,16 +69,14 @@ int main (void)
assert
(
rc
==
0
);
rc
=
zmq_close
(
push
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
// Now the other way round.
fprintf
(
stderr
,
"disconnect endpoint test running...
\n
"
);
// Create infrastructure.
ctx
=
zmq_
init
(
1
);
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
push
=
zmq_socket
(
ctx
,
ZMQ_PUSH
);
assert
(
push
);
...
...
@@ -111,7 +109,7 @@ int main (void)
assert
(
rc
==
0
);
rc
=
zmq_close
(
push
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_timeo.cpp
View file @
8c928934
...
...
@@ -49,7 +49,7 @@ int main (void)
{
fprintf
(
stderr
,
"test_timeo running...
\n
"
);
void
*
ctx
=
zmq_
init
(
1
);
void
*
ctx
=
zmq_
ctx_new
(
);
assert
(
ctx
);
// Create a disconnected socket.
...
...
@@ -111,7 +111,7 @@ int main (void)
assert
(
rc
==
0
);
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
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