aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2020-06-23 14:10:53 +0200
committerOndrej Fabry <ofabry@cisco.com>2020-06-24 08:17:33 +0200
commitceed73403bdb61387d04be8b47183e9c4a970749 (patch)
tree3f48a49051672efb44945b279b9f69693bc48540 /core
parent94620e85f0bdbb054af07ce3670fadc1f76cfdf0 (diff)
Fix codec fallback and generate type imports
Change-Id: Idd76c7f19d952939caf153928ac60175845078ff Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'core')
-rw-r--r--core/connection.go2
-rw-r--r--core/connection_test.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/core/connection.go b/core/connection.go
index 917f1cb..cfa94ee 100644
--- a/core/connection.go
+++ b/core/connection.go
@@ -128,7 +128,7 @@ func newConnection(binapi adapter.VppAPI, attempts int, interval time.Duration)
vppClient: binapi,
maxAttempts: attempts,
recInterval: interval,
- codec: &codec.MsgCodec{},
+ codec: codec.DefaultCodec,
msgIDs: make(map[string]uint16),
msgMap: make(map[uint16]api.Message),
channels: make(map[uint16]*Channel),
diff --git a/core/connection_test.go b/core/connection_test.go
index e6ef5d5..643d4a3 100644
--- a/core/connection_test.go
+++ b/core/connection_test.go
@@ -92,7 +92,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 +118,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 +134,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) {