1.1 --- a/test/mpool_tests.c Tue Oct 02 13:43:17 2012 +0200 1.2 +++ b/test/mpool_tests.c Thu Oct 04 11:37:23 2012 +0200 1.3 @@ -9,9 +9,9 @@ 1.4 UCX_TEST_IMPLEMENT(test_ucx_mempool_new) { 1.5 UcxMempool *pool = ucx_mempool_new(16); 1.6 UCX_TEST_BEGIN 1.7 - UCX_TEST_ASSERT(pool->size == 16, "wrong size") 1.8 - UCX_TEST_ASSERT(pool->ndata == 0, "uninitialized counter") 1.9 - UCX_TEST_ASSERT(pool->data != NULL, "no memory addressed") 1.10 + UCX_TEST_ASSERT(pool->size == 16, "wrong size"); 1.11 + UCX_TEST_ASSERT(pool->ndata == 0, "uninitialized counter"); 1.12 + UCX_TEST_ASSERT(pool->data != NULL, "no memory addressed"); 1.13 UCX_TEST_END 1.14 ucx_mempool_free(pool); 1.15 } 1.16 @@ -22,14 +22,14 @@ 1.17 UCX_TEST_BEGIN 1.18 intptr_t *test = (intptr_t*) ucx_mempool_malloc(pool, sizeof(intptr_t)); 1.19 1.20 - UCX_TEST_ASSERT(pool->ndata == 1, "counter not incremented") 1.21 - UCX_TEST_ASSERT(pool->size == 1, "chcap called") 1.22 + UCX_TEST_ASSERT(pool->ndata == 1, "counter not incremented"); 1.23 + UCX_TEST_ASSERT(pool->size == 1, "chcap called"); 1.24 1.25 intptr_t *pooladdr = 1.26 (intptr_t*)((char*)pool->data[0] + sizeof(ucx_destructor)); 1.27 *pooladdr = 5; 1.28 1.29 - UCX_TEST_ASSERT(*test == 5, "wrong pointer") 1.30 + UCX_TEST_ASSERT(*test == 5, "wrong pointer"); 1.31 1.32 UCX_TEST_END 1.33 ucx_mempool_free(pool); 1.34 @@ -42,14 +42,14 @@ 1.35 ucx_mempool_malloc(pool, sizeof(int)); 1.36 intptr_t *test = (intptr_t*) ucx_mempool_malloc(pool, sizeof(intptr_t)); 1.37 1.38 - UCX_TEST_ASSERT(pool->ndata == 2, "counter not incremented") 1.39 - UCX_TEST_ASSERT(pool->size == 17, "chcap not called") 1.40 + UCX_TEST_ASSERT(pool->ndata == 2, "counter not incremented"); 1.41 + UCX_TEST_ASSERT(pool->size == 17, "chcap not called"); 1.42 1.43 intptr_t *pooladdr = 1.44 (intptr_t*)((char*)pool->data[1] + sizeof(ucx_destructor)); 1.45 *pooladdr = 5; 1.46 1.47 - UCX_TEST_ASSERT(*test == 5, "wrong pointer") 1.48 + UCX_TEST_ASSERT(*test == 5, "wrong pointer"); 1.49 1.50 UCX_TEST_END 1.51 ucx_mempool_free(pool); 1.52 @@ -62,8 +62,8 @@ 1.53 1.54 intptr_t *test = (intptr_t*) ucx_mempool_calloc(pool, 2, sizeof(intptr_t)); 1.55 1.56 - UCX_TEST_ASSERT(test != NULL, "no memory for test data") 1.57 - UCX_TEST_ASSERT(test[0] == 0 && test[1] == 0, "failed") 1.58 + UCX_TEST_ASSERT(test != NULL, "no memory for test data"); 1.59 + UCX_TEST_ASSERT(test[0] == 0 && test[1] == 0, "failed"); 1.60 1.61 UCX_TEST_END 1.62 ucx_mempool_free(pool); 1.63 @@ -83,7 +83,7 @@ 1.64 ucx_mempool_malloc(pool, sizeof(intptr_t)); 1.65 intptr_t *test = (intptr_t*) ucx_mempool_calloc(pool, 2, sizeof(intptr_t)); 1.66 1.67 - UCX_TEST_ASSERT(cb != NULL && test != NULL, "no memory for test data") 1.68 + UCX_TEST_ASSERT(cb != NULL && test != NULL, "no memory for test data"); 1.69 1.70 test[0] = 5; test[1] = (intptr_t) cb; 1.71 *cb = 13; 1.72 @@ -96,7 +96,7 @@ 1.73 1.74 ucx_mempool_free(pool); 1.75 1.76 - UCX_TEST_ASSERT(*cb == 42, "destructor not called") 1.77 + UCX_TEST_ASSERT(*cb == 42, "destructor not called"); 1.78 1.79 UCX_TEST_END 1.80 if (cb != NULL) free(cb); 1.81 @@ -110,7 +110,7 @@ 1.82 UCX_TEST_BEGIN 1.83 UcxMempool *pool = ucx_mempool_new(1); 1.84 1.85 - UCX_TEST_ASSERT(cb != NULL && test != NULL, "no memory for test data") 1.86 + UCX_TEST_ASSERT(cb != NULL && test != NULL, "no memory for test data"); 1.87 1.88 test[0] = 5; test[1] = (intptr_t) cb; 1.89 *cb = 13; 1.90 @@ -120,10 +120,10 @@ 1.91 ucx_destructor *pooladdr = (ucx_destructor*) 1.92 ((char*)pool->data[0] + sizeof(ucx_destructor)); 1.93 1.94 - UCX_TEST_ASSERT(*pooladdr == test_setdestr, "failed") 1.95 + UCX_TEST_ASSERT(*pooladdr == test_setdestr, "failed"); 1.96 1.97 ucx_mempool_free(pool); 1.98 - UCX_TEST_ASSERT(*cb == 42, "destructor not called") 1.99 + UCX_TEST_ASSERT(*cb == 42, "destructor not called"); 1.100 UCX_TEST_END 1.101 1.102 if (test != NULL) free(test); 1.103 @@ -139,7 +139,7 @@ 1.104 ucx_mempool_malloc(pool, sizeof(intptr_t)); 1.105 intptr_t *test = (intptr_t*) ucx_mempool_calloc(pool, 2, sizeof(intptr_t)); 1.106 1.107 - UCX_TEST_ASSERT(cb != NULL && test != NULL, "no memory for test data") 1.108 + UCX_TEST_ASSERT(cb != NULL && test != NULL, "no memory for test data"); 1.109 1.110 test[0] = 5; test[1] = (intptr_t) cb; 1.111 *cb = 13; 1.112 @@ -149,7 +149,7 @@ 1.113 int *rtest, n = 2; 1.114 do { 1.115 n *= 2; 1.116 - UCX_TEST_ASSERT(n < 65536, "test corrupt - no movement for realloc") 1.117 + UCX_TEST_ASSERT(n < 65536, "test corrupt - no movement for realloc"); 1.118 rtest = ucx_mempool_realloc(pool, test, n*sizeof(intptr_t)); 1.119 } while (rtest == test); 1.120 test = rtest; 1.121 @@ -161,7 +161,7 @@ 1.122 1.123 ucx_mempool_free(pool); 1.124 1.125 - UCX_TEST_ASSERT(*cb == 42, "destructor not called") 1.126 + UCX_TEST_ASSERT(*cb == 42, "destructor not called"); 1.127 1.128 UCX_TEST_END 1.129 if (cb != NULL) free(cb);