Skip to content

Commit

Permalink
Refactor: Improve slotted page structure and error handling (master)
Browse files Browse the repository at this point in the history
Improved the structure and error handling of the
`SlottedPage` struct.  Added more robust checks for
out-of-bounds errors and improved clarity of method
implementations. Simplified some method logic and added
comments.  Improved error messages for better debugging.
  • Loading branch information
Anthony4m committed Feb 1, 2025
1 parent 0f112af commit 8dde3c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func TestLogIterator_EmptyIterator(t *testing.T) {
err := fm.Write(blk, page)
require.NoError(t, err)
bm := buffer.NewBufferMgr(fm, 3)
iterator := NewLogIterator(fm, bm, blk)
iterator, _ := NewLogIterator(fm, bm, blk)

assert.False(t, iterator.HasNext())
}
Expand Down Expand Up @@ -113,7 +113,7 @@ func TestMoveToBlock(t *testing.T) {
buff.SetContents(page)
bm := buffer.NewBufferMgr(fm, 3)
// Initialize LogIterator and move to block
iter := NewLogIterator(fm, bm, block)
iter, _ := NewLogIterator(fm, bm, block)
err = iter.moveToBlock(block)
require.NoError(t, err)

Expand Down

0 comments on commit 8dde3c0

Please sign in to comment.