test_disconnect_msg.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 void test (const char *address)
9 {
10  // Create a server
12 
13  // set server socket options
16 
17  // bind server
19 
20  // Create a client
24 
25  // Receive the hello message from client
27 
28  // Kill the client
30 
31  // Receive the disconnect message
33 
34  // Clean up.
36 }
37 
38 void test_tcp ()
39 {
40  test ("tcp://127.0.0.1:5569");
41 }
42 
43 void test_inproc ()
44 {
45  test ("inproc://disconnect-msg");
46 }
47 
48 
50 {
51  const char *address = "inproc://disconnect-msg";
52 
53  // Create a server
55 
56  // set server socket options
59 
60  // bind server
62 
63  // Create a client
67 
68  // Receive the hello message from client
70 
71  // disconnect the client
73 
74  // Receive the disconnect message
76 
77  // Clean up.
80 }
81 
82 int main ()
83 {
85 
86  UNITY_BEGIN ();
90  return UNITY_END ();
91 }
ZMQ_SERVER
#define ZMQ_SERVER
Definition: zmq_draft.h:14
UNITY_END
return UNITY_END()
ZMQ_CLIENT
#define ZMQ_CLIENT
Definition: zmq_draft.h:15
RUN_TEST
#define RUN_TEST(func)
Definition: unity_internals.h:615
main
int main()
Definition: test_disconnect_msg.cpp:82
SETUP_TEARDOWN_TESTCONTEXT
#define SETUP_TEARDOWN_TESTCONTEXT
Definition: testutil_unity.hpp:172
client
void client(int num)
Definition: test_multithread.cpp:134
address
const char * address
Definition: builds/zos/test_fork.cpp:6
zmq_connect
ZMQ_EXPORT int zmq_connect(void *s_, const char *addr_)
Definition: zmq.cpp:307
testutil_unity.hpp
zmq_setsockopt
ZMQ_EXPORT int zmq_setsockopt(void *s_, int option_, const void *optval_, size_t optvallen_)
Definition: zmq.cpp:250
zmq_disconnect
ZMQ_EXPORT int zmq_disconnect(void *s_, const char *addr_)
Definition: zmq.cpp:345
testutil.hpp
ZMQ_DISCONNECT_MSG
#define ZMQ_DISCONNECT_MSG
Definition: zmq_draft.h:43
ZMQ_HELLO_MSG
#define ZMQ_HELLO_MSG
Definition: zmq_draft.h:42
test_inproc
void test_inproc()
Definition: test_disconnect_msg.cpp:43
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
server
void * server
Definition: test_security_curve.cpp:29
test_inproc_disconnect
void test_inproc_disconnect()
Definition: test_disconnect_msg.cpp:49
recv_string_expect_success
void recv_string_expect_success(void *socket_, const char *str_, int flags_)
Definition: testutil_unity.cpp:101
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
SETUP_TEARDOWN_TESTCONTEXT void test(const char *address)
Definition: test_disconnect_msg.cpp:8
TEST_ASSERT_SUCCESS_ERRNO
#define TEST_ASSERT_SUCCESS_ERRNO(expr)
Definition: proxy_thr.cpp:47
test_tcp
void test_tcp()
Definition: test_disconnect_msg.cpp:38


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