From 154650594c5b40b2905eb73b90f52de72f6ced16 Mon Sep 17 00:00:00 2001 From: Jeff Bean Date: Fri, 22 Jun 2018 19:12:33 -0700 Subject: Fixing all megacheck errors. --- packet/rtr/rtr_test.go | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'packet/rtr') 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 { -- cgit v1.2.3