aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/filechunk_group_test.go
blob: d24d66a49efc16cc04af82fc8a4feb18240503b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package filer

import (
	"github.com/stretchr/testify/assert"
	"testing"
)

func TestChunkGroup_doSearchChunks(t *testing.T) {
	type fields struct {
		sections map[SectionIndex]*FileChunkSection
	}
	type args struct {
		offset   int64
		fileSize int64
		whence   uint32
	}
	tests := []struct {
		name      string
		fields    fields
		args      args
		wantFound bool
		wantOut   int64
	}{
		// TODO: Add test cases.
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			group := &ChunkGroup{
				sections: tt.fields.sections,
			}
			gotFound, gotOut := group.doSearchChunks(tt.args.offset, tt.args.fileSize, tt.args.whence)
			assert.Equalf(t, tt.wantFound, gotFound, "doSearchChunks(%v, %v, %v)", tt.args.offset, tt.args.fileSize, tt.args.whence)
			assert.Equalf(t, tt.wantOut, gotOut, "doSearchChunks(%v, %v, %v)", tt.args.offset, tt.args.fileSize, tt.args.whence)
		})
	}
}