diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-07-31 18:01:27 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-07-31 18:01:27 +0000 |
commit | d934607069c77d6cf4caf9061e43d6d20c5aa111 (patch) | |
tree | be3079405369d40605dacfea5dce0a0bf6fddf26 /src/common/container.c | |
parent | 3843b1b3d09ca9d6546bfcf8e5f3bc10de4c2748 (diff) | |
download | tor-d934607069c77d6cf4caf9061e43d6d20c5aa111.tar.gz tor-d934607069c77d6cf4caf9061e43d6d20c5aa111.zip |
r6979@Kushana: nickm | 2006-07-31 13:16:58 -0400
Add assert_ok functions for strmap and digestmap; use them in unit test code.
svn:r6958
Diffstat (limited to 'src/common/container.c')
-rw-r--r-- | src/common/container.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/container.c b/src/common/container.c index d8ce9d654b..1e1fd985b1 100644 --- a/src/common/container.c +++ b/src/common/container.c @@ -965,6 +965,17 @@ digestmap_free(digestmap_t *map, void (*free_val)(void*)) tor_free(map); } +void +strmap_assert_ok(strmap_t *map) +{ + tor_assert(!_strmap_impl_HT_REP_IS_BAD(&map->head)); +} +void +digestmap_assert_ok(digestmap_t *map) +{ + tor_assert(!_digestmap_impl_HT_REP_IS_BAD(&map->head)); +} + /** Return true iff <b>map</b> has no entries. */ int strmap_isempty(strmap_t *map) |