2023-06-05 00:16:05 +01:00
|
|
|
/* SPDX-License-Identifier: MPL-2.0 */
|
2013-10-30 16:03:27 +01:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "testutil.hpp"
|
2018-12-10 06:04:38 -05:00
|
|
|
#include "testutil_unity.hpp"
|
2013-10-30 16:03:27 +01:00
|
|
|
|
2019-03-24 12:51:28 -04:00
|
|
|
SETUP_TEARDOWN_TESTCONTEXT
|
2013-10-30 16:03:27 +01:00
|
|
|
|
2018-12-10 06:04:38 -05:00
|
|
|
void test_roundtrip ()
|
|
|
|
{
|
|
|
|
void *sb = test_context_socket (ZMQ_PAIR);
|
|
|
|
TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, "tipc://{5560,0,0}"));
|
2013-10-30 16:03:27 +01:00
|
|
|
|
2018-12-10 06:04:38 -05:00
|
|
|
void *sc = test_context_socket (ZMQ_PAIR);
|
|
|
|
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, "tipc://{5560,0}@0.0.0"));
|
2013-10-30 16:03:27 +01:00
|
|
|
|
|
|
|
bounce (sb, sc);
|
|
|
|
|
2018-12-10 06:04:38 -05:00
|
|
|
test_context_socket_close (sc);
|
|
|
|
test_context_socket_close (sb);
|
|
|
|
}
|
2013-10-30 16:03:27 +01:00
|
|
|
|
2018-12-10 06:04:38 -05:00
|
|
|
int main ()
|
|
|
|
{
|
|
|
|
if (!is_tipc_available ()) {
|
|
|
|
printf ("TIPC environment unavailable, skipping test\n");
|
|
|
|
return 77;
|
|
|
|
}
|
2013-10-30 16:03:27 +01:00
|
|
|
|
2018-12-10 06:04:38 -05:00
|
|
|
UNITY_BEGIN ();
|
|
|
|
RUN_TEST (test_roundtrip);
|
|
|
|
return UNITY_END ();
|
2013-10-30 16:03:27 +01:00
|
|
|
}
|