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

Function TestInvalidArrayAllocation

internal/freelist/array_test.go:56–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

54}
55
56func TestInvalidArrayAllocation(t *testing.T) {
57 f := NewArrayFreelist()
58 // page 0 and 1 are reserved for meta pages, so they should never be free pages.
59 ids := []common.Pgid{1}
60 f.Init(ids)
61 require.Panics(t, func() {
62 f.Allocate(common.Txid(1), 1)
63 })
64}
65
66func Test_Freelist_Array_Rollback(t *testing.T) {
67 f := newTestArrayFreelist()

Callers

nothing calls this directly

Calls 4

TxidTypeAlias · 0.92
NewArrayFreelistFunction · 0.85
InitMethod · 0.65
AllocateMethod · 0.65

Tested by

no test coverage detected