diff options
Diffstat (limited to 'dhcpv4/option_ip_address_lease_time_test.go')
-rw-r--r-- | dhcpv4/option_ip_address_lease_time_test.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/dhcpv4/option_ip_address_lease_time_test.go b/dhcpv4/option_ip_address_lease_time_test.go index 7d507bf..dafa6e4 100644 --- a/dhcpv4/option_ip_address_lease_time_test.go +++ b/dhcpv4/option_ip_address_lease_time_test.go @@ -14,23 +14,18 @@ func TestOptIPAddressLeaseTimeInterfaceMethods(t *testing.T) { } func TestParseOptIPAddressLeaseTime(t *testing.T) { - data := []byte{51, 4, 0, 0, 168, 192} + data := []byte{0, 0, 168, 192} o, err := ParseOptIPAddressLeaseTime(data) require.NoError(t, err) require.Equal(t, &OptIPAddressLeaseTime{LeaseTime: 43200}, o) // Short byte stream - data = []byte{51, 4, 168, 192} + data = []byte{168, 192} _, err = ParseOptIPAddressLeaseTime(data) require.Error(t, err, "should get error from short byte stream") - // Wrong code - data = []byte{54, 4, 0, 0, 168, 192} - _, err = ParseOptIPAddressLeaseTime(data) - require.Error(t, err, "should get error from wrong code") - // Bad length - data = []byte{51, 5, 1, 1, 1, 1, 1} + data = []byte{1, 1, 1, 1, 1} _, err = ParseOptIPAddressLeaseTime(data) require.Error(t, err, "should get error from bad length") } |