]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Tidy up a test that fails with the wrong reasons
authorMatt Joiner <anacrolix@gmail.com>
Thu, 24 Mar 2016 12:52:38 +0000 (23:52 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 24 Mar 2016 12:52:38 +0000 (23:52 +1100)
client_test.go

index ccb60b5d64d2e19a7094a4b72192c0b94cd49464..9760a8ab5544b2e9a49297d0147b33c22aae8aab 100644 (file)
@@ -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()
        }
 }