mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-06 00:31:13 +01:00
Roundtrip test for websocket url without a path
This commit is contained in:
parent
c357c378d8
commit
67adc458df
@ -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 ()
|
|||||||
|
|
||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user