diff options
author | Jeff Bean <bean@uber.com> | 2018-06-22 19:12:33 -0700 |
---|---|---|
committer | Jeff Bean <bean@uber.com> | 2018-06-22 19:12:33 -0700 |
commit | 154650594c5b40b2905eb73b90f52de72f6ced16 (patch) | |
tree | 2ba6ffe099ff216a92df7fb3806eb9aeaa988208 /packet/rtr | |
parent | 954562d65a90af4e8d2e9bf29e4c2bccc4420b38 (diff) |
Fixing all megacheck errors.
Diffstat (limited to 'packet/rtr')
-rw-r--r-- | packet/rtr/rtr_test.go | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/packet/rtr/rtr_test.go b/packet/rtr/rtr_test.go index 961805d5..08f930b2 100644 --- a/packet/rtr/rtr_test.go +++ b/packet/rtr/rtr_test.go @@ -19,26 +19,22 @@ import ( "encoding/hex" "math/rand" "net" - "reflect" "testing" "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func verifyRTRMessage(t *testing.T, m1 RTRMessage) { buf1, _ := m1.Serialize() m2, err := ParseRTR(buf1) - if err != nil { - t.Error(err) - } - buf2, _ := m2.Serialize() - - if reflect.DeepEqual(buf1, buf2) == true { - t.Log("OK") - } else { - t.Errorf("Something wrong") - t.Error(len(buf1), m1, hex.EncodeToString(buf1)) - t.Error(len(buf2), m2, hex.EncodeToString(buf2)) - } + require.NoError(t, err) + + buf2, err := m2.Serialize() + require.NoError(t, err) + + assert.Equal(t, buf1, buf2, "buf1: %v buf2: %v", hex.EncodeToString(buf1), hex.EncodeToString(buf2)) } func randUint32() uint32 { |