Actually assign _entryCount field in BucketTree

This commit is contained in:
Alex Barney 2022-02-03 18:38:27 -07:00
parent 49759d3d10
commit 1597f05b27
2 changed files with 9 additions and 0 deletions

View file

@ -541,6 +541,7 @@ public partial class BucketTree : IDisposable
_entryStorage.Set(in entryStorage);
_nodeSize = nodeSize;
_entrySize = entrySize;
_entryCount = entryCount;
_offsetCount = offsetCount;
_entrySetCount = entrySetCount;
_offsetCache.IsInitialized = true;

View file

@ -182,4 +182,12 @@ public class BucketTreeTests : IClassFixture<BucketTreeBuffers>
Assert.Equal(expectedEntry.StorageIndex, actualEntry.StorageIndex);
}
}
[Theory, MemberData(nameof(BucketTreeTestTheoryData))]
private void GetEntryCount_ReturnsCorrectCount(int treeIndex)
{
BucketTree tree = _treeData[treeIndex].CreateBucketTree();
Assert.Equal(_treeData[treeIndex].EntryCount, tree.GetEntryCount());
}
}