Skip to content

Commit

Permalink
make CI happy
Browse files Browse the repository at this point in the history
  • Loading branch information
lyoshenka committed Aug 16, 2018
1 parent 7588621 commit 65df7bc
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions reflector/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package reflector
import (
"crypto/rand"
"io"
"math"
"strconv"
"testing"
"time"
Expand Down Expand Up @@ -168,12 +167,14 @@ func TestServer_PartialUpload(t *testing.T) {
missing[i] = bits.Rand().String()
}

var st store.BlobStore
st = &mockPartialStore{missing: missing}
st := store.BlobStore(&mockPartialStore{missing: missing})
if _, ok := st.(neededBlobChecker); !ok {
t.Fatal("mock does not implement the relevant interface")
}
st.Put(sdHash, randBlob(10))
err = st.Put(sdHash, randBlob(10))
if err != nil {
t.Fatal(err)
}

srv := NewServer(st)
err = srv.Start("127.0.0.1:" + strconv.Itoa(port))
Expand Down Expand Up @@ -225,15 +226,17 @@ func TestServer_PartialUpload(t *testing.T) {
}
}

func MakeRandStream(size int) ([]byte, [][]byte) {
blobs := make([][]byte, int(math.Ceil(float64(size)/maxBlobSize)))
for i := 0; i < len(blobs); i++ {
blobs[i] = randBlob(int(math.Min(maxBlobSize, float64(size))))
size -= maxBlobSize
}

return nil, blobs
}
//func MakeRandStream(size int) ([]byte, [][]byte) {
// blobs := make([][]byte, int(math.Ceil(float64(size)/maxBlobSize)))
// for i := 0; i < len(blobs); i++ {
// blobs[i] = randBlob(int(math.Min(maxBlobSize, float64(size))))
// size -= maxBlobSize
// }
//
// //TODO: create SD blob for the stream
//
// return nil, blobs
//}

func randBlob(size int) []byte {
//if size > maxBlobSize {
Expand Down

0 comments on commit 65df7bc

Please sign in to comment.