(t *testing.T, db *btesting.DB, chunkId int)
| 75 | } |
| 76 | |
| 77 | func insertChunk(t *testing.T, db *btesting.DB, chunkId int) { |
| 78 | chunkSize := 1024 |
| 79 | |
| 80 | if err := db.Update(func(tx *bolt.Tx) error { |
| 81 | b, err := tx.CreateBucketIfNotExists([]byte("bucket")) |
| 82 | if err != nil { |
| 83 | t.Fatal(err) |
| 84 | } |
| 85 | |
| 86 | for i := 0; i < chunkSize; i++ { |
| 87 | key := []byte(fmt.Sprintf("key-%d-%d", chunkId, i)) |
| 88 | value := []byte("value") |
| 89 | if err := b.Put(key, value); err != nil { |
| 90 | t.Fatal(err) |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | return nil |
| 95 | }); err != nil { |
| 96 | t.Fatal(err) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | // Main reason for this check is travis limiting mlockable memory to 64KB |
| 101 | // https://github.com/travis-ci/travis-ci/issues/2462 |
no test coverage detected