Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bio-rd
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
bio-rd
Commits
34075c60
Commit
34075c60
authored
6 years ago
by
Daniel Czerwonk
Browse files
Options
Downloads
Patches
Plain Diff
fixed tests
parent
95d1905a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
protocols/bgp/server/update_helper_test.go
+2
-2
2 additions, 2 deletions
protocols/bgp/server/update_helper_test.go
protocols/bgp/server/withdraw_test.go
+2
-2
2 additions, 2 deletions
protocols/bgp/server/withdraw_test.go
with
4 additions
and
4 deletions
protocols/bgp/server/update_helper_test.go
+
2
−
2
View file @
34075c60
...
@@ -16,7 +16,7 @@ import (
...
@@ -16,7 +16,7 @@ import (
type
failingUpdate
struct
{}
type
failingUpdate
struct
{}
func
(
f
*
failingUpdate
)
SerializeUpdate
(
opt
*
packet
.
Encoding
Options
)
([]
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
.
Encoding
Options
{}
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
)
...
...
This diff is collapsed.
Click to expand it.
protocols/bgp/server/withdraw_test.go
+
2
−
2
View file @
34075c60
...
@@ -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
.
Encoding
Options
{}
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
.
Encoding
Options
{}
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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment