summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-05 01:49:15 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-05 01:49:15 +0000
commit30377823c35ca5266e35ca82fdb1ef5b086c1aee (patch)
tree27c178e61bd23499350acd70629c0f2d125cffaa
parente06442b64820db59394dce140967a60dd813533a (diff)
downloadtor-30377823c35ca5266e35ca82fdb1ef5b086c1aee.tar.gz
tor-30377823c35ca5266e35ca82fdb1ef5b086c1aee.zip
Add a few more tests to our tests so that our tests make sense to coverity. CIDs 139, 138, 137.
svn:r17486
-rw-r--r--src/or/test.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/test.c b/src/or/test.c
index 9b05242c40..cd9ff7a38d 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -2044,6 +2044,7 @@ test_util_bitarray(void)
int i, j, ok=1;
ba = bitarray_init_zero(1);
+ test_assert(ba);
test_assert(! bitarray_is_set(ba, 0));
bitarray_set(ba, 0);
test_assert(bitarray_is_set(ba, 0));
@@ -2421,6 +2422,7 @@ test_util_strmap(void)
smartlist_t *found_keys = NULL;
map = strmap_new();
+ test_assert(map);
test_eq(strmap_size(map), 0);
test_assert(strmap_isempty(map));
v = strmap_set(map, "K1", (void*)99);
@@ -3859,12 +3861,14 @@ test_util_mempool(void)
int i;
pool = mp_pool_new(1, 100);
+ test_assert(pool);
test_assert(pool->new_chunk_capacity >= 100);
test_assert(pool->item_alloc_size >= sizeof(void*)+1);
mp_pool_destroy(pool);
pool = NULL;
pool = mp_pool_new(241, 2500);
+ test_assert(pool);
test_assert(pool->new_chunk_capacity >= 10);
test_assert(pool->item_alloc_size >= sizeof(void*)+241);
test_eq(pool->item_alloc_size & 0x03, 0);