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
be66eacf
Commit
be66eacf
authored
May 13, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: test_heartbeats still using plain assertions
Solution: migrate to unity assertions
parent
b331caad
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
test_heartbeats.cpp
tests/test_heartbeats.cpp
+0
-0
testutil_unity.hpp
tests/testutil_unity.hpp
+25
-0
No files found.
tests/test_heartbeats.cpp
View file @
be66eacf
This diff is collapsed.
Click to expand it.
tests/testutil_unity.hpp
View file @
be66eacf
...
...
@@ -57,12 +57,37 @@ int test_assert_success_message_errno_helper (int rc,
return
rc
;
}
int
test_assert_success_message_raw_errno_helper
(
int
rc
,
const
char
*
msg
,
const
char
*
expr
)
{
if
(
rc
==
-
1
)
{
#if defined ZMQ_HAVE_WINDOWS
int
current_errno
=
WSAGetLastError
();
#else
int
current_errno
=
errno
;
#endif
char
buffer
[
512
];
buffer
[
sizeof
(
buffer
)
-
1
]
=
0
;
// to ensure defined behavior with VC++ <= 2013
snprintf
(
buffer
,
sizeof
(
buffer
)
-
1
,
"%s failed%s%s%s, errno = %i"
,
expr
,
msg
?
" (additional info: "
:
""
,
msg
?
msg
:
""
,
msg
?
")"
:
""
,
current_errno
);
TEST_FAIL_MESSAGE
(
buffer
);
}
return
rc
;
}
#define TEST_ASSERT_SUCCESS_MESSAGE_ERRNO(expr, msg) \
test_assert_success_message_errno_helper (expr, msg, #expr)
#define TEST_ASSERT_SUCCESS_ERRNO(expr) \
test_assert_success_message_errno_helper (expr, NULL, #expr)
#define TEST_ASSERT_SUCCESS_RAW_ERRNO(expr) \
test_assert_success_message_raw_errno_helper (expr, NULL, #expr)
#define TEST_ASSERT_FAILURE_ERRNO(error_code, expr) \
{ \
int rc = (expr); \
...
...
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