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
dc2764f5
Commit
dc2764f5
authored
Mar 16, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: test_last_endpoint not using unity
Solution: migrate to unity
parent
1747cbdc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
16 deletions
+27
-16
Makefile.am
Makefile.am
+2
-1
test_last_endpoint.cpp
tests/test_last_endpoint.cpp
+25
-15
No files found.
Makefile.am
View file @
dc2764f5
...
...
@@ -493,7 +493,8 @@ tests_test_immediate_LDADD = src/libzmq.la ${UNITY_LIBS}
tests_test_immediate_CPPFLAGS
=
${
UNITY_CPPFLAGS
}
tests_test_last_endpoint_SOURCES
=
tests/test_last_endpoint.cpp
tests_test_last_endpoint_LDADD
=
src/libzmq.la
tests_test_last_endpoint_LDADD
=
src/libzmq.la
${
UNITY_LIBS
}
tests_test_last_endpoint_CPPFLAGS
=
${
UNITY_CPPFLAGS
}
tests_test_term_endpoint_SOURCES
=
tests/test_term_endpoint.cpp
tests_test_term_endpoint_LDADD
=
src/libzmq.la
...
...
tests/test_last_endpoint.cpp
View file @
dc2764f5
...
...
@@ -28,6 +28,19 @@
*/
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void
setUp
()
{
setup_test_context
();
}
void
tearDown
()
{
teardown_test_context
();
}
static
void
do_bind_and_verify
(
void
*
s
,
const
char
*
endpoint
)
{
...
...
@@ -39,27 +52,24 @@ static void do_bind_and_verify (void *s, const char *endpoint)
assert
(
rc
==
0
&&
strcmp
(
reported
,
endpoint
)
==
0
);
}
int
main
(
void
)
void
test_last_endpoint
(
)
{
setup_test_environment
();
// Create the infrastructure
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
void
*
sb
=
zmq_socket
(
ctx
,
ZMQ_ROUTER
);
assert
(
sb
);
void
*
sb
=
test_context_socket
(
ZMQ_ROUTER
);
int
val
=
0
;
int
rc
=
zmq_setsockopt
(
sb
,
ZMQ_LINGER
,
&
val
,
sizeof
(
val
));
assert
(
rc
==
0
);
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_setsockopt
(
sb
,
ZMQ_LINGER
,
&
val
,
sizeof
(
val
))
);
do_bind_and_verify
(
sb
,
ENDPOINT_1
);
do_bind_and_verify
(
sb
,
ENDPOINT_2
);
rc
=
zmq
_close
(
sb
);
assert
(
rc
==
0
);
test_context_socket
_close
(
sb
);
}
rc
=
zmq_ctx_term
(
ctx
);
assert
(
rc
==
0
);
int
main
(
void
)
{
setup_test_environment
();
return
0
;
UNITY_BEGIN
();
RUN_TEST
(
test_last_endpoint
);
return
UNITY_END
();
}
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