mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-09-13 09:45:07 +03:00
Report errors during handshake stage (#1091)
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
This commit is contained in:
parent
ae997a5acb
commit
ddb75700a0
3 changed files with 21 additions and 17 deletions
|
@ -34,7 +34,7 @@ func TestVersionPasswordAuth(t *testing.T) {
|
|||
}
|
||||
|
||||
var decoded version_metadata
|
||||
if allowed := decoded.decode(bytes.NewBuffer(encoded), tt.password2); allowed != tt.allowed {
|
||||
if allowed := decoded.decode(bytes.NewBuffer(encoded), tt.password2) == nil; allowed != tt.allowed {
|
||||
t.Fatalf("Permutation %q -> %q should have been %v but was %v", tt.password1, tt.password2, tt.allowed, allowed)
|
||||
}
|
||||
}
|
||||
|
@ -67,8 +67,8 @@ func TestVersionRoundtrip(t *testing.T) {
|
|||
}
|
||||
encoded := bytes.NewBuffer(meta)
|
||||
decoded := &version_metadata{}
|
||||
if !decoded.decode(encoded, password) {
|
||||
t.Fatalf("failed to decode")
|
||||
if err := decoded.decode(encoded, password); err != nil {
|
||||
t.Fatalf("failed to decode: %s", err)
|
||||
}
|
||||
if !reflect.DeepEqual(test, decoded) {
|
||||
t.Fatalf("round-trip failed\nwant: %+v\n got: %+v", test, decoded)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue