Convenience function for inserting a bunch of keys with values of a specific size (in bytes)
(db *btesting.DB, numKeys, valueSize int)
| 1518 | |
| 1519 | // Convenience function for inserting a bunch of keys with values of a specific size (in bytes) |
| 1520 | func fillDBWithKeys(db *btesting.DB, numKeys, valueSize int) error { |
| 1521 | return db.Fill([]byte("data"), 1, numKeys, |
| 1522 | func(tx int, k int) []byte { return []byte(fmt.Sprintf("%04d", k)) }, |
| 1523 | func(tx int, k int) []byte { return make([]byte, valueSize) }, |
| 1524 | ) |
| 1525 | } |
| 1526 | |
| 1527 | // Creates a new database size, forces a specific allocation size jump, and fills it with the number of keys specified |
| 1528 | func createFilledDB(t testing.TB, o *bolt.Options, allocSize int, numKeys int) *btesting.DB { |
no test coverage detected