MCPcopy
hub / github.com/etcd-io/bbolt / TestFreelist_free

Function TestFreelist_free

internal/freelist/freelist_test.go:24–30  ·  view source on GitHub ↗

Ensure that a page is added to a transaction's freelist.

(t *testing.T)

Source from the content-addressed store, hash-verified

22
23// Ensure that a page is added to a transaction's freelist.
24func TestFreelist_free(t *testing.T) {
25 f := newTestFreelist()
26 f.Free(100, common.NewPage(12, 0, 0, 0))
27 if !reflect.DeepEqual([]common.Pgid{12}, f.pendingPageIds()[100].ids) {
28 t.Fatalf("exp=%v; got=%v", []common.Pgid{12}, f.pendingPageIds()[100].ids)
29 }
30}
31
32// Ensure that a page and its overflow is added to a transaction's freelist.
33func TestFreelist_free_overflow(t *testing.T) {

Callers

nothing calls this directly

Calls 5

NewPageFunction · 0.92
newTestFreelistFunction · 0.85
FreeMethod · 0.65
pendingPageIdsMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected