/*
* @unittest: 1300
*/
-void
+UNITTEST void Curl_node_uremove(struct Curl_llist_node *, void *);
+UNITTEST void
Curl_node_uremove(struct Curl_llist_node *e, void *user)
{
struct Curl_llist *list;
const void *, struct Curl_llist_node *node);
void Curl_llist_append(struct Curl_llist *,
const void *, struct Curl_llist_node *node);
-void Curl_node_uremove(struct Curl_llist_node *, void *);
void Curl_node_remove(struct Curl_llist_node *);
void Curl_llist_destroy(struct Curl_llist *, void *);
memset(bset, 0, sizeof(*bset));
}
-
-unsigned int Curl_uint_bset_capacity(struct uint_bset *bset)
+#ifdef UNITTESTS
+UNITTEST unsigned int Curl_uint_bset_capacity(struct uint_bset *bset)
{
return bset->nslots * 64;
}
-
-unsigned int Curl_uint_bset_count(struct uint_bset *bset)
+UNITTEST unsigned int Curl_uint_bset_count(struct uint_bset *bset)
{
unsigned int i;
unsigned int n = 0;
}
return n;
}
-
+#endif
bool Curl_uint_bset_empty(struct uint_bset *bset)
{
}
}
-void Curl_uint_hash_clear(struct uint_hash *h)
+#ifdef UNITTESTS
+UNITTEST void Curl_uint_hash_clear(struct uint_hash *h)
{
uint_hash_clear(h);
}
+#endif
void Curl_uint_hash_destroy(struct uint_hash *h)
{
#define CURL_UINT_SPBSET_MAGIC 0x70737362
#endif
+/* Clear the bitset, making it empty. */
+UNITTEST void Curl_uint_spbset_clear(struct uint_spbset *bset);
+
void Curl_uint_spbset_init(struct uint_spbset *bset)
{
memset(bset, 0, sizeof(*bset));
return TRUE;
}
-void Curl_uint_spbset_clear(struct uint_spbset *bset)
+UNITTEST void Curl_uint_spbset_clear(struct uint_spbset *bset)
{
struct uint_spbset_chunk *next, *chunk;
/* TRUE of bitset is empty */
bool Curl_uint_spbset_empty(struct uint_spbset *bset);
-/* Clear the bitset, making it empty. */
-void Curl_uint_spbset_clear(struct uint_spbset *bset);
-
/* Add the number `i` to the bitset.
* Numbers can be added more than once, without making a difference.
* Returns FALSE if allocations failed. */
#define CURL_UINT_TBL_MAGIC 0x62757473
#endif
+/* Clear the table, making it empty. */
+UNITTEST void Curl_uint_tbl_clear(struct uint_tbl *tbl);
+
void Curl_uint_tbl_init(struct uint_tbl *tbl,
Curl_uint_tbl_entry_dtor *entry_dtor)
{
memset(tbl, 0, sizeof(*tbl));
}
-
-void Curl_uint_tbl_clear(struct uint_tbl *tbl)
+UNITTEST void Curl_uint_tbl_clear(struct uint_tbl *tbl)
{
DEBUGASSERT(tbl->init == CURL_UINT_TBL_MAGIC);
uint_tbl_clear_rows(tbl, 0, tbl->nrows);
/* Get the number of entries in the table. */
unsigned int Curl_uint_tbl_count(struct uint_tbl *tbl);
-/* Clear the table, making it empty. */
-void Curl_uint_tbl_clear(struct uint_tbl *tbl);
-
/* Get the entry for key or NULL if not present */
void *Curl_uint_tbl_get(struct uint_tbl *tbl, unsigned int key);
#include "llist.h"
+UNITTEST void Curl_node_uremove(struct Curl_llist_node *, void *);
+
static void test_Curl_llist_dtor(void *key, void *value)
{
/* used by the llist API, does nothing here */
#include "uint-table.h"
#include "curl_trc.h"
+UNITTEST void Curl_uint_tbl_clear(struct uint_tbl *tbl);
+
#define TBL_SIZE 100
static CURLcode t3212_setup(struct uint_tbl *tbl)
#include "uint-spbset.h"
#include "curl_trc.h"
+UNITTEST void Curl_uint_spbset_clear(struct uint_spbset *bset);
+
static void check_spbset(const char *name, const unsigned int *s, size_t slen)
{
struct uint_spbset bset;