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

Function TestFreelist_E2E_RollbackPanics

internal/freelist/freelist_test.go:437–448  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

435}
436
437func TestFreelist_E2E_RollbackPanics(t *testing.T) {
438 freelist := newTestFreelist()
439 freelist.Init([]common.Pgid{5})
440 requirePages(t, freelist, common.Pgids{5}, common.Pgids{})
441
442 _ = freelist.Allocate(common.Txid(5), 1)
443 require.Panics(t, func() {
444 // depending on the verification level, either should panic
445 freelist.Free(common.Txid(5), common.NewPage(5, common.LeafPageFlag, 0, 0))
446 freelist.Rollback(5)
447 })
448}
449
450// tests the reloading from another physical page
451func TestFreelist_E2E_Reload(t *testing.T) {

Callers

nothing calls this directly

Calls 8

TxidTypeAlias · 0.92
NewPageFunction · 0.92
newTestFreelistFunction · 0.85
requirePagesFunction · 0.85
InitMethod · 0.65
AllocateMethod · 0.65
FreeMethod · 0.65
RollbackMethod · 0.65

Tested by

no test coverage detected