test_pair_inproc.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 #include <unity.h>
7 
8 void *sb;
9 void *sc;
10 
11 void setUp ()
12 {
14 
16  TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, "inproc://a"));
17 
19  TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, "inproc://a"));
20 }
21 
22 void tearDown ()
23 {
26 
28 }
29 
31 {
32  bounce (sb, sc);
33 }
34 
35 // TODO it appears that this has nothing to do with pair or inproc, and belongs somewhere else
37 {
39  zmq_send_const (sb, "foo", 3, ZMQ_SNDMORE)));
41  6, TEST_ASSERT_SUCCESS_ERRNO (zmq_send_const (sb, "foobar", 6, 0)));
42 
43  recv_string_expect_success (sc, "foo", 0);
44  recv_string_expect_success (sc, "foobar", 0);
45 }
46 
47 int main ()
48 {
50 
51  UNITY_BEGIN ();
54  return UNITY_END ();
55 }
bounce
static void bounce(void *socket_)
Definition: test_req_relaxed.cpp:50
tearDown
void tearDown()
Definition: test_pair_inproc.cpp:22
UNITY_END
return UNITY_END()
main
int main()
Definition: test_pair_inproc.cpp:47
RUN_TEST
#define RUN_TEST(func)
Definition: unity_internals.h:615
setup_test_context
void setup_test_context()
Definition: testutil_unity.cpp:179
teardown_test_context
void teardown_test_context()
Definition: testutil_unity.cpp:189
sb
void * sb
Definition: test_pair_inproc.cpp:8
zmq_connect
ZMQ_EXPORT int zmq_connect(void *s_, const char *addr_)
Definition: zmq.cpp:307
testutil_unity.hpp
zmq_send_const
ZMQ_EXPORT int zmq_send_const(void *s_, const void *buf_, size_t len_, int flags_)
Definition: zmq.cpp:400
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
TEST_ASSERT_EQUAL_INT
#define TEST_ASSERT_EQUAL_INT(expected, actual)
Definition: unity.h:128
test_roundtrip
void test_roundtrip()
Definition: test_pair_inproc.cpp:30
setUp
void setUp()
Definition: test_pair_inproc.cpp:11
sc
void * sc
Definition: test_pair_inproc.cpp:9
unity.h
ZMQ_PAIR
#define ZMQ_PAIR
Definition: zmq.h:258
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()
ZMQ_SNDMORE
#define ZMQ_SNDMORE
Definition: zmq.h:359
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
test_zmq_send_const
void test_zmq_send_const()
Definition: test_pair_inproc.cpp:36


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