@@ -195,25 +195,30 @@ INSTANTIATE_TEST_SUITE_P(devdaxProviderTest, umfProviderTest,
195195
196196TEST_P (umfProviderTest, create_destroy) {}
197197
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);
200200}
201201
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 ,
204204 PURGE_NONE);
205205}
206206
207207TEST_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);
209209}
210210
211211TEST_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);
213213}
214214
215215// negative tests using test_alloc_failure
216216
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+
217222TEST_P (umfProviderTest, alloc_page64_align_page_minus_1_WRONG_ALIGNMENT_1) {
218223 test_alloc_failure (provider.get (), page_plus_64, page_size - 1 ,
219224 UMF_RESULT_ERROR_INVALID_ARGUMENT, 0 );
@@ -236,7 +241,8 @@ TEST_P(umfProviderTest, alloc_3_pages_WRONG_ALIGNMENT_3_pages) {
236241}
237242
238243TEST_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 ,
240246 UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC,
241247 UMF_DEVDAX_RESULT_ERROR_ALLOC_FAILED);
242248}
0 commit comments