(t *testing.T, dbPath string, o *bolt.Options)
| 232 | } |
| 233 | |
| 234 | func mustOpenDB(t *testing.T, dbPath string, o *bolt.Options) *bolt.DB { |
| 235 | t.Logf("Opening bbolt DB at: %s", dbPath) |
| 236 | if o == nil { |
| 237 | o = bolt.DefaultOptions |
| 238 | } |
| 239 | |
| 240 | freelistType := bolt.FreelistArrayType |
| 241 | if env := os.Getenv("TEST_FREELIST_TYPE"); env == string(bolt.FreelistMapType) { |
| 242 | freelistType = bolt.FreelistMapType |
| 243 | } |
| 244 | |
| 245 | o.FreelistType = freelistType |
| 246 | |
| 247 | db, err := bolt.Open(dbPath, 0600, o) |
| 248 | require.NoError(t, err) |
| 249 | |
| 250 | return db |
| 251 | } |
| 252 | |
| 253 | func checkConsistency(t *testing.T, db *bolt.DB) error { |
| 254 | return db.View(func(tx *bolt.Tx) error { |
no outgoing calls
no test coverage detected