tests/util_allocator.c

changeset 890
54565fd74e74
parent 861
bab51b32fcb1
equal deleted inserted replaced
889:f549fd9fbd8f 890:54565fd74e74
145 145
146 void cx_testing_allocator_destroy(CxTestingAllocator *alloc) { 146 void cx_testing_allocator_destroy(CxTestingAllocator *alloc) {
147 free(alloc->tracked); 147 free(alloc->tracked);
148 } 148 }
149 149
150 bool cx_testing_allocator_used(CxTestingAllocator const *alloc) { 150 bool cx_testing_allocator_used(const CxTestingAllocator *alloc) {
151 return alloc->alloc_total > 0; 151 return alloc->alloc_total > 0;
152 } 152 }
153 153
154 bool cx_testing_allocator_verify(CxTestingAllocator const *alloc) { 154 bool cx_testing_allocator_verify(const CxTestingAllocator *alloc) {
155 return alloc->tracked_count == 0 && alloc->alloc_failed == 0 && alloc->free_failed == 0 155 return alloc->tracked_count == 0 && alloc->alloc_failed == 0 && alloc->free_failed == 0
156 && alloc->alloc_total == alloc->free_total; 156 && alloc->alloc_total == alloc->free_total;
157 } 157 }
158 158
159 // SELF-TEST 159 // SELF-TEST

mercurial