[or-cvs] r17486: {tor} Add a few more tests to our tests so that our tests make sen (tor/trunk/src/or)
nickm at seul.org
nickm at seul.org
Fri Dec 5 01:49:15 UTC 2008
Author: nickm
Date: 2008-12-04 20:49:15 -0500 (Thu, 04 Dec 2008)
New Revision: 17486
Modified:
tor/trunk/src/or/test.c
Log:
Add a few more tests to our tests so that our tests make sense to coverity. CIDs 139, 138, 137.
Modified: tor/trunk/src/or/test.c
===================================================================
--- tor/trunk/src/or/test.c 2008-12-05 01:35:49 UTC (rev 17485)
+++ tor/trunk/src/or/test.c 2008-12-05 01:49:15 UTC (rev 17486)
@@ -2044,6 +2044,7 @@
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 @@
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 @@
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);
More information about the tor-commits
mailing list