Skip to content
Snippets Groups Projects
Commit 34075c60 authored by Daniel Czerwonk's avatar Daniel Czerwonk
Browse files

fixed tests

parent 95d1905a
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ import ( ...@@ -16,7 +16,7 @@ import (
type failingUpdate struct{} type failingUpdate struct{}
func (f *failingUpdate) SerializeUpdate(opt *packet.EncodingOptions) ([]byte, error) { func (f *failingUpdate) SerializeUpdate(opt *packet.Options) ([]byte, error) {
return nil, errors.New("general error") return nil, errors.New("general error")
} }
...@@ -94,7 +94,7 @@ func TestSerializeAndSendUpdate(t *testing.T) { ...@@ -94,7 +94,7 @@ func TestSerializeAndSendUpdate(t *testing.T) {
} }
for _, test := range tests { for _, test := range tests {
t.Run(test.name, func(t *testing.T) { t.Run(test.name, func(t *testing.T) {
opt := &packet.EncodingOptions{} opt := &packet.Options{}
err := serializeAndSendUpdate(test.buf, test.testUpdate, opt) err := serializeAndSendUpdate(test.buf, test.testUpdate, opt)
assert.Equal(t, test.err, err) assert.Equal(t, test.err, err)
......
...@@ -54,7 +54,7 @@ func TestWithDrawPrefixes(t *testing.T) { ...@@ -54,7 +54,7 @@ func TestWithDrawPrefixes(t *testing.T) {
} }
for _, tc := range testcases { for _, tc := range testcases {
buf := bytes.NewBuffer([]byte{}) buf := bytes.NewBuffer([]byte{})
opt := &packet.EncodingOptions{} opt := &packet.Options{}
err := withDrawPrefixes(buf, opt, tc.Prefix...) err := withDrawPrefixes(buf, opt, tc.Prefix...)
assert.Equal(t, tc.ExpectedError, err, "error mismatch in testcase %v", tc.Name) assert.Equal(t, tc.ExpectedError, err, "error mismatch in testcase %v", tc.Name)
assert.Equal(t, tc.Expected, buf.Bytes(), "expected different bytes in testcase %v", tc.Name) assert.Equal(t, tc.Expected, buf.Bytes(), "expected different bytes in testcase %v", tc.Name)
...@@ -111,7 +111,7 @@ func TestWithDrawPrefixesAddPath(t *testing.T) { ...@@ -111,7 +111,7 @@ func TestWithDrawPrefixesAddPath(t *testing.T) {
} }
for _, tc := range testcases { for _, tc := range testcases {
buf := bytes.NewBuffer([]byte{}) buf := bytes.NewBuffer([]byte{})
opt := &packet.EncodingOptions{} opt := &packet.Options{}
err := withDrawPrefixesAddPath(buf, opt, tc.Prefix, tc.Path) err := withDrawPrefixesAddPath(buf, opt, tc.Prefix, tc.Path)
assert.Equal(t, tc.ExpectedError, err, "error mismatch in testcase %v", tc.Name) assert.Equal(t, tc.ExpectedError, err, "error mismatch in testcase %v", tc.Name)
assert.Equal(t, tc.Expected, buf.Bytes(), "expected different bytes in testcase %v", tc.Name) assert.Equal(t, tc.Expected, buf.Bytes(), "expected different bytes in testcase %v", tc.Name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment