summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/option_server_identifier_test.go
diff options
context:
space:
mode:
authorAndrea Barberio <insomniac@slackware.it>2018-03-17 12:21:03 -0700
committerinsomniac <insomniacslk@users.noreply.github.com>2018-03-17 19:26:23 +0000
commit1cc89131993b14e10204f15d92c7fd74ef20d3bd (patch)
tree70d30743eb37e38fdd35ce1b925932130f351346 /dhcpv4/option_server_identifier_test.go
parent68b69b60f15316ba804ea083129ef5636a2803a5 (diff)
Added OptionBroadcastAddress
Diffstat (limited to 'dhcpv4/option_server_identifier_test.go')
-rw-r--r--dhcpv4/option_server_identifier_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/dhcpv4/option_server_identifier_test.go b/dhcpv4/option_server_identifier_test.go
index 94fb542..efd6299 100644
--- a/dhcpv4/option_server_identifier_test.go
+++ b/dhcpv4/option_server_identifier_test.go
@@ -13,7 +13,7 @@ func TestOptRequestedIPAddressInterfaceMethods(t *testing.T) {
require.Equal(t, OptionRequestedIPAddress, o.Code(), "Code")
- expectedBytes := []byte{50, 4, 192, 168, 0, 1}
+ expectedBytes := []byte{byte(OptionRequestedIPAddress), 4, 192, 168, 0, 1}
require.Equal(t, expectedBytes, o.ToBytes(), "ToBytes")
require.Equal(t, 4, o.Length(), "Length")
@@ -29,16 +29,16 @@ func TestParseOptRequestedIPAddress(t *testing.T) {
o, err = ParseOptRequestedIPAddress([]byte{})
require.Error(t, err, "empty byte stream")
- o, err = ParseOptRequestedIPAddress([]byte{50, 4, 192})
+ o, err = ParseOptRequestedIPAddress([]byte{byte(OptionRequestedIPAddress), 4, 192})
require.Error(t, err, "short byte stream")
- o, err = ParseOptRequestedIPAddress([]byte{50, 3, 192, 168, 0, 1})
+ o, err = ParseOptRequestedIPAddress([]byte{byte(OptionRequestedIPAddress), 3, 192, 168, 0, 1})
require.Error(t, err, "wrong IP length")
o, err = ParseOptRequestedIPAddress([]byte{53, 4, 192, 168, 1})
require.Error(t, err, "wrong option code")
- o, err = ParseOptRequestedIPAddress([]byte{50, 4, 192, 168, 0, 1})
+ o, err = ParseOptRequestedIPAddress([]byte{byte(OptionRequestedIPAddress), 4, 192, 168, 0, 1})
require.NoError(t, err)
require.Equal(t, net.IP{192, 168, 0, 1}, o.RequestedAddr)
}