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