mirror of
https://github.com/curl/curl.git
synced 2026-08-25 19:43:33 +03:00
tests: merge clients into libtests, drop duplicate code
libtests and clients were built the same way after recent overhauls. libtests are used by runtests, clients by pytests. Merge clients into libtests, aligning their entry function signature, dropping common utility functions, and simplifying the build. Note: After this patch `CURLDEBUG` applies to cli tests, when enabled. Also: - lib552: drop local copy-paste debug callback in favor of testtrace. - lib552: drop local copy-paste dump function in favor of testtrace. - clients: use `long` for HTTP version, drop casts. - clients: replace local dump function in favor of testrace clone. - sync cli test entry function prototype with libtests'. - h2_serverpush: replace local trace callback with testtrace. - de-duplicate 3 websocket close, ping, ping, functions. Kept the pong iteration from `ws_pingpong`. Note: the pong clone in `lib2304` was returning an error when `curl_ws_recv()` returned non-zero and the payload matched the expected one anyway. After this patch, this case returns success, as it does in `ws_pingpong`. `lib2304` keeps passing, but I'm not sure if the previous behavior was intentional. - display full value in websocket close, ping, pong, drop casts. Closes #18079
This commit is contained in:
parent
952c929bdf
commit
00887aee8c
48 changed files with 541 additions and 1041 deletions
|
|
@ -79,11 +79,22 @@ extern const char **test_argv;
|
|||
extern int testnum;
|
||||
extern struct curltime tv_test_start; /* for test timing */
|
||||
|
||||
extern int coptind;
|
||||
extern const char *coptarg;
|
||||
int cgetopt(int argc, const char * const argv[], const char *optstring);
|
||||
|
||||
extern int select_wrapper(int nfds, fd_set *rd, fd_set *wr, fd_set *exc,
|
||||
struct timeval *tv);
|
||||
|
||||
extern char *hexdump(const unsigned char *buffer, size_t len);
|
||||
|
||||
#ifndef CURL_DISABLE_WEBSOCKETS
|
||||
CURLcode ws_send_ping(CURL *curl, const char *send_payload);
|
||||
CURLcode ws_recv_pong(CURL *curl, const char *expected_payload);
|
||||
/* just close the connection */
|
||||
void ws_close(CURL *curl);
|
||||
#endif
|
||||
|
||||
/*
|
||||
** TEST_ERR_* values must within the CURLcode range to not cause compiler
|
||||
** errors.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue