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
713f075f
Commit
713f075f
authored
Aug 20, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: test_xpub_manual not yet using unity
Solution: migrate to unity
parent
407bd3b1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
Makefile.am
Makefile.am
+2
-1
test_xpub_manual.cpp
tests/test_xpub_manual.cpp
+0
-0
testutil_unity.hpp
tests/testutil_unity.hpp
+26
-0
No files found.
Makefile.am
View file @
713f075f
...
...
@@ -657,7 +657,8 @@ tests_test_xpub_nodrop_LDADD = src/libzmq.la ${UNITY_LIBS}
tests_test_xpub_nodrop_CPPFLAGS
=
${
UNITY_CPPFLAGS
}
tests_test_xpub_manual_SOURCES
=
tests/test_xpub_manual.cpp
tests_test_xpub_manual_LDADD
=
src/libzmq.la
tests_test_xpub_manual_LDADD
=
src/libzmq.la
${
UNITY_LIBS
}
tests_test_xpub_manual_CPPFLAGS
=
${
UNITY_CPPFLAGS
}
tests_test_xpub_welcome_msg_SOURCES
=
tests/test_xpub_welcome_msg.cpp
tests_test_xpub_welcome_msg_LDADD
=
src/libzmq.la
...
...
tests/test_xpub_manual.cpp
View file @
713f075f
This diff is collapsed.
Click to expand it.
tests/testutil_unity.hpp
View file @
713f075f
...
...
@@ -118,6 +118,32 @@ void recv_string_expect_success (void *socket_, const char *str_, int flags_)
TEST_ASSERT_EQUAL_STRING_LEN
(
str_
,
buffer
,
len
);
}
template
<
size_t
SIZE
>
void
send_array_expect_success
(
void
*
socket_
,
const
uint8_t
(
&
array_
)[
SIZE
],
int
flags_
)
{
const
int
rc
=
zmq_send
(
socket_
,
array_
,
SIZE
,
flags_
);
TEST_ASSERT_EQUAL_INT
(
static_cast
<
int
>
(
SIZE
),
rc
);
}
template
<
size_t
SIZE
>
void
recv_array_expect_success
(
void
*
socket_
,
const
uint8_t
(
&
array_
)[
SIZE
],
int
flags_
)
{
char
buffer
[
255
];
TEST_ASSERT_LESS_OR_EQUAL_MESSAGE
(
sizeof
(
buffer
),
SIZE
,
"recv_string_expect_success cannot be "
"used for strings longer than 255 "
"characters"
);
const
int
rc
=
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_recv
(
socket_
,
buffer
,
sizeof
(
buffer
),
flags_
));
TEST_ASSERT_EQUAL_INT
(
static_cast
<
int
>
(
SIZE
),
rc
);
TEST_ASSERT_EQUAL_UINT8_ARRAY
(
array_
,
buffer
,
SIZE
);
}
// do not call from tests directly, use setup_test_context, get_test_context and teardown_test_context only
void
*
internal_manage_test_context
(
bool
init_
,
bool
clear_
)
{
...
...
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