X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=core%2Fconnection_test.go;h=e6ef5d5538fc84130bae128c22833713ad97c00e;hb=9f27eeff53ee501b8641595baa7cbc2f0014a68c;hp=71f1a184bb5925a0097d9f52463a35922e74d5a0;hpb=d4d3b9c6fa67fe454f8d8adc7502b3b645ecab10;p=govpp.git diff --git a/core/connection_test.go b/core/connection_test.go index 71f1a18..e6ef5d5 100644 --- a/core/connection_test.go +++ b/core/connection_test.go @@ -17,13 +17,14 @@ package core_test import ( "testing" + . "github.com/onsi/gomega" + "git.fd.io/govpp.git/adapter/mock" "git.fd.io/govpp.git/api" "git.fd.io/govpp.git/codec" "git.fd.io/govpp.git/core" "git.fd.io/govpp.git/examples/binapi/interfaces" "git.fd.io/govpp.git/examples/binapi/vpe" - . "github.com/onsi/gomega" ) type testCtx struct { @@ -94,14 +95,14 @@ func TestCodec(t *testing.T) { msgCodec := &codec.MsgCodec{} // request - data, err := msgCodec.EncodeMsg(&interfaces.CreateLoopback{MacAddress: []byte{1, 2, 3, 4, 5, 6}}, 11) + data, err := msgCodec.EncodeMsg(&interfaces.CreateLoopback{MacAddress: interfaces.MacAddress{1, 2, 3, 4, 5, 6}}, 11) Expect(err).ShouldNot(HaveOccurred()) Expect(data).ShouldNot(BeEmpty()) msg1 := &interfaces.CreateLoopback{} err = msgCodec.DecodeMsg(data, msg1) Expect(err).ShouldNot(HaveOccurred()) - Expect(msg1.MacAddress).To(BeEquivalentTo([]byte{1, 2, 3, 4, 5, 6})) + Expect(msg1.MacAddress).To(BeEquivalentTo(interfaces.MacAddress{1, 2, 3, 4, 5, 6})) // reply data, err = msgCodec.EncodeMsg(&vpe.ControlPingReply{Retval: 55}, 22) @@ -160,7 +161,7 @@ func TestMultiRequestsWithSequenceNumbers(t *testing.T) { var msgs []api.Message for i := 0; i < 10; i++ { - msgs = append(msgs, &interfaces.SwInterfaceDetails{SwIfIndex: uint32(i)}) + msgs = append(msgs, &interfaces.SwInterfaceDetails{SwIfIndex: interfaces.InterfaceIndex(i)}) } ctx.mockVpp.MockReply(msgs...) ctx.mockVpp.MockReply(&vpe.ControlPingReply{}) @@ -279,7 +280,7 @@ func TestMultiRequestsWithErrors(t *testing.T) { } for i := 0; i < 10; i++ { msgs = append(msgs, mock.MsgWithContext{ - Msg: &interfaces.SwInterfaceDetails{SwIfIndex: uint32(i)}, + Msg: &interfaces.SwInterfaceDetails{SwIfIndex: interfaces.InterfaceIndex(i)}, SeqNum: 1, Multipart: true, })