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
d47980a6
Commit
d47980a6
authored
Feb 20, 2015
by
Thomas Rodgers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow zmq_msg_gets checks to assert rather than segfault
parent
700f7bfe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
test_stream.cpp
tests/test_stream.cpp
+9
-3
No files found.
tests/test_stream.cpp
View file @
d47980a6
...
...
@@ -81,7 +81,9 @@ test_stream_to_dealer (void)
assert
(
zmq_msg_more
(
&
identity
));
// Verify the existence of Peer-Address metadata
assert
(
streq
(
zmq_msg_gets
(
&
identity
,
"Peer-Address"
),
"127.0.0.1"
));
char
const
*
peer_address
=
zmq_msg_gets
(
&
identity
,
"Peer-Address"
);
assert
(
peer_address
!=
0
);
assert
(
streq
(
peer_address
,
"127.0.0.1"
));
// Second frame is zero
byte
buffer
[
255
];
...
...
@@ -89,7 +91,9 @@ test_stream_to_dealer (void)
assert
(
rc
==
0
);
// Verify the existence of Peer-Address metadata
assert
(
streq
(
zmq_msg_gets
(
&
identity
,
"Peer-Address"
),
"127.0.0.1"
));
peer_address
=
zmq_msg_gets
(
&
identity
,
"Peer-Address"
);
assert
(
peer_address
!=
0
);
assert
(
streq
(
peer_address
,
"127.0.0.1"
));
// Real data follows
// First frame is identity
...
...
@@ -98,7 +102,9 @@ test_stream_to_dealer (void)
assert
(
zmq_msg_more
(
&
identity
));
// Verify the existence of Peer-Address metadata
assert
(
streq
(
zmq_msg_gets
(
&
identity
,
"Peer-Address"
),
"127.0.0.1"
));
peer_address
=
zmq_msg_gets
(
&
identity
,
"Peer-Address"
);
assert
(
peer_address
!=
0
);
assert
(
streq
(
peer_address
,
"127.0.0.1"
));
// Second frame is greeting signature
rc
=
zmq_recv
(
stream
,
buffer
,
255
,
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