mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-20 10:13:20 +00:00
Fixed test errors -- parse test flags in one place
This commit is contained in:
@@ -5,7 +5,6 @@
|
|||||||
package duplicacy
|
package duplicacy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
|
||||||
"bytes"
|
"bytes"
|
||||||
crypto_rand "crypto/rand"
|
crypto_rand "crypto/rand"
|
||||||
"crypto/rsa"
|
"crypto/rsa"
|
||||||
@@ -13,14 +12,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
var testRSAEncryption bool
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
flag.BoolVar(&testRSAEncryption, "rsa", false, "enable RSA encryption")
|
|
||||||
flag.Parse()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
func TestChunk(t *testing.T) {
|
func TestChunk(t *testing.T) {
|
||||||
|
|
||||||
key := []byte("duplicacydefault")
|
key := []byte("duplicacydefault")
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ var testRateLimit int
|
|||||||
var testQuickMode bool
|
var testQuickMode bool
|
||||||
var testThreads int
|
var testThreads int
|
||||||
var testFixedChunkSize bool
|
var testFixedChunkSize bool
|
||||||
|
var testRSAEncryption bool
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
flag.StringVar(&testStorageName, "storage", "", "the test storage to use")
|
flag.StringVar(&testStorageName, "storage", "", "the test storage to use")
|
||||||
@@ -34,6 +35,7 @@ func init() {
|
|||||||
flag.BoolVar(&testQuickMode, "quick", false, "quick test")
|
flag.BoolVar(&testQuickMode, "quick", false, "quick test")
|
||||||
flag.IntVar(&testThreads, "threads", 1, "number of downloading/uploading threads")
|
flag.IntVar(&testThreads, "threads", 1, "number of downloading/uploading threads")
|
||||||
flag.BoolVar(&testFixedChunkSize, "fixed-chunk-size", false, "fixed chunk size")
|
flag.BoolVar(&testFixedChunkSize, "fixed-chunk-size", false, "fixed chunk size")
|
||||||
|
flag.BoolVar(&testRSAEncryption, "rsa", false, "enable RSA encryption")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user