Skip to content

Commit c39b187

Browse files
committed
clang-format
1 parent 214aa8f commit c39b187

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

test/src/tph_poisson_alloc_test.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ static void test_bad_alloc(void)
7878
* we don't know exactly how many allocations will be made (nor would we want
7979
* to rely on such knowledge for testing, since it may change). Therefore, our
8080
* custom allocator is configured to fail after 1, 2, 3, ... allocations, until
81-
* tph_poisson_create succeeds. This way all possible memory allocation failures
82-
* will be hit.
83-
*
84-
* Note that without this kind of exhaustive test it would be very difficult to
81+
* tph_poisson_create succeeds. This way all possible memory allocation failures
82+
* will be hit.
83+
*
84+
* Note that without this kind of exhaustive test it would be very difficult to
8585
* achieve full test code coverage. */
8686

8787
/* Configure arguments. */
@@ -146,7 +146,7 @@ static void destroyed_alloc_free(void *ptr, ptrdiff_t size, void *ctx)
146146
free(ptr);
147147
}
148148

149-
static void test_destroyed_alloc(void)
149+
static void test_destroyed_alloc(void)
150150
{
151151
/* Configure arguments. */
152152
const tph_poisson_real bounds_min[2] = { (tph_poisson_real)-10, (tph_poisson_real)-10 };
@@ -164,21 +164,21 @@ static void test_destroyed_alloc(void)
164164

165165
/* Set up a simple allocator that count number of allocations/deallocations. */
166166
destroyed_alloc_ctx alloc_ctx = { .num_mallocs = 0, .num_frees = 0 };
167-
tph_poisson_allocator* alloc = malloc(sizeof(tph_poisson_default_alloc));
167+
tph_poisson_allocator *alloc = malloc(sizeof(tph_poisson_default_alloc));
168168
alloc->malloc = destroyed_alloc_malloc;
169169
alloc->free = destroyed_alloc_free;
170170
alloc->ctx = &alloc_ctx;
171171

172172
REQUIRE(tph_poisson_create(&args, alloc, &sampling) == TPH_POISSON_SUCCESS);
173173

174174
/* Destroy the allocator before deallocating the sampling memory. The sampling
175-
* should have stored the malloc/free function pointers and context internally,
176-
* so there should be no errors. Note that the allocator context is not destroyed,
177-
* only the allocator.
178-
*
179-
* This prevent the implementation from storing a pointer to the allocator
175+
* should have stored the malloc/free function pointers and context internally,
176+
* so there should be no errors. Note that the allocator context is not destroyed,
177+
* only the allocator.
178+
*
179+
* This prevent the implementation from storing a pointer to the allocator
180180
* internally. Instead the implementation should copy the malloc/free function
181-
* pointers (and context) so that it does not depend on the lifetime of the
181+
* pointers (and context) so that it does not depend on the lifetime of the
182182
* allocator instance. */
183183
free(alloc);
184184
REQUIRE(alloc_ctx.num_mallocs > 0);

0 commit comments

Comments
 (0)