diff options
author | dana koch <dsk@google.com> | 2014-08-27 20:41:25 +1000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-08-29 12:55:28 -0400 |
commit | c887e20e6a5a2c17c65f308e70e578e773b2ab23 (patch) | |
tree | ceef57b8043c107c11ed17f9658c737d2c2caf23 /src/common/container.c | |
parent | cc3b04a8c1edbeb1a488e319e3c0d28acd227417 (diff) | |
download | tor-c887e20e6a5a2c17c65f308e70e578e773b2ab23.tar.gz tor-c887e20e6a5a2c17c65f308e70e578e773b2ab23.zip |
Introduce full coverage tests for module routerset.c.
This is using the paradigm introduced for test_status.c.
Diffstat (limited to 'src/common/container.c')
-rw-r--r-- | src/common/container.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/common/container.c b/src/common/container.c index 7f02dec550..7481d31eb5 100644 --- a/src/common/container.c +++ b/src/common/container.c @@ -28,8 +28,8 @@ /** Allocate and return an empty smartlist. */ -smartlist_t * -smartlist_new(void) +MOCK_IMPL(smartlist_t *, +smartlist_new,(void)) { smartlist_t *sl = tor_malloc(sizeof(smartlist_t)); sl->num_used = 0; @@ -41,8 +41,8 @@ smartlist_new(void) /** Deallocate a smartlist. Does not release storage associated with the * list's elements. */ -void -smartlist_free(smartlist_t *sl) +MOCK_IMPL(void, +smartlist_free,(smartlist_t *sl)) { if (!sl) return; @@ -1062,8 +1062,8 @@ HT_GENERATE(digestmap_impl, digestmap_entry_t, node, digestmap_entry_hash, /** Constructor to create a new empty map from strings to void*'s. */ -strmap_t * -strmap_new(void) +MOCK_IMPL(strmap_t *, +strmap_new,(void)) { strmap_t *result; result = tor_malloc(sizeof(strmap_t)); @@ -1073,8 +1073,8 @@ strmap_new(void) /** Constructor to create a new empty map from digests to void*'s. */ -digestmap_t * -digestmap_new(void) +MOCK_IMPL(digestmap_t *, +digestmap_new,(void)) { digestmap_t *result; result = tor_malloc(sizeof(digestmap_t)); @@ -1427,8 +1427,8 @@ digestmap_iter_done(digestmap_iter_t *iter) * entries. If free_val is provided, it is invoked on every value in * <b>map</b>. */ -void -strmap_free(strmap_t *map, void (*free_val)(void*)) +MOCK_IMPL(void, +strmap_free,(strmap_t *map, void (*free_val)(void*))) { strmap_entry_t **ent, **next, *this; if (!map) @@ -1451,8 +1451,8 @@ strmap_free(strmap_t *map, void (*free_val)(void*)) * entries. If free_val is provided, it is invoked on every value in * <b>map</b>. */ -void -digestmap_free(digestmap_t *map, void (*free_val)(void*)) +MOCK_IMPL(void, +digestmap_free, (digestmap_t *map, void (*free_val)(void*))) { digestmap_entry_t **ent, **next, *this; if (!map) |