Skip to content

Commit

Permalink
Disable test 'Test incorrect websocket connection on correct websocke…
Browse files Browse the repository at this point in the history
…t service' if curl version >= 7.86.0

Because libcurl introduced websocket support in 7.86.0, so the expected response fails and a timeout occurs
  • Loading branch information
babelouest committed Jan 4, 2023
1 parent 79cfb56 commit 28adf55
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <time.h>
#include <ulfius.h>
#include <zlib.h>
#include <curl/curl.h>

#define MIN(A, B) ((A)>(B)?(B):(A))

Expand Down Expand Up @@ -759,14 +760,16 @@ START_TEST(test_ulfius_websocket_client)
ulfius_clean_request(&request);
ulfius_clean_response(&response);

// Test incorrect websocket connection on correct websocket service
#if LIBCURL_VERSION_NUM < 0x075600
// Test incorrect websocket connection on correct websocket service for libcurl < 7.86.0
ulfius_init_request(&request);
ulfius_init_response(&response);
request.http_verb = o_strdup("GET");
request.http_url = o_strdup(url);
ck_assert_int_eq(ulfius_send_http_request(&request, &response), U_ERROR_LIBCURL); // On a websocket connection attempt, libcurl return 'Unsupported protocol'
ulfius_clean_request(&request);
ulfius_clean_response(&response);
#endif

// Test incorrect websocket connection on correct websocket service
ulfius_init_request(&request);
Expand Down Expand Up @@ -807,14 +810,16 @@ START_TEST(test_ulfius_websocket_client_no_onclose)
ulfius_clean_request(&request);
ulfius_clean_response(&response);

// Test incorrect websocket connection on correct websocket service
#if LIBCURL_VERSION_NUM < 0x075600
// Test incorrect websocket connection on correct websocket service for libcurl < 7.86.0
ulfius_init_request(&request);
ulfius_init_response(&response);
request.http_verb = o_strdup("GET");
request.http_url = o_strdup(url);
ck_assert_int_eq(ulfius_send_http_request(&request, &response), U_ERROR_LIBCURL); // On a websocket connection attempt, libcurl return 'Unsupported protocol'
ulfius_clean_request(&request);
ulfius_clean_response(&response);
#endif

// Test incorrect websocket connection on correct websocket service
ulfius_init_request(&request);
Expand Down

0 comments on commit 28adf55

Please sign in to comment.