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

Function TestFreelist_free_overflow

internal/freelist/freelist_test.go:33–39  ·  view source on GitHub ↗

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

(t *testing.T)

Source from the content-addressed store, hash-verified

31
32// Ensure that a page and its overflow is added to a transaction's freelist.
33func TestFreelist_free_overflow(t *testing.T) {
34 f := newTestFreelist()
35 f.Free(100, common.NewPage(12, 0, 0, 3))
36 if exp := []common.Pgid{12, 13, 14, 15}; !reflect.DeepEqual(exp, f.pendingPageIds()[100].ids) {
37 t.Fatalf("exp=%v; got=%v", exp, f.pendingPageIds()[100].ids)
38 }
39}
40
41// Ensure that double freeing a page is causing a panic
42func TestFreelist_free_double_free_panics(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