X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=core%2Fconnection_test.go;h=453bbce6020dbaf82932ba9eee65696c8724c66b;hb=c7ae74a95d1bd6fefcbb061f5f045c60c11e32fc;hp=e6ef5d5538fc84130bae128c22833713ad97c00e;hpb=9f27eeff53ee501b8641595baa7cbc2f0014a68c;p=govpp.git diff --git a/core/connection_test.go b/core/connection_test.go index e6ef5d5..453bbce 100644 --- a/core/connection_test.go +++ b/core/connection_test.go @@ -15,6 +15,7 @@ package core_test import ( + "git.fd.io/govpp.git/examples/binapi/interface_types" "testing" . "github.com/onsi/gomega" @@ -92,7 +93,7 @@ func TestAsyncConnection(t *testing.T) { func TestCodec(t *testing.T) { RegisterTestingT(t) - msgCodec := &codec.MsgCodec{} + var msgCodec = codec.DefaultCodec // request data, err := msgCodec.EncodeMsg(&interfaces.CreateLoopback{MacAddress: interfaces.MacAddress{1, 2, 3, 4, 5, 6}}, 11) @@ -118,7 +119,7 @@ func TestCodec(t *testing.T) { func TestCodecNegative(t *testing.T) { RegisterTestingT(t) - msgCodec := &codec.MsgCodec{} + var msgCodec = codec.DefaultCodec // nil message for encoding data, err := msgCodec.EncodeMsg(nil, 15) @@ -134,7 +135,7 @@ func TestCodecNegative(t *testing.T) { // nil data for decoding err = msgCodec.DecodeMsg(nil, &vpe.ControlPingReply{}) Expect(err).Should(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("EOF")) + Expect(err.Error()).To(ContainSubstring("panic")) } func TestSimpleRequestsWithSequenceNumbers(t *testing.T) { @@ -161,7 +162,7 @@ func TestMultiRequestsWithSequenceNumbers(t *testing.T) { var msgs []api.Message for i := 0; i < 10; i++ { - msgs = append(msgs, &interfaces.SwInterfaceDetails{SwIfIndex: interfaces.InterfaceIndex(i)}) + msgs = append(msgs, &interfaces.SwInterfaceDetails{SwIfIndex: interface_types.InterfaceIndex(i)}) } ctx.mockVpp.MockReply(msgs...) ctx.mockVpp.MockReply(&vpe.ControlPingReply{}) @@ -280,7 +281,7 @@ func TestMultiRequestsWithErrors(t *testing.T) { } for i := 0; i < 10; i++ { msgs = append(msgs, mock.MsgWithContext{ - Msg: &interfaces.SwInterfaceDetails{SwIfIndex: interfaces.InterfaceIndex(i)}, + Msg: &interfaces.SwInterfaceDetails{SwIfIndex: interface_types.InterfaceIndex(i)}, SeqNum: 1, Multipart: true, })