router info test and bug fixes

This commit is contained in:
Hayden Parker
2016-06-22 21:06:03 -07:00
parent 02d2d78b8d
commit 712f0ca0ae
3 changed files with 30 additions and 22 deletions

View File

@ -76,12 +76,9 @@ func TestReadRouterAddressReturnsCorrectRemainderWithoutError(t *testing.T) {
router_address, remainder, err := ReadRouterAddress(router_address_bytes)
assert.Nil(err, "ReadRouterAddress() reported error with valid data:")
if bytes.Compare(remainder, []byte{0x01, 0x02, 0x03}) != 0 {
t.Fatal("incorrect remainder returned on ReadRouterAddress:", remainder)
}
assert.Equal(0, bytes.Compare(remainder, []byte{0x01, 0x02, 0x03}))
err, exit := router_address.checkValid()
assert.Nil(err, "checkValid() on address from ReadRouterAddress() reported error with valid data")
assert.Equal(exit, false, "checkValid() on address from ReadRouterAddress() indicated to stop parsing valid data")
}