@@ -446,8 +446,8 @@ TEST_CASE ("free_list_resource (backed by buffer)", "[memory_resource]")
446446
447447 // Check that the two areas either side of the still-active pointer
448448 // can be re-merged in a defragmentation step.
449- CHECK (res.allocate (largeBlockSize, alignment));
450- CHECK (res.allocate (largeBlockSize, alignment));
449+ CHECK (res.allocate (largeBlockSize, alignment) != nullptr );
450+ CHECK (res.allocate (largeBlockSize, alignment) != nullptr );
451451 CHECK_THROWS_AS (res.allocate (largeBlockSize, alignment), std::bad_alloc);
452452 }
453453}
@@ -494,7 +494,7 @@ TEST_CASE ("free_list_resource (backed by upstream resource)", "[memory_resource
494494 res.expand (upstream.allocate (256 , 1 ), 256 );
495495 const auto used = upstream.total_allocated ();
496496
497- CHECK (res.allocate (160 , 1 ));
497+ CHECK (res.allocate (160 , 1 ) != nullptr );
498498 CHECK (upstream.total_allocated () == used);
499499 }
500500
@@ -523,7 +523,7 @@ TEST_CASE ("free_list_resource (backed by upstream resource)", "[memory_resource
523523 SECTION (" Allocation that cannot be satisfied (allocate from upstream)" )
524524 {
525525 // Now it must allocate, because no single chunk has the required space left
526- CHECK (res.allocate (200 , 1 ));
526+ CHECK (res.allocate (200 , 1 ) != nullptr );
527527 CHECK (upstream.total_allocated () == used + minChunkSize);
528528 }
529529
@@ -533,7 +533,7 @@ TEST_CASE ("free_list_resource (backed by upstream resource)", "[memory_resource
533533 auto size = GENERATE (as<std::size_t >(), 160 , 200 , 230 );
534534
535535 res.deallocate (ptr2, 200 , 1 );
536- CHECK (res.allocate (size, 1 ));
536+ CHECK (res.allocate (size, 1 ) != nullptr );
537537 CHECK (upstream.total_allocated () == used);
538538 }
539539 }
@@ -565,19 +565,17 @@ TEST_CASE ("free_list_resource (backed by upstream resource)", "[memory_resource
565565
566566 SECTION (" When defragmentation can find a large enough block" )
567567 {
568- auto ptr5 = res.allocate (710 , 1 ); // triggers defragmentation
569- CHECK_FALSE (ptr5 == nullptr );
568+ CHECK (res.allocate (710 , 1 ) != nullptr ); // triggers defragmentation
570569 CHECK (upstream.total_allocated () == 256 ); // served from existing chunks
571570 }
572571
573572 SECTION (" When defragmentation can't find a block" )
574573 {
575- auto ptr5 = res.allocate (780 , 1 ); // too large, even after degfragmentation
576- CHECK_FALSE (ptr5 == nullptr );
574+ CHECK (res.allocate (780 , 1 ) != nullptr ); // too large, even after degfragmentation
577575 auto used = upstream.total_allocated ();
578576 CHECK (used > 256 ); // served from upstream
579577
580- CHECK (res.allocate (720 , 1 )); // can still use block found during defragmentation
578+ CHECK (res.allocate (720 , 1 ) != nullptr ); // can still use block found during defragmentation
581579 CHECK (upstream.total_allocated () == used);
582580 }
583581 }
0 commit comments