@@ -66,6 +66,7 @@ struct umfIpcTest : umf_test::test,
66
66
providerParams = provider_params;
67
67
memAccessor = accessor;
68
68
freeNotSupported = free_not_supp;
69
+ COMMON_SIZE = 4096 ;
69
70
}
70
71
71
72
void TearDown () override { test::TearDown (); }
@@ -125,6 +126,7 @@ struct umfIpcTest : umf_test::test,
125
126
umf_memory_provider_ops_t *providerOps = nullptr ;
126
127
void *providerParams = nullptr ;
127
128
bool freeNotSupported = false ;
129
+ size_t COMMON_SIZE;
128
130
};
129
131
130
132
static inline umf_result_t
@@ -156,7 +158,7 @@ TEST_P(umfIpcTest, GetIPCHandleSizeInvalidArgs) {
156
158
}
157
159
158
160
TEST_P (umfIpcTest, GetIPCHandleInvalidArgs) {
159
- constexpr size_t SIZE = 100 ;
161
+ size_t SIZE = COMMON_SIZE ;
160
162
umf_ipc_handle_t ipcHandle = nullptr ;
161
163
size_t handleSize = 0 ;
162
164
umf_result_t ret = umfGetIPCHandle (nullptr , &ipcHandle, &handleSize);
@@ -182,7 +184,7 @@ TEST_P(umfIpcTest, GetIPCHandleInvalidArgs) {
182
184
}
183
185
184
186
TEST_P (umfIpcTest, BasicFlow) {
185
- constexpr size_t SIZE = 100 ;
187
+ size_t SIZE = COMMON_SIZE ;
186
188
std::vector<int > expected_data (SIZE);
187
189
umf::pool_unique_handle_t pool = makePool ();
188
190
int *ptr = (int *)umfPoolMalloc (pool.get (), SIZE * sizeof (int ));
@@ -245,7 +247,7 @@ TEST_P(umfIpcTest, BasicFlow) {
245
247
}
246
248
247
249
TEST_P (umfIpcTest, GetPoolByOpenedHandle) {
248
- constexpr size_t SIZE = 100 ;
250
+ size_t SIZE = COMMON_SIZE ;
249
251
constexpr size_t NUM_ALLOCS = 100 ;
250
252
constexpr size_t NUM_POOLS = 4 ;
251
253
void *ptrs[NUM_ALLOCS];
@@ -304,7 +306,7 @@ TEST_P(umfIpcTest, GetPoolByOpenedHandle) {
304
306
}
305
307
306
308
TEST_P (umfIpcTest, AllocFreeAllocTest) {
307
- constexpr size_t SIZE = 64 * 1024 ;
309
+ size_t SIZE = ( 64 * 1024 > COMMON_SIZE) ? 64 * 1024 : COMMON_SIZE ;
308
310
umf::pool_unique_handle_t pool = makePool ();
309
311
void *ptr = umfPoolMalloc (pool.get (), SIZE);
310
312
EXPECT_NE (ptr, nullptr );
@@ -361,7 +363,7 @@ TEST_P(umfIpcTest, AllocFreeAllocTest) {
361
363
}
362
364
363
365
TEST_P (umfIpcTest, openInTwoPools) {
364
- constexpr size_t SIZE = 100 ;
366
+ size_t SIZE = COMMON_SIZE ;
365
367
std::vector<int > expected_data (SIZE);
366
368
umf::pool_unique_handle_t pool1 = makePool ();
367
369
umf::pool_unique_handle_t pool2 = makePool ();
@@ -416,7 +418,7 @@ TEST_P(umfIpcTest, openInTwoPools) {
416
418
417
419
TEST_P (umfIpcTest, ConcurrentGetPutHandles) {
418
420
std::vector<void *> ptrs;
419
- constexpr size_t ALLOC_SIZE = 100 ;
421
+ size_t ALLOC_SIZE = COMMON_SIZE ;
420
422
constexpr size_t NUM_POINTERS = 100 ;
421
423
umf::pool_unique_handle_t pool = makePool ();
422
424
@@ -465,7 +467,7 @@ TEST_P(umfIpcTest, ConcurrentGetPutHandles) {
465
467
466
468
TEST_P (umfIpcTest, ConcurrentOpenCloseHandles) {
467
469
std::vector<void *> ptrs;
468
- constexpr size_t ALLOC_SIZE = 100 ;
470
+ size_t ALLOC_SIZE = COMMON_SIZE ;
469
471
constexpr size_t NUM_POINTERS = 100 ;
470
472
umf::pool_unique_handle_t pool = makePool ();
471
473
0 commit comments