2023-06-05 01:16:05 +02:00
|
|
|
/* SPDX-License-Identifier: MPL-2.0 */
|
2010-08-27 18:35:59 +02:00
|
|
|
|
2010-08-28 13:58:23 +02:00
|
|
|
#include "testutil.hpp"
|
2018-12-07 13:51:30 +01:00
|
|
|
#include "testutil_unity.hpp"
|
2010-08-28 13:58:23 +02:00
|
|
|
|
2019-03-24 17:51:28 +01:00
|
|
|
SETUP_TEARDOWN_TESTCONTEXT
|
2011-03-24 10:03:49 +01:00
|
|
|
|
2018-12-07 13:51:30 +01:00
|
|
|
void test_roundtrip ()
|
|
|
|
{
|
|
|
|
void *sb = test_context_socket (ZMQ_REP);
|
|
|
|
TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, "inproc://a"));
|
2018-02-01 11:46:09 +01:00
|
|
|
|
2018-12-07 13:51:30 +01:00
|
|
|
void *sc = test_context_socket (ZMQ_REQ);
|
|
|
|
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, "inproc://a"));
|
2011-03-24 10:03:49 +01:00
|
|
|
|
2018-12-07 13:51:30 +01:00
|
|
|
bounce (sb, sc);
|
2011-03-24 10:03:49 +01:00
|
|
|
|
2018-12-07 13:51:30 +01:00
|
|
|
test_context_socket_close (sc);
|
|
|
|
test_context_socket_close (sb);
|
|
|
|
}
|
2011-03-24 10:03:49 +01:00
|
|
|
|
2018-12-07 13:51:30 +01:00
|
|
|
int main ()
|
|
|
|
{
|
|
|
|
setup_test_environment ();
|
2011-03-24 10:03:49 +01:00
|
|
|
|
2018-12-07 13:51:30 +01:00
|
|
|
UNITY_BEGIN ();
|
|
|
|
RUN_TEST (test_roundtrip);
|
|
|
|
return UNITY_END ();
|
2010-08-27 18:35:59 +02:00
|
|
|
}
|