Commit 0114572c authored by Simon Giesecke's avatar Simon Giesecke

Migrate tests/test_bind_src_address.cpp to unity

parent be33dce6
...@@ -28,30 +28,39 @@ ...@@ -28,30 +28,39 @@
*/ */
#include "testutil.hpp" #include "testutil.hpp"
#include "testutil_unity.hpp"
int main (void) #include <unity.h>
{
setup_test_environment ();
void *ctx = zmq_ctx_new ();
assert (ctx);
void *sock = zmq_socket (ctx, ZMQ_PUB); void setUp ()
assert (sock); {
setup_test_context ();
}
int rc = zmq_connect (sock, "tcp://127.0.0.1:0;localhost:1234"); void tearDown ()
assert (rc == 0); {
teardown_test_context ();
}
rc = zmq_connect (sock, "tcp://localhost:5555;localhost:1235"); void test_x ()
assert (rc == 0); {
void *sock = test_context_socket (ZMQ_PUB);
rc = zmq_connect (sock, "tcp://lo:5555;localhost:1235"); TEST_ASSERT_SUCCESS_ERRNO (
assert (rc == 0); zmq_connect (sock, "tcp://127.0.0.1:0;localhost:1234"));
TEST_ASSERT_SUCCESS_ERRNO (
zmq_connect (sock, "tcp://localhost:5555;localhost:1235"));
TEST_ASSERT_SUCCESS_ERRNO (
zmq_connect (sock, "tcp://lo:5555;localhost:1235"));
rc = zmq_close (sock); test_context_socket_close (sock);
assert (rc == 0); }
rc = zmq_ctx_term (ctx); int main (void)
assert (rc == 0); {
setup_test_environment ();
return 0; UNITY_BEGIN ();
RUN_TEST (test_x);
return UNITY_END ();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment