started dpa_test

This commit is contained in:
zelig 2015-02-06 17:52:07 +01:00
parent 71f1695b87
commit dca79894d1
3 changed files with 12 additions and 13 deletions

View file

@ -2,7 +2,6 @@ package bzz
import ( import (
"bytes" "bytes"
"crypto/rand"
"fmt" "fmt"
"testing" "testing"
"time" "time"
@ -14,15 +13,6 @@ import (
Tests TreeChunker by splitting and joining a random byte slice Tests TreeChunker by splitting and joining a random byte slice
*/ */
func testDataReader(l int) (r *ChunkReader, slice []byte) {
slice = make([]byte, l)
if _, err := rand.Read(slice); err != nil {
panic("rand error")
}
r = NewChunkReaderFromBytes(slice)
return
}
type chunkerTester struct { type chunkerTester struct {
errors []error errors []error
chunks []*Chunk chunks []*Chunk

View file

@ -5,6 +5,15 @@ import (
"testing" "testing"
) )
func testDataReader(l int) (r *ChunkReader, slice []byte) {
slice = make([]byte, l)
if _, err := rand.Read(slice); err != nil {
panic("rand error")
}
r = NewChunkReaderFromBytes(slice)
return
}
func randomChunks(l int64, branches int64, chunkC chan *Chunk) (key Key, errC chan error) { func randomChunks(l int64, branches int64, chunkC chan *Chunk) (key Key, errC chan error) {
chunker := &TreeChunker{ chunker := &TreeChunker{
Branches: branches, Branches: branches,

View file

@ -1,5 +1,5 @@
// test bench for the package blockhash
package bzz package bzz
import () import (
// "github.com/ethereum/go-ethereum/bzz/test"
)