mirror of
https://github.com/curl/curl.git
synced 2026-08-24 21:43:32 +03:00
unittests: cleanups
- make sure all UNITTEST prototypes mark in which unit test they are used, with "@unittest" markup - make sure all UNITTEST functions do not use Curl_ prefix, as that is a prefix we use for global private functions and these functions are static and therefore not global and the prefix is wrong - drop UNITTEST for functions not used in unit tests - make the extract-unit-protos script highlight the above issues if found - extract-unit-protos now also outputs the unit test number for all the generated protos in lib/unitprotos.h to aid readers. It also adds the source file and line number where the proto originates from. - extract-unit-protos now exits with a non-zero value if any of the above warnings are triggered - cf-dns: Curl_cf_dns_result => static cf_dns_result - hostip: Curl_ipv6works => static ipv6works - url: remove Curl_setup_conn() - not used anymore - connect: Curl_timeleft_now_ms => UNITTEST timeleft_now_ms Closes #21330
This commit is contained in:
parent
94f14c54b0
commit
7fd35f4c34
36 changed files with 248 additions and 216 deletions
|
|
@ -79,9 +79,12 @@ CURLcode Curl_uint32_tbl_resize(struct uint32_tbl *tbl, uint32_t nrows)
|
|||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* Clear the table, making it empty. */
|
||||
UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl);
|
||||
UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl)
|
||||
/* Clear the table, making it empty.
|
||||
|
||||
@unittest 3212
|
||||
*/
|
||||
UNITTEST void uint32_tbl_clear(struct uint32_tbl *tbl);
|
||||
UNITTEST void uint32_tbl_clear(struct uint32_tbl *tbl)
|
||||
{
|
||||
DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
|
||||
uint32_tbl_clear_rows(tbl, 0, tbl->nrows);
|
||||
|
|
@ -92,7 +95,7 @@ UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl)
|
|||
void Curl_uint32_tbl_destroy(struct uint32_tbl *tbl)
|
||||
{
|
||||
DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
|
||||
Curl_uint32_tbl_clear(tbl);
|
||||
uint32_tbl_clear(tbl);
|
||||
curlx_free(tbl->rows);
|
||||
memset(tbl, 0, sizeof(*tbl));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue