From 0abb4099f6da3cec4361c932bb625813d7c94975 Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Mon, 25 Nov 2019 15:44:03 -0500 Subject: [PATCH] Fixed test errors -- parse test flags in one place --- src/duplicacy_chunk_test.go | 9 --------- src/duplicacy_storage_test.go | 2 ++ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/duplicacy_chunk_test.go b/src/duplicacy_chunk_test.go index 8dd80aa..6105182 100644 --- a/src/duplicacy_chunk_test.go +++ b/src/duplicacy_chunk_test.go @@ -5,7 +5,6 @@ package duplicacy import ( - "flag" "bytes" crypto_rand "crypto/rand" "crypto/rsa" @@ -13,14 +12,6 @@ import ( "testing" ) -var testRSAEncryption bool - -func init() { - flag.BoolVar(&testRSAEncryption, "rsa", false, "enable RSA encryption") - flag.Parse() -} - - func TestChunk(t *testing.T) { key := []byte("duplicacydefault") diff --git a/src/duplicacy_storage_test.go b/src/duplicacy_storage_test.go index 0d1f1b3..4cffdbc 100644 --- a/src/duplicacy_storage_test.go +++ b/src/duplicacy_storage_test.go @@ -27,6 +27,7 @@ var testRateLimit int var testQuickMode bool var testThreads int var testFixedChunkSize bool +var testRSAEncryption bool func init() { flag.StringVar(&testStorageName, "storage", "", "the test storage to use") @@ -34,6 +35,7 @@ func init() { flag.BoolVar(&testQuickMode, "quick", false, "quick test") flag.IntVar(&testThreads, "threads", 1, "number of downloading/uploading threads") flag.BoolVar(&testFixedChunkSize, "fixed-chunk-size", false, "fixed chunk size") + flag.BoolVar(&testRSAEncryption, "rsa", false, "enable RSA encryption") flag.Parse() }