mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-12 10:33:52 +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);
|
||||
}
|
||||
|
||||
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 ()
|
||||
{
|
||||
char connect_address[MAX_SOCKET_STRING + strlen ("/heartbeat")];
|
||||
@ -202,6 +221,7 @@ int main ()
|
||||
|
||||
UNITY_BEGIN ();
|
||||
RUN_TEST (test_roundtrip);
|
||||
RUN_TEST (test_roundtrip_without_path);
|
||||
RUN_TEST (test_short_message);
|
||||
RUN_TEST (test_large_message);
|
||||
RUN_TEST (test_heartbeat);
|
||||
|
Loading…
Reference in New Issue
Block a user