mirror of
https://github.com/btcsuite/btcd.git
synced 2025-03-26 18:08:42 +01:00
Merge d5f4d4851f
into 4f4ea81776
This commit is contained in:
commit
94c6c95c45
1 changed files with 4 additions and 0 deletions
|
@ -208,6 +208,7 @@ func TestAddLocalAddress(t *testing.T) {
|
|||
}
|
||||
amgr := addrmgr.New("testaddlocaladdress", nil)
|
||||
for x, test := range tests {
|
||||
test := test
|
||||
result := amgr.AddLocalAddress(&test.address, test.priority)
|
||||
if result == nil && !test.valid {
|
||||
t.Errorf("TestAddLocalAddress test #%d failed: %s should have "+
|
||||
|
@ -463,6 +464,7 @@ func TestGetBestLocalAddress(t *testing.T) {
|
|||
|
||||
// Test against default when there's no address
|
||||
for x, test := range tests {
|
||||
test := test
|
||||
got := amgr.GetBestLocalAddress(&test.remoteAddr)
|
||||
wantAddr := test.want0.Addr.String()
|
||||
gotAddr := got.Addr.String()
|
||||
|
@ -480,6 +482,7 @@ func TestGetBestLocalAddress(t *testing.T) {
|
|||
|
||||
// Test against want1
|
||||
for x, test := range tests {
|
||||
test := test
|
||||
got := amgr.GetBestLocalAddress(&test.remoteAddr)
|
||||
wantAddr := test.want1.Addr.String()
|
||||
gotAddr := got.Addr.String()
|
||||
|
@ -499,6 +502,7 @@ func TestGetBestLocalAddress(t *testing.T) {
|
|||
|
||||
// Test against want2
|
||||
for x, test := range tests {
|
||||
test := test
|
||||
got := amgr.GetBestLocalAddress(&test.remoteAddr)
|
||||
wantAddr := test.want2.Addr.String()
|
||||
gotAddr := got.Addr.String()
|
||||
|
|
Loading…
Add table
Reference in a new issue