test_last_endpoint.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 
8 static void do_bind_and_verify (void *s_, const char *endpoint_)
9 {
10  TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (s_, endpoint_));
11  char reported[255];
12  size_t size = 255;
14  zmq_getsockopt (s_, ZMQ_LAST_ENDPOINT, reported, &size));
15  TEST_ASSERT_EQUAL_STRING (endpoint_, reported);
16 }
17 
19 {
21  int val = 0;
23  zmq_setsockopt (sb, ZMQ_LINGER, &val, sizeof (val)));
24 
27 
29 }
30 
31 int main (void)
32 {
34 
35  UNITY_BEGIN ();
37  return UNITY_END ();
38 }
TEST_ASSERT_EQUAL_STRING
#define TEST_ASSERT_EQUAL_STRING(expected, actual)
Definition: unity.h:235
UNITY_END
return UNITY_END()
RUN_TEST
#define RUN_TEST(func)
Definition: unity_internals.h:615
ZMQ_LAST_ENDPOINT
#define ZMQ_LAST_ENDPOINT
Definition: zmq.h:298
SETUP_TEARDOWN_TESTCONTEXT
#define SETUP_TEARDOWN_TESTCONTEXT
Definition: testutil_unity.hpp:172
test_last_endpoint
void test_last_endpoint()
Definition: test_last_endpoint.cpp:18
testutil_unity.hpp
zmq_setsockopt
ZMQ_EXPORT int zmq_setsockopt(void *s_, int option_, const void *optval_, size_t optvallen_)
Definition: zmq.cpp:250
sb
void * sb
Definition: test_channel.cpp:8
testutil.hpp
ZMQ_ROUTER
#define ZMQ_ROUTER
Definition: zmq.h:264
s_
std::string s_
Definition: gmock-matchers_test.cc:4128
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
main
int main(void)
Definition: test_last_endpoint.cpp:31
ZMQ_LINGER
#define ZMQ_LINGER
Definition: zmq.h:288
do_bind_and_verify
static SETUP_TEARDOWN_TESTCONTEXT void do_bind_and_verify(void *s_, const char *endpoint_)
Definition: test_last_endpoint.cpp:8
size
GLsizeiptr size
Definition: glcorearb.h:2943
setup_test_environment
void setup_test_environment(int timeout_seconds_)
Definition: testutil.cpp:201
UNITY_BEGIN
UNITY_BEGIN()
ENDPOINT_1
#define ENDPOINT_1
Definition: libzmq/tests/testutil.hpp:40
val
GLuint GLfloat * val
Definition: glcorearb.h:3604
test_context_socket_close
void * test_context_socket_close(void *socket_)
Definition: testutil_unity.cpp:208
ENDPOINT_2
#define ENDPOINT_2
Definition: libzmq/tests/testutil.hpp:41
TEST_ASSERT_SUCCESS_ERRNO
#define TEST_ASSERT_SUCCESS_ERRNO(expr)
Definition: proxy_thr.cpp:47
zmq_getsockopt
ZMQ_EXPORT int zmq_getsockopt(void *s_, int option_, void *optval_, size_t *optvallen_)
Definition: zmq.cpp:261


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:59