File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,11 @@ class MemoryTiersTest: public AllocatorTest<Allocator> {
5252 [&](const size_t i, const MemoryTierCacheConfig& config) { return i + config.calculateTierSize (actualConfig.getCacheSize (), sum_ratios);});
5353
5454
55- EXPECT_EQ (sum_sizes, expectedTotalCacheSize);
56- size_t partition_size = 0 , remaining_capacity = actualConfig.getCacheSize ();
55+ size_t partition_size = 0 ;
5756 if (sum_ratios) {
5857 partition_size = actualConfig.getCacheSize () / sum_ratios;
58+ /* Sum of sizes can be lower due to rounding down to partition_size. */
59+ EXPECT_GE (sum_sizes, expectedTotalCacheSize - partition_size);
5960 }
6061
6162 for (auto i = 0 ; i < configs.size (); ++i) {
@@ -66,10 +67,7 @@ class MemoryTiersTest: public AllocatorTest<Allocator> {
6667 if (configs[i].getRatio () && (i < configs.size () - 1 )) {
6768 EXPECT_EQ (tierSize, partition_size * configs[i].getRatio ());
6869 }
69- remaining_capacity -= tierSize;
7070 }
71-
72- EXPECT_EQ (remaining_capacity, 0 );
7371 }
7472
7573 LruAllocatorConfig createTestCacheConfig (
You can’t perform that action at this time.
0 commit comments