]> Sergey Matveev's repositories - btrtrc.git/blob - undirtied-chunks-iter_test.go
Add a test for allocations in undirtiedChunksIter.Iter
[btrtrc.git] / undirtied-chunks-iter_test.go
1 package torrent
2
3 import (
4         "testing"
5
6         "github.com/RoaringBitmap/roaring"
7 )
8
9 func BenchmarkUndirtiedChunksIter(b *testing.B) {
10         var bitmap roaring.Bitmap
11         a := undirtiedChunksIter{
12                 TorrentDirtyChunks: &bitmap,
13                 StartRequestIndex:  69,
14                 EndRequestIndex:    420,
15         }
16         b.ReportAllocs()
17         for i := 0; i < b.N; i++ {
18                 a.Iter(func(chunkIndex chunkIndexType) {
19
20                 })
21         }
22 }