@@ -190,25 +190,30 @@ INSTANTIATE_TEST_SUITE_P(devdaxProviderTest, umfProviderTest,
190190
191191TEST_P (umfProviderTest, create_destroy) {}
192192
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);
195195}
196196
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 ,
199199 PURGE_NONE);
200200}
201201
202202TEST_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);
204204}
205205
206206TEST_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);
208208}
209209
210210// negative tests using test_alloc_failure
211211
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+
212217TEST_P (umfProviderTest, alloc_page64_align_page_minus_1_WRONG_ALIGNMENT_1) {
213218 test_alloc_failure (provider.get (), page_plus_64, page_size - 1 ,
214219 UMF_RESULT_ERROR_INVALID_ARGUMENT, 0 );
@@ -231,7 +236,8 @@ TEST_P(umfProviderTest, alloc_3_pages_WRONG_ALIGNMENT_3_pages) {
231236}
232237
233238TEST_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 ,
235241 UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC,
236242 UMF_DEVDAX_RESULT_ERROR_ALLOC_FAILED);
237243}
0 commit comments