From: Matt Joiner Date: Thu, 24 Mar 2016 12:52:38 +0000 (+1100) Subject: Tidy up a test that fails with the wrong reasons X-Git-Tag: v1.0.0~819 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ac184c8f52414239c0775793ca2222e2bd1942be;p=btrtrc.git Tidy up a test that fails with the wrong reasons --- diff --git a/client_test.go b/client_test.go index ccb60b5d..9760a8ab 100644 --- a/client_test.go +++ b/client_test.go @@ -234,18 +234,15 @@ func TestTwoClientsArbitraryPorts(t *testing.T) { } func TestAddDropManyTorrents(t *testing.T) { - cl, _ := NewClient(&TestingConfig) + cl, err := NewClient(&TestingConfig) + require.NoError(t, err) defer cl.Close() for i := range iter.N(1000) { var spec TorrentSpec binary.PutVarint(spec.InfoHash[:], int64(i)) tt, new, err := cl.AddTorrentSpec(&spec) - if err != nil { - t.Error(err) - } - if !new { - t.FailNow() - } + assert.NoError(t, err) + assert.True(t, new) defer tt.Drop() } }