Author: ivan Date: Thu Nov 5 07:30:14 2015 New Revision: 1712717 URL: http://svn.apache.org/viewvc?rev=1712717&view=rev Log: Use test__create_bucket_allocator() in few more places for better unfreed memory diagnostic.
* test/test_ssl.c (test_ssl_init): Use test__create_bucket_allocator() instead of serf_bucket_allocator_create(). * test/test_util.c (initTestCtx): Add TC argument and use test__create_bucket_allocator() to create bucket allocator used for tests. (test_setup): Rename DUMMY argument to TEST for clarity and pass it to initTestCtx(). Modified: serf/trunk/test/test_ssl.c serf/trunk/test/test_util.c Modified: serf/trunk/test/test_ssl.c URL: http://svn.apache.org/viewvc/serf/trunk/test/test_ssl.c?rev=1712717&r1=1712716&r2=1712717&view=diff ============================================================================== --- serf/trunk/test/test_ssl.c (original) +++ serf/trunk/test/test_ssl.c Thu Nov 5 07:30:14 2015 @@ -50,8 +50,7 @@ static void test_ssl_init(CuTest *tc) serf_ssl_context_t *ssl_context; apr_status_t status; - serf_bucket_alloc_t *alloc = serf_bucket_allocator_create(tb->pool, NULL, - NULL); + serf_bucket_alloc_t *alloc = test__create_bucket_allocator(tc, tb->pool); stream = SERF_BUCKET_SIMPLE_STRING("", alloc); Modified: serf/trunk/test/test_util.c URL: http://svn.apache.org/viewvc/serf/trunk/test/test_util.c?rev=1712717&r1=1712716&r2=1712717&view=diff ============================================================================== --- serf/trunk/test/test_util.c (original) +++ serf/trunk/test/test_util.c Thu Nov 5 07:30:14 2015 @@ -142,12 +142,12 @@ apr_status_t use_new_connection(test_bat return status; } -static test_baton_t *initTestCtx(apr_pool_t *pool) +static test_baton_t *initTestCtx(CuTest *tc, apr_pool_t *pool) { test_baton_t *tb; tb = apr_pcalloc(pool, sizeof(*tb)); tb->pool = pool; - tb->bkt_alloc = serf_bucket_allocator_create(pool, NULL, NULL); + tb->bkt_alloc = test__create_bucket_allocator(tc, pool); tb->accepted_requests = apr_array_make(pool, 10, sizeof(int)); tb->sent_requests = apr_array_make(pool, 10, sizeof(int)); tb->handled_requests = apr_array_make(pool, 10, sizeof(int)); @@ -621,8 +621,9 @@ static int pool_abort_func(int retcode) return 0; } -void *test_setup(void *dummy) +void *test_setup(void *test) { + CuTest* tc = test; apr_pool_t *test_pool; apr_allocator_t *allocator; apr_pool_create(&test_pool, NULL); @@ -634,7 +635,7 @@ void *test_setup(void *dummy) apr_allocator_max_free_set(allocator, 16384 * 1024); /* else: APR pool debugging... leave this to apr */ - return initTestCtx(test_pool); + return initTestCtx(tc, test_pool); } void *test_teardown(void *baton)