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
b30cbfc1
Commit
b30cbfc1
authored
6 years ago
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: test_spec_dealer not using test framework
Solution: migrate to Unity
parent
d81a041f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
5 deletions
+23
-5
Makefile.am
Makefile.am
+2
-1
test_spec_dealer.cpp
tests/test_spec_dealer.cpp
+0
-0
testutil_unity.hpp
tests/testutil_unity.hpp
+21
-4
No files found.
Makefile.am
View file @
b30cbfc1
...
@@ -572,7 +572,8 @@ tests_test_spec_rep_SOURCES = tests/test_spec_rep.cpp
...
@@ -572,7 +572,8 @@ tests_test_spec_rep_SOURCES = tests/test_spec_rep.cpp
tests_test_spec_rep_LDADD
=
src/libzmq.la
tests_test_spec_rep_LDADD
=
src/libzmq.la
tests_test_spec_dealer_SOURCES
=
tests/test_spec_dealer.cpp
tests_test_spec_dealer_SOURCES
=
tests/test_spec_dealer.cpp
tests_test_spec_dealer_LDADD
=
src/libzmq.la
tests_test_spec_dealer_LDADD
=
src/libzmq.la
${
UNITY_LIBS
}
tests_test_spec_dealer_CPPFLAGS
=
${
UNITY_CPPFLAGS
}
tests_test_spec_router_SOURCES
=
tests/test_spec_router.cpp
tests_test_spec_router_SOURCES
=
tests/test_spec_router.cpp
tests_test_spec_router_LDADD
=
src/libzmq.la
tests_test_spec_router_LDADD
=
src/libzmq.la
...
...
This diff is collapsed.
Click to expand it.
tests/test_spec_dealer.cpp
View file @
b30cbfc1
This diff is collapsed.
Click to expand it.
tests/testutil_unity.hpp
View file @
b30cbfc1
...
@@ -217,6 +217,24 @@ void *test_context_socket_close (void *socket)
...
@@ -217,6 +217,24 @@ void *test_context_socket_close (void *socket)
return
socket
;
return
socket
;
}
}
void
*
test_context_socket_close_zero_linger
(
void
*
socket
)
{
const
int
linger
=
0
;
int
rc
=
zmq_setsockopt
(
socket
,
ZMQ_LINGER
,
&
linger
,
sizeof
(
linger
));
TEST_ASSERT_TRUE
(
rc
==
0
||
zmq_errno
()
==
ETERM
);
return
test_context_socket_close
(
socket
);
}
void
test_bind
(
void
*
socket
,
const
char
*
bind_address
,
char
*
my_endpoint
,
size_t
len
)
{
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_bind
(
socket
,
bind_address
));
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_getsockopt
(
socket
,
ZMQ_LAST_ENDPOINT
,
my_endpoint
,
&
len
));
}
void
bind_loopback
(
void
*
socket
,
int
ipv6
,
char
*
my_endpoint
,
size_t
len
)
void
bind_loopback
(
void
*
socket
,
int
ipv6
,
char
*
my_endpoint
,
size_t
len
)
{
{
if
(
ipv6
&&
!
is_ipv6_available
())
{
if
(
ipv6
&&
!
is_ipv6_available
())
{
...
@@ -225,10 +243,9 @@ void bind_loopback (void *socket, int ipv6, char *my_endpoint, size_t len)
...
@@ -225,10 +243,9 @@ void bind_loopback (void *socket, int ipv6, char *my_endpoint, size_t len)
TEST_ASSERT_SUCCESS_ERRNO
(
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_setsockopt
(
socket
,
ZMQ_IPV6
,
&
ipv6
,
sizeof
(
int
)));
zmq_setsockopt
(
socket
,
ZMQ_IPV6
,
&
ipv6
,
sizeof
(
int
)));
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_bind
(
socket
,
ipv6
?
"tcp://[::1]:*"
:
"tcp://127.0.0.1:*"
));
test_bind
(
socket
,
ipv6
?
"tcp://[::1]:*"
:
"tcp://127.0.0.1:*"
,
TEST_ASSERT_SUCCESS_ERRNO
(
my_endpoint
,
len
);
zmq_getsockopt
(
socket
,
ZMQ_LAST_ENDPOINT
,
my_endpoint
,
&
len
));
}
}
void
bind_loopback_ipv4
(
void
*
socket
,
char
*
my_endpoint
,
size_t
len
)
void
bind_loopback_ipv4
(
void
*
socket
,
char
*
my_endpoint
,
size_t
len
)
...
...
This diff is collapsed.
Click to expand it.
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