test_busy_poll.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 
7 
9 {
10  // Create a socket
11  void *socket = test_context_socket (ZMQ_DEALER);
12 
13  // set socket ZMQ_BUSY_POLL options
14  int busy_poll = 1;
16  zmq_setsockopt (socket, ZMQ_BUSY_POLL, &busy_poll, sizeof (int)));
17 
18  // bind socket
19  TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (socket, "tcp://127.0.0.1:*"));
20 
21  // Clean up.
23 }
24 
25 int main ()
26 {
28  UNITY_BEGIN ();
30  return UNITY_END ();
31 }
test_busy_poll
SETUP_TEARDOWN_TESTCONTEXT void test_busy_poll()
Definition: test_busy_poll.cpp:8
UNITY_END
return UNITY_END()
RUN_TEST
#define RUN_TEST(func)
Definition: unity_internals.h:615
SETUP_TEARDOWN_TESTCONTEXT
#define SETUP_TEARDOWN_TESTCONTEXT
Definition: testutil_unity.hpp:172
main
int main()
Definition: test_busy_poll.cpp:25
testutil_unity.hpp
ZMQ_DEALER
#define ZMQ_DEALER
Definition: zmq.h:263
zmq_setsockopt
ZMQ_EXPORT int zmq_setsockopt(void *s_, int option_, const void *optval_, size_t optvallen_)
Definition: zmq.cpp:250
testutil.hpp
zmq_bind
ZMQ_EXPORT int zmq_bind(void *s_, const char *addr_)
Definition: zmq.cpp:299
test_context_socket
void * test_context_socket(int type_)
Definition: testutil_unity.cpp:200
ZMQ_BUSY_POLL
#define ZMQ_BUSY_POLL
Definition: zmq_draft.h:45
setup_test_environment
void setup_test_environment(int timeout_seconds_)
Definition: testutil.cpp:201
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