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
386de330
Commit
386de330
authored
Mar 24, 2019
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: code from bind_loopback_tipc is duplicated
Solution: call bind_loopback_tipc where applicable
parent
0e0bead3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
test_address_tipc.cpp
tests/test_address_tipc.cpp
+6
-9
No files found.
tests/test_address_tipc.cpp
View file @
386de330
...
...
@@ -28,6 +28,8 @@
*/
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
...
...
@@ -68,7 +70,6 @@ void test_tipc_port_name_and_domain ()
void
test_tipc_port_identity
()
{
char
endpoint
[
256
];
size_t
size
=
256
;
unsigned
int
z
,
c
,
n
,
ref
;
void
*
ctx
=
zmq_ctx_new
();
...
...
@@ -80,15 +81,11 @@ void test_tipc_port_identity ()
void
*
sc
=
zmq_socket
(
ctx
,
ZMQ_REQ
);
TEST_ASSERT_NOT_NULL
(
sc
);
// Test binding to random Port Identity
int
rc
=
zmq_bind
(
sb
,
"tipc://<*>"
);
TEST_ASSERT_EQUAL_INT
(
0
,
rc
);
// Test resolving assigned address, should return a properly formatted string
rc
=
zmq_getsockopt
(
sb
,
ZMQ_LAST_ENDPOINT
,
&
endpoint
[
0
],
&
size
);
TEST_ASSERT_EQUAL_INT
(
0
,
rc
);
// Test binding to random Port Identity and
// test resolving assigned address, should return a properly formatted string
bind_loopback_tipc
(
sb
,
endpoint
,
sizeof
endpoint
);
rc
=
sscanf
(
&
endpoint
[
0
],
"tipc://<%u.%u.%u:%u>"
,
&
z
,
&
c
,
&
n
,
&
ref
);
int
rc
=
sscanf
(
&
endpoint
[
0
],
"tipc://<%u.%u.%u:%u>"
,
&
z
,
&
c
,
&
n
,
&
ref
);
TEST_ASSERT_EQUAL_INT
(
4
,
rc
);
TEST_ASSERT_NOT_EQUAL_MESSAGE
(
...
...
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