--- a/test/mpool_tests.c Tue Oct 02 13:43:17 2012 +0200 +++ b/test/mpool_tests.c Thu Oct 04 11:37:23 2012 +0200 @@ -9,9 +9,9 @@ UCX_TEST_IMPLEMENT(test_ucx_mempool_new) { UcxMempool *pool = ucx_mempool_new(16); UCX_TEST_BEGIN - UCX_TEST_ASSERT(pool->size == 16, "wrong size") - UCX_TEST_ASSERT(pool->ndata == 0, "uninitialized counter") - UCX_TEST_ASSERT(pool->data != NULL, "no memory addressed") + UCX_TEST_ASSERT(pool->size == 16, "wrong size"); + UCX_TEST_ASSERT(pool->ndata == 0, "uninitialized counter"); + UCX_TEST_ASSERT(pool->data != NULL, "no memory addressed"); UCX_TEST_END ucx_mempool_free(pool); } @@ -22,14 +22,14 @@ UCX_TEST_BEGIN intptr_t *test = (intptr_t*) ucx_mempool_malloc(pool, sizeof(intptr_t)); - UCX_TEST_ASSERT(pool->ndata == 1, "counter not incremented") - UCX_TEST_ASSERT(pool->size == 1, "chcap called") + UCX_TEST_ASSERT(pool->ndata == 1, "counter not incremented"); + UCX_TEST_ASSERT(pool->size == 1, "chcap called"); intptr_t *pooladdr = (intptr_t*)((char*)pool->data[0] + sizeof(ucx_destructor)); *pooladdr = 5; - UCX_TEST_ASSERT(*test == 5, "wrong pointer") + UCX_TEST_ASSERT(*test == 5, "wrong pointer"); UCX_TEST_END ucx_mempool_free(pool); @@ -42,14 +42,14 @@ ucx_mempool_malloc(pool, sizeof(int)); intptr_t *test = (intptr_t*) ucx_mempool_malloc(pool, sizeof(intptr_t)); - UCX_TEST_ASSERT(pool->ndata == 2, "counter not incremented") - UCX_TEST_ASSERT(pool->size == 17, "chcap not called") + UCX_TEST_ASSERT(pool->ndata == 2, "counter not incremented"); + UCX_TEST_ASSERT(pool->size == 17, "chcap not called"); intptr_t *pooladdr = (intptr_t*)((char*)pool->data[1] + sizeof(ucx_destructor)); *pooladdr = 5; - UCX_TEST_ASSERT(*test == 5, "wrong pointer") + UCX_TEST_ASSERT(*test == 5, "wrong pointer"); UCX_TEST_END ucx_mempool_free(pool); @@ -62,8 +62,8 @@ intptr_t *test = (intptr_t*) ucx_mempool_calloc(pool, 2, sizeof(intptr_t)); - UCX_TEST_ASSERT(test != NULL, "no memory for test data") - UCX_TEST_ASSERT(test[0] == 0 && test[1] == 0, "failed") + UCX_TEST_ASSERT(test != NULL, "no memory for test data"); + UCX_TEST_ASSERT(test[0] == 0 && test[1] == 0, "failed"); UCX_TEST_END ucx_mempool_free(pool); @@ -83,7 +83,7 @@ ucx_mempool_malloc(pool, sizeof(intptr_t)); intptr_t *test = (intptr_t*) ucx_mempool_calloc(pool, 2, sizeof(intptr_t)); - UCX_TEST_ASSERT(cb != NULL && test != NULL, "no memory for test data") + UCX_TEST_ASSERT(cb != NULL && test != NULL, "no memory for test data"); test[0] = 5; test[1] = (intptr_t) cb; *cb = 13; @@ -96,7 +96,7 @@ ucx_mempool_free(pool); - UCX_TEST_ASSERT(*cb == 42, "destructor not called") + UCX_TEST_ASSERT(*cb == 42, "destructor not called"); UCX_TEST_END if (cb != NULL) free(cb); @@ -110,7 +110,7 @@ UCX_TEST_BEGIN UcxMempool *pool = ucx_mempool_new(1); - UCX_TEST_ASSERT(cb != NULL && test != NULL, "no memory for test data") + UCX_TEST_ASSERT(cb != NULL && test != NULL, "no memory for test data"); test[0] = 5; test[1] = (intptr_t) cb; *cb = 13; @@ -120,10 +120,10 @@ ucx_destructor *pooladdr = (ucx_destructor*) ((char*)pool->data[0] + sizeof(ucx_destructor)); - UCX_TEST_ASSERT(*pooladdr == test_setdestr, "failed") + UCX_TEST_ASSERT(*pooladdr == test_setdestr, "failed"); ucx_mempool_free(pool); - UCX_TEST_ASSERT(*cb == 42, "destructor not called") + UCX_TEST_ASSERT(*cb == 42, "destructor not called"); UCX_TEST_END if (test != NULL) free(test); @@ -139,7 +139,7 @@ ucx_mempool_malloc(pool, sizeof(intptr_t)); intptr_t *test = (intptr_t*) ucx_mempool_calloc(pool, 2, sizeof(intptr_t)); - UCX_TEST_ASSERT(cb != NULL && test != NULL, "no memory for test data") + UCX_TEST_ASSERT(cb != NULL && test != NULL, "no memory for test data"); test[0] = 5; test[1] = (intptr_t) cb; *cb = 13; @@ -149,7 +149,7 @@ int *rtest, n = 2; do { n *= 2; - UCX_TEST_ASSERT(n < 65536, "test corrupt - no movement for realloc") + UCX_TEST_ASSERT(n < 65536, "test corrupt - no movement for realloc"); rtest = ucx_mempool_realloc(pool, test, n*sizeof(intptr_t)); } while (rtest == test); test = rtest; @@ -161,7 +161,7 @@ ucx_mempool_free(pool); - UCX_TEST_ASSERT(*cb == 42, "destructor not called") + UCX_TEST_ASSERT(*cb == 42, "destructor not called"); UCX_TEST_END if (cb != NULL) free(cb);