Commit 67adc458 authored by Matthias Loy's avatar Matthias Loy

Roundtrip test for websocket url without a path

parent c357c378
...@@ -52,6 +52,25 @@ void test_roundtrip () ...@@ -52,6 +52,25 @@ void test_roundtrip ()
test_context_socket_close (sb); test_context_socket_close (sb);
} }
void test_roundtrip_without_path ()
{
char connect_address[MAX_SOCKET_STRING];
size_t addr_length = sizeof (connect_address);
void *sb = test_context_socket (ZMQ_REP);
TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, "ws://*:*"));
TEST_ASSERT_SUCCESS_ERRNO (
zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, connect_address, &addr_length));
void *sc = test_context_socket (ZMQ_REQ);
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, connect_address));
bounce (sb, sc);
test_context_socket_close (sc);
test_context_socket_close (sb);
}
void test_heartbeat () void test_heartbeat ()
{ {
char connect_address[MAX_SOCKET_STRING + strlen ("/heartbeat")]; char connect_address[MAX_SOCKET_STRING + strlen ("/heartbeat")];
...@@ -202,6 +221,7 @@ int main () ...@@ -202,6 +221,7 @@ int main ()
UNITY_BEGIN (); UNITY_BEGIN ();
RUN_TEST (test_roundtrip); RUN_TEST (test_roundtrip);
RUN_TEST (test_roundtrip_without_path);
RUN_TEST (test_short_message); RUN_TEST (test_short_message);
RUN_TEST (test_large_message); RUN_TEST (test_large_message);
RUN_TEST (test_heartbeat); RUN_TEST (test_heartbeat);
......
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