(t testing.TB, db *bbolt.DB, bucketName []byte)
| 190 | } |
| 191 | |
| 192 | func corruptRootPage(t testing.TB, db *bbolt.DB, bucketName []byte) { |
| 193 | bucketRootPageId := mustGetBucketRootPage(t, db, bucketName) |
| 194 | bucketRootPage, bucketRootPageBuf, err := guts_cli.ReadPage(db.Path(), uint64(bucketRootPageId)) |
| 195 | require.NoError(t, err) |
| 196 | require.True(t, bucketRootPage.IsBranchPage()) |
| 197 | |
| 198 | bucketRootPage.SetFlags(0) |
| 199 | |
| 200 | err = guts_cli.WritePage(db.Path(), bucketRootPageBuf) |
| 201 | require.NoError(t, err) |
| 202 | } |
| 203 | |
| 204 | // mustGetBucketRootPage returns the root page for the provided bucket. |
| 205 | func mustGetBucketRootPage(t testing.TB, db *bbolt.DB, bucketName []byte) common.Pgid { |
no test coverage detected