@@ -136,15 +136,17 @@ TEST_P(umfPoolTest, allocFree) {
136
136
auto *ptr = umfPoolMalloc (pool.get (), allocSize);
137
137
ASSERT_NE (ptr, nullptr );
138
138
std::memset (ptr, 0 , allocSize);
139
- umfPoolFree (pool.get (), ptr);
139
+ umf_result_t umf_result = umfPoolFree (pool.get (), ptr);
140
+ ASSERT_EQ (umf_result, UMF_RESULT_SUCCESS);
140
141
}
141
142
142
143
TEST_P (umfPoolTest, allocFreeNonAlignedSizes) {
143
144
for (const auto &allocSize : nonAlignedAllocSizes) {
144
145
auto *ptr = umfPoolMalloc (pool.get (), allocSize);
145
146
ASSERT_NE (ptr, nullptr );
146
147
std::memset (ptr, 0 , allocSize);
147
- umfPoolFree (pool.get (), ptr);
148
+ umf_result_t umf_result = umfPoolFree (pool.get (), ptr);
149
+ ASSERT_EQ (umf_result, UMF_RESULT_SUCCESS);
148
150
}
149
151
}
150
152
@@ -160,7 +162,8 @@ TEST_P(umfPoolTest, reallocFree) {
160
162
auto *new_ptr = umfPoolRealloc (pool.get (), ptr, allocSize * multiplier);
161
163
ASSERT_NE (new_ptr, nullptr );
162
164
std::memset (new_ptr, 0 , allocSize * multiplier);
163
- umfPoolFree (pool.get (), new_ptr);
165
+ umf_result_t umf_result = umfPoolFree (pool.get (), new_ptr);
166
+ ASSERT_EQ (umf_result, UMF_RESULT_SUCCESS);
164
167
}
165
168
166
169
TEST_P (umfPoolTest, callocFree) {
@@ -174,7 +177,8 @@ TEST_P(umfPoolTest, callocFree) {
174
177
for (size_t i = 0 ; i < num; ++i) {
175
178
ASSERT_EQ (((int *)ptr)[i], 0 );
176
179
}
177
- umfPoolFree (pool.get (), ptr);
180
+ umf_result_t umf_result = umfPoolFree (pool.get (), ptr);
181
+ ASSERT_EQ (umf_result, UMF_RESULT_SUCCESS);
178
182
}
179
183
180
184
void pow2AlignedAllocHelper (umf_memory_pool_handle_t pool) {
@@ -195,7 +199,8 @@ void pow2AlignedAllocHelper(umf_memory_pool_handle_t pool) {
195
199
}
196
200
197
201
for (auto &ptr : allocs) {
198
- umfPoolFree (pool, ptr);
202
+ umf_result_t umf_result = umfPoolFree (pool, ptr);
203
+ ASSERT_EQ (umf_result, UMF_RESULT_SUCCESS);
199
204
}
200
205
}
201
206
}
@@ -227,7 +232,8 @@ TEST_P(umfPoolTest, multiThreadedMallocFree) {
227
232
}
228
233
229
234
for (auto allocation : allocations) {
230
- umfPoolFree (inPool, allocation);
235
+ umf_result_t umf_result = umfPoolFree (inPool, allocation);
236
+ ASSERT_EQ (umf_result, UMF_RESULT_SUCCESS);
231
237
}
232
238
};
233
239
@@ -280,7 +286,8 @@ TEST_P(umfPoolTest, multiThreadedReallocFree) {
280
286
for (auto allocation : allocations) {
281
287
auto *ptr =
282
288
umfPoolRealloc (inPool, allocation, allocSize * multiplier);
283
- umfPoolFree (inPool, ptr);
289
+ umf_result_t umf_result = umfPoolFree (inPool, ptr);
290
+ ASSERT_EQ (umf_result, UMF_RESULT_SUCCESS);
284
291
}
285
292
};
286
293
@@ -310,7 +317,8 @@ TEST_P(umfPoolTest, multiThreadedCallocFree) {
310
317
}
311
318
312
319
for (auto allocation : allocations) {
313
- umfPoolFree (inPool, allocation);
320
+ umf_result_t umf_result = umfPoolFree (inPool, allocation);
321
+ ASSERT_EQ (umf_result, UMF_RESULT_SUCCESS);
314
322
}
315
323
};
316
324
@@ -335,7 +343,8 @@ TEST_P(umfPoolTest, multiThreadedMallocFreeRandomSizes) {
335
343
}
336
344
337
345
for (auto allocation : allocations) {
338
- umfPoolFree (inPool, allocation);
346
+ umf_result_t umf_result = umfPoolFree (inPool, allocation);
347
+ ASSERT_EQ (umf_result, UMF_RESULT_SUCCESS);
339
348
}
340
349
};
341
350
@@ -375,7 +384,8 @@ TEST_P(umfMemTest, outOfMem) {
375
384
ASSERT_NE (allocations.back (), nullptr );
376
385
377
386
for (int i = 0 ; i < expectedRecycledPoolAllocs; i++) {
378
- umfPoolFree (hPool, allocations.back ());
387
+ umf_result_t umf_result = umfPoolFree (hPool, allocations.back ());
388
+ ASSERT_EQ (umf_result, UMF_RESULT_SUCCESS);
379
389
allocations.pop_back ();
380
390
}
381
391
@@ -385,7 +395,8 @@ TEST_P(umfMemTest, outOfMem) {
385
395
}
386
396
387
397
for (auto allocation : allocations) {
388
- umfPoolFree (hPool, allocation);
398
+ umf_result_t umf_result = umfPoolFree (hPool, allocation);
399
+ ASSERT_EQ (umf_result, UMF_RESULT_SUCCESS);
389
400
}
390
401
}
391
402
@@ -490,7 +501,8 @@ TEST_P(umfPoolTest, mallocUsableSize) {
490
501
// Make sure we can write to this memory
491
502
memset (ptr, 123 , result);
492
503
493
- umfPoolFree (pool.get (), ptr);
504
+ umf_result_t umf_result = umfPoolFree (pool.get (), ptr);
505
+ ASSERT_EQ (umf_result, UMF_RESULT_SUCCESS);
494
506
}
495
507
}
496
508
}
0 commit comments