21
21
22
22
class MemoryAccessor {
23
23
public:
24
+ virtual ~MemoryAccessor () = default ;
24
25
virtual void fill (void *ptr, size_t size, const void *pattern,
25
26
size_t pattern_size) = 0;
26
27
virtual void copy (void *dst_ptr, void *src_ptr, size_t size) = 0;
@@ -162,6 +163,7 @@ struct umfIpcTest : umf_test::test,
162
163
TEST_P (umfIpcTest, GetIPCHandleSize) {
163
164
size_t size = 0 ;
164
165
umf::pool_unique_handle_t pool = makePool ();
166
+ ASSERT_NE (pool.get (), nullptr );
165
167
166
168
umf_result_t ret = umfPoolGetIPCHandleSize (pool.get (), &size);
167
169
EXPECT_EQ (ret, UMF_RESULT_SUCCESS);
@@ -174,6 +176,8 @@ TEST_P(umfIpcTest, GetIPCHandleSizeInvalidArgs) {
174
176
EXPECT_EQ (ret, UMF_RESULT_ERROR_INVALID_ARGUMENT);
175
177
176
178
umf::pool_unique_handle_t pool = makePool ();
179
+ ASSERT_NE (pool.get (), nullptr );
180
+
177
181
ret = umfPoolGetIPCHandleSize (pool.get (), nullptr );
178
182
EXPECT_EQ (ret, UMF_RESULT_ERROR_INVALID_ARGUMENT);
179
183
}
@@ -190,6 +194,8 @@ TEST_P(umfIpcTest, GetIPCHandleInvalidArgs) {
190
194
EXPECT_EQ (ret, UMF_RESULT_ERROR_INVALID_ARGUMENT);
191
195
192
196
umf::pool_unique_handle_t pool = makePool ();
197
+ ASSERT_NE (pool.get (), nullptr );
198
+
193
199
ptr = umfPoolMalloc (pool.get (), SIZE);
194
200
EXPECT_NE (ptr, nullptr );
195
201
@@ -213,6 +219,8 @@ TEST_P(umfIpcTest, BasicFlow) {
213
219
constexpr size_t SIZE = 100 ;
214
220
std::vector<int > expected_data (SIZE);
215
221
umf::pool_unique_handle_t pool = makePool ();
222
+ ASSERT_NE (pool.get (), nullptr );
223
+
216
224
int *ptr = (int *)umfPoolMalloc (pool.get (), SIZE * sizeof (int ));
217
225
EXPECT_NE (ptr, nullptr );
218
226
@@ -283,6 +291,7 @@ TEST_P(umfIpcTest, GetPoolByOpenedHandle) {
283
291
void *openedPtrs[NUM_POOLS][NUM_ALLOCS];
284
292
std::vector<umf::pool_unique_handle_t > pools_to_open;
285
293
umf::pool_unique_handle_t pool = makePool ();
294
+ ASSERT_NE (pool.get (), nullptr );
286
295
287
296
for (size_t i = 0 ; i < NUM_POOLS; ++i) {
288
297
pools_to_open.push_back (makePool ());
@@ -341,6 +350,8 @@ TEST_P(umfIpcTest, GetPoolByOpenedHandle) {
341
350
TEST_P (umfIpcTest, AllocFreeAllocTest) {
342
351
constexpr size_t SIZE = 64 * 1024 ;
343
352
umf::pool_unique_handle_t pool = makePool ();
353
+ ASSERT_NE (pool.get (), nullptr );
354
+
344
355
umf_ipc_handler_handle_t ipcHandler = nullptr ;
345
356
346
357
umf_result_t ret = umfPoolGetIPCHandler (pool.get (), &ipcHandler);
@@ -400,7 +411,9 @@ TEST_P(umfIpcTest, openInTwoIpcHandlers) {
400
411
constexpr size_t SIZE = 100 ;
401
412
std::vector<int > expected_data (SIZE);
402
413
umf::pool_unique_handle_t pool1 = makePool ();
414
+ ASSERT_NE (pool1.get (), nullptr );
403
415
umf::pool_unique_handle_t pool2 = makePool ();
416
+ ASSERT_NE (pool2.get (), nullptr );
404
417
umf_ipc_handler_handle_t ipcHandler1 = nullptr ;
405
418
umf_ipc_handler_handle_t ipcHandler2 = nullptr ;
406
419
@@ -465,6 +478,7 @@ TEST_P(umfIpcTest, ConcurrentGetPutHandles) {
465
478
constexpr size_t ALLOC_SIZE = 100 ;
466
479
constexpr size_t NUM_POINTERS = 100 ;
467
480
umf::pool_unique_handle_t pool = makePool ();
481
+ ASSERT_NE (pool.get (), nullptr );
468
482
469
483
for (size_t i = 0 ; i < NUM_POINTERS; ++i) {
470
484
void *ptr = umfPoolMalloc (pool.get (), ALLOC_SIZE);
@@ -514,6 +528,7 @@ TEST_P(umfIpcTest, ConcurrentOpenCloseHandles) {
514
528
constexpr size_t ALLOC_SIZE = 100 ;
515
529
constexpr size_t NUM_POINTERS = 100 ;
516
530
umf::pool_unique_handle_t pool = makePool ();
531
+ ASSERT_NE (pool.get (), nullptr );
517
532
518
533
for (size_t i = 0 ; i < NUM_POINTERS; ++i) {
519
534
void *ptr = umfPoolMalloc (pool.get (), ALLOC_SIZE);
0 commit comments