(t *testing.T)
| 235 | } |
| 236 | |
| 237 | func TestFreeList_init(t *testing.T) { |
| 238 | buf := make([]byte, 4096) |
| 239 | f := newTestFreelist() |
| 240 | f.Init(common.Pgids{5, 6, 8}) |
| 241 | |
| 242 | p := common.LoadPage(buf) |
| 243 | f.Write(p) |
| 244 | |
| 245 | f2 := newTestFreelist() |
| 246 | f2.Read(p) |
| 247 | require.Equal(t, common.Pgids{5, 6, 8}, f2.freePageIds()) |
| 248 | |
| 249 | // When initializing the freelist with an empty list of page ID, |
| 250 | // it should reset the freelist page IDs. |
| 251 | f2.Init([]common.Pgid{}) |
| 252 | require.Equal(t, common.Pgids{}, f2.freePageIds()) |
| 253 | } |
| 254 | |
| 255 | func TestFreeList_reload(t *testing.T) { |
| 256 | buf := make([]byte, 4096) |
nothing calls this directly
no test coverage detected