@@ -195,25 +195,30 @@ INSTANTIATE_TEST_SUITE_P(devdaxProviderTest, umfProviderTest,
195
195
196
196
TEST_P (umfProviderTest, create_destroy) {}
197
197
198
- TEST_P (umfProviderTest, alloc_page64_align_0 ) {
199
- test_alloc_free_success (provider.get (), page_plus_64 , 0 , PURGE_NONE);
198
+ TEST_P (umfProviderTest, alloc_page_align_0 ) {
199
+ test_alloc_free_success (provider.get (), page_size , 0 , PURGE_NONE);
200
200
}
201
201
202
- TEST_P (umfProviderTest, alloc_page64_align_page_div_2 ) {
203
- test_alloc_free_success (provider.get (), page_plus_64, page_size / 2 ,
202
+ TEST_P (umfProviderTest, alloc_2page_align_page_size ) {
203
+ test_alloc_free_success (provider.get (), 2 * page_size, page_size ,
204
204
PURGE_NONE);
205
205
}
206
206
207
207
TEST_P (umfProviderTest, purge_lazy) {
208
- test_alloc_free_success (provider.get (), page_plus_64 , 0 , PURGE_LAZY);
208
+ test_alloc_free_success (provider.get (), page_size , 0 , PURGE_LAZY);
209
209
}
210
210
211
211
TEST_P (umfProviderTest, purge_force) {
212
- test_alloc_free_success (provider.get (), page_plus_64 , 0 , PURGE_FORCE);
212
+ test_alloc_free_success (provider.get (), page_size , 0 , PURGE_FORCE);
213
213
}
214
214
215
215
// negative tests using test_alloc_failure
216
216
217
+ TEST_P (umfProviderTest, alloc_page64_align_page_div_2) {
218
+ test_alloc_failure (provider.get (), page_plus_64, page_size / 2 ,
219
+ UMF_RESULT_ERROR_INVALID_ARGUMENT, 0 );
220
+ }
221
+
217
222
TEST_P (umfProviderTest, alloc_page64_align_page_minus_1_WRONG_ALIGNMENT_1) {
218
223
test_alloc_failure (provider.get (), page_plus_64, page_size - 1 ,
219
224
UMF_RESULT_ERROR_INVALID_ARGUMENT, 0 );
@@ -236,7 +241,8 @@ TEST_P(umfProviderTest, alloc_3_pages_WRONG_ALIGNMENT_3_pages) {
236
241
}
237
242
238
243
TEST_P (umfProviderTest, alloc_WRONG_SIZE) {
239
- test_alloc_failure (provider.get (), -1 , 0 ,
244
+ size_t size = (size_t )(-1 ) & ~(page_size - 1 );
245
+ test_alloc_failure (provider.get (), size, 0 ,
240
246
UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC,
241
247
UMF_DEVDAX_RESULT_ERROR_ALLOC_FAILED);
242
248
}
0 commit comments