libzmq
tests
test_reqrep_tipc.cpp
Go to the documentation of this file.
1
/* SPDX-License-Identifier: MPL-2.0 */
2
3
#include "
testutil.hpp
"
4
#include "
testutil_unity.hpp
"
5
6
SETUP_TEARDOWN_TESTCONTEXT
7
8
void
test_roundtrip
()
9
{
10
void
*
sb
=
test_context_socket
(
ZMQ_REP
);
11
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_bind
(
sb
,
"tipc://{5560,0,0}"
));
12
13
void
*
sc
=
test_context_socket
(
ZMQ_REQ
);
14
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_connect
(
sc
,
"tipc://{5560,0}@0.0.0"
));
15
16
bounce
(
sb
,
sc
);
17
18
test_context_socket_close
(
sc
);
19
test_context_socket_close
(
sb
);
20
}
21
22
int
main
(
void
)
23
{
24
if
(!
is_tipc_available
()) {
25
printf (
"TIPC environment unavailable, skipping test\n"
);
26
return
77;
27
}
28
29
UNITY_BEGIN
();
30
RUN_TEST
(
test_roundtrip
);
31
32
return
UNITY_END
();
33
}
bounce
static void bounce(void *socket_)
Definition:
test_req_relaxed.cpp:50
UNITY_END
return UNITY_END()
test_roundtrip
SETUP_TEARDOWN_TESTCONTEXT void test_roundtrip()
Definition:
test_reqrep_tipc.cpp:8
RUN_TEST
#define RUN_TEST(func)
Definition:
unity_internals.h:615
main
int main(void)
Definition:
test_reqrep_tipc.cpp:22
SETUP_TEARDOWN_TESTCONTEXT
#define SETUP_TEARDOWN_TESTCONTEXT
Definition:
testutil_unity.hpp:172
ZMQ_REQ
#define ZMQ_REQ
Definition:
zmq.h:261
zmq_connect
ZMQ_EXPORT int zmq_connect(void *s_, const char *addr_)
Definition:
zmq.cpp:307
testutil_unity.hpp
sb
void * sb
Definition:
test_channel.cpp:8
testutil.hpp
ZMQ_REP
#define ZMQ_REP
Definition:
zmq.h:262
zmq_bind
ZMQ_EXPORT int zmq_bind(void *s_, const char *addr_)
Definition:
zmq.cpp:299
sc
void * sc
Definition:
test_channel.cpp:9
is_tipc_available
int is_tipc_available()
Definition:
testutil.cpp:283
test_context_socket
void * test_context_socket(int type_)
Definition:
testutil_unity.cpp:200
UNITY_BEGIN
UNITY_BEGIN()
test_context_socket_close
void * test_context_socket_close(void *socket_)
Definition:
testutil_unity.cpp:208
TEST_ASSERT_SUCCESS_ERRNO
#define TEST_ASSERT_SUCCESS_ERRNO(expr)
Definition:
proxy_thr.cpp:47
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:59