filechunk_group_test.go 896 B

123456789101112131415161718192021222324252627282930313233343536
  1. package filer
  2. import (
  3. "github.com/stretchr/testify/assert"
  4. "testing"
  5. )
  6. func TestChunkGroup_doSearchChunks(t *testing.T) {
  7. type fields struct {
  8. sections map[SectionIndex]*FileChunkSection
  9. }
  10. type args struct {
  11. offset int64
  12. fileSize int64
  13. whence uint32
  14. }
  15. tests := []struct {
  16. name string
  17. fields fields
  18. args args
  19. wantFound bool
  20. wantOut int64
  21. }{
  22. // TODO: Add test cases.
  23. }
  24. for _, tt := range tests {
  25. t.Run(tt.name, func(t *testing.T) {
  26. group := &ChunkGroup{
  27. sections: tt.fields.sections,
  28. }
  29. gotFound, gotOut := group.doSearchChunks(tt.args.offset, tt.args.fileSize, tt.args.whence)
  30. assert.Equalf(t, tt.wantFound, gotFound, "doSearchChunks(%v, %v, %v)", tt.args.offset, tt.args.fileSize, tt.args.whence)
  31. assert.Equalf(t, tt.wantOut, gotOut, "doSearchChunks(%v, %v, %v)", tt.args.offset, tt.args.fileSize, tt.args.whence)
  32. })
  33. }
  34. }