aboutsummaryrefslogtreecommitdiff
path: root/repo_test.go
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-08-21 12:49:07 +0200
committern-peugnet <n.peugnet@free.fr>2021-08-21 12:49:07 +0200
commit4df6871c2642dded074db47a39c75722896f8f1e (patch)
treea7aa2ae8280000b4446318ed6dfb48837f79ef15 /repo_test.go
parent9a1aa7fe443438fdfdab89d77aa07c51b633644c (diff)
downloaddna-backup-4df6871c2642dded074db47a39c75722896f8f1e.tar.gz
dna-backup-4df6871c2642dded074db47a39c75722896f8f1e.zip
dont use channels for listfiles
Diffstat (limited to 'repo_test.go')
-rw-r--r--repo_test.go18
1 files changed, 7 insertions, 11 deletions
diff --git a/repo_test.go b/repo_test.go
index 956bd84..7c6316e 100644
--- a/repo_test.go
+++ b/repo_test.go
@@ -15,9 +15,8 @@ func prepareResult() {
func chunkCompare(t *testing.T, dataDir string, testFiles []string, chunkCount int) {
- files := make(chan File)
chunks := make(chan []byte)
- go ListFiles(dataDir, files)
+ files := ListFiles(dataDir)
go ReadFiles(files, chunks)
offset := 0
@@ -81,15 +80,12 @@ func TestLoadChunks(t *testing.T) {
prepareResult()
dataDir := path.Join("test", "data")
resultDir := path.Join("test", "result")
- files1 := make(chan File)
- files2 := make(chan File)
- chunks1 := make(chan []byte)
- chunks2 := make(chan []byte)
- chunks3 := make(chan []byte)
- go ListFiles(dataDir, files1)
- go ListFiles(dataDir, files2)
- go ReadFiles(files1, chunks1)
- go ReadFiles(files2, chunks2)
+ chunks1 := make(chan []byte, 16)
+ chunks2 := make(chan []byte, 16)
+ chunks3 := make(chan []byte, 16)
+ files := ListFiles(dataDir)
+ go ReadFiles(files, chunks1)
+ go ReadFiles(files, chunks2)
StoreChunks(resultDir, chunks1)
go LoadChunks(resultDir, chunks3)