diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-01-07 01:30:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-07 01:30:44 +0800 |
commit | ac93a6ff6cd1200ab0fb67a5bd0c02cb70646632 (patch) | |
tree | 2b06aa1b360f1488264058d04e399e84b898f0d8 /node | |
parent | 444fc892b0a860218dab3e421d92c33408b9eb6d (diff) | |
parent | 13e3b2f433c48fe81423c1a13e9a5194ece61b01 (diff) | |
download | dexon-ac93a6ff6cd1200ab0fb67a5bd0c02cb70646632.tar.gz dexon-ac93a6ff6cd1200ab0fb67a5bd0c02cb70646632.tar.zst dexon-ac93a6ff6cd1200ab0fb67a5bd0c02cb70646632.zip |
Merge pull request #3525 from fjl/all-gosimple-cleanup
all: clean up lint issues, remove more dead code
Diffstat (limited to 'node')
-rw-r--r-- | node/config_test.go | 2 | ||||
-rw-r--r-- | node/node_test.go | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/node/config_test.go b/node/config_test.go index b258d2a8b..d18732fdb 100644 --- a/node/config_test.go +++ b/node/config_test.go @@ -137,7 +137,7 @@ func TestNodeKeyPersistency(t *testing.T) { if err != nil { t.Fatalf("failed to read previously persisted node key: %v", err) } - if bytes.Compare(blob1, blob2) != 0 { + if !bytes.Equal(blob1, blob2) { t.Fatalf("persisted node key mismatch: have %x, want %x", blob2, blob1) } diff --git a/node/node_test.go b/node/node_test.go index d9b26453b..408d4cfcb 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -166,7 +166,7 @@ func TestServiceLifeCycle(t *testing.T) { if err := stack.Start(); err != nil { t.Fatalf("failed to start protocol stack: %v", err) } - for id, _ := range services { + for id := range services { if !started[id] { t.Fatalf("service %s: freshly started service not running", id) } @@ -178,7 +178,7 @@ func TestServiceLifeCycle(t *testing.T) { if err := stack.Stop(); err != nil { t.Fatalf("failed to stop protocol stack: %v", err) } - for id, _ := range services { + for id := range services { if !stopped[id] { t.Fatalf("service %s: freshly terminated service still running", id) } @@ -218,7 +218,7 @@ func TestServiceRestarts(t *testing.T) { } defer stack.Stop() - if running != true || started != 1 { + if !running || started != 1 { t.Fatalf("running/started mismatch: have %v/%d, want true/1", running, started) } // Restart the stack a few times and check successful service restarts @@ -227,7 +227,7 @@ func TestServiceRestarts(t *testing.T) { t.Fatalf("iter %d: failed to restart stack: %v", i, err) } } - if running != true || started != 4 { + if !running || started != 4 { t.Fatalf("running/started mismatch: have %v/%d, want true/4", running, started) } } @@ -270,7 +270,7 @@ func TestServiceConstructionAbortion(t *testing.T) { if err := stack.Start(); err != failure { t.Fatalf("iter %d: stack startup failure mismatch: have %v, want %v", i, err, failure) } - for id, _ := range services { + for id := range services { if started[id] { t.Fatalf("service %s: started should not have", id) } @@ -322,7 +322,7 @@ func TestServiceStartupAbortion(t *testing.T) { if err := stack.Start(); err != failure { t.Fatalf("iter %d: stack startup failure mismatch: have %v, want %v", i, err, failure) } - for id, _ := range services { + for id := range services { if started[id] && !stopped[id] { t.Fatalf("service %s: started but not stopped", id) } @@ -376,7 +376,7 @@ func TestServiceTerminationGuarantee(t *testing.T) { if err := stack.Start(); err != nil { t.Fatalf("iter %d: failed to start protocol stack: %v", i, err) } - for id, _ := range services { + for id := range services { if !started[id] { t.Fatalf("iter %d, service %s: service not running", i, id) } @@ -397,7 +397,7 @@ func TestServiceTerminationGuarantee(t *testing.T) { t.Fatalf("iter %d: failure count mismatch: have %d, want %d", i, len(err.Services), 1) } } - for id, _ := range services { + for id := range services { if !stopped[id] { t.Fatalf("iter %d, service %s: service not terminated", i, id) } |