From 68ad77ee9982a88cb1db971f69cd51289cce80d7 Mon Sep 17 00:00:00 2001 From: Grisha Kotler Date: Thu, 21 Nov 2024 22:57:49 +0200 Subject: [PATCH] RavenDB-22986 - update test --- test/FastTests/Voron/Trees/FreeSpaceTest.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/FastTests/Voron/Trees/FreeSpaceTest.cs b/test/FastTests/Voron/Trees/FreeSpaceTest.cs index 2468156a882c..ffdb3f191f1e 100644 --- a/test/FastTests/Voron/Trees/FreeSpaceTest.cs +++ b/test/FastTests/Voron/Trees/FreeSpaceTest.cs @@ -290,9 +290,14 @@ public void CanUpdateMaxConsecutiveRanges() var max = Env.FreeSpaceHandling.GetMaxConsecutiveRangePerSection(tx.LowLevelTransaction); Assert.Equal(5, max.Count); - for (var i = 0; i < totalSections - 1; i++) + Assert.Equal(1, max[0].Max); + Assert.Equal(FreeSpaceHandling.NumberOfPagesInSection, max[0].StartBits); + Assert.Equal(0, max[0].EndBits); + + for (var i = 1; i < totalSections - 1; i++) { Assert.Equal(1, max[i].Max); + Assert.Equal(1, max[i].StartBits); Assert.Equal(0, max[i].EndBits); } @@ -300,7 +305,9 @@ public void CanUpdateMaxConsecutiveRanges() Assert.Equal(1, max[3].StartBits); Assert.Equal(1, max[3].EndBits); + Assert.Equal(FreeSpaceHandling.NumberOfPagesInSection, max[4].Max); Assert.Equal(0, max[4].StartBits); + Assert.Equal(FreeSpaceHandling.NumberOfPagesInSection, max[4].EndBits); // releasing 2 pages in section 4 to make 3 consecutive pages between two sections Env.FreeSpaceHandling.FreePage(tx.LowLevelTransaction, totalPages); @@ -310,6 +317,8 @@ public void CanUpdateMaxConsecutiveRanges() max = Env.FreeSpaceHandling.GetMaxConsecutiveRangePerSection(tx.LowLevelTransaction); Assert.Equal(4, max.Count); + Assert.Equal(FreeSpaceHandling.NumberOfPagesInSection, max[0].StartBits); + for (var i = 0; i < totalSections - 1; i++) { Assert.Equal(1, max[i].Max); @@ -332,6 +341,8 @@ public void CanUpdateMaxConsecutiveRanges() var max = Env.FreeSpaceHandling.GetMaxConsecutiveRangePerSection(tx.LowLevelTransaction); + Assert.Equal(FreeSpaceHandling.NumberOfPagesInSection, max[0].StartBits); + for (var i = 0; i < totalSections - 1; i++) { Assert.Equal(3, max[i].Max); @@ -346,6 +357,8 @@ public void CanUpdateMaxConsecutiveRanges() Assert.Equal(2, max[4].StartBits); Assert.Equal(0, max[5].StartBits); + Assert.Equal(FreeSpaceHandling.NumberOfPagesInSection, max[5].EndBits); + Assert.Equal(FreeSpaceHandling.NumberOfPagesInSection, max[5].Max); var page = tx.LowLevelTransaction.AllocatePage(3); Assert.Equal(lastPageInAllSections, page.PageNumber);