diff options
author | Christopher Koch <c@chrisko.ch> | 2019-01-20 21:13:30 +0000 |
---|---|---|
committer | insomniac <insomniacslk@users.noreply.github.com> | 2019-01-24 08:05:49 +0000 |
commit | a4a666c6477431358a1d6ed7b556398ed690ab5c (patch) | |
tree | d6b4c0e7a753db223d7d8b09569c4d028cff0f24 /dhcpv4/option_subnet_mask_test.go | |
parent | c90ab10024ada840e24bb028a3405961e8e4c26a (diff) |
dhcpv4: getters instead of getters
From:
r := GetRouter(d.Options)
To:
r := d.Router()
Diffstat (limited to 'dhcpv4/option_subnet_mask_test.go')
-rw-r--r-- | dhcpv4/option_subnet_mask_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/dhcpv4/option_subnet_mask_test.go b/dhcpv4/option_subnet_mask_test.go index bc82cf1..f9831b6 100644 --- a/dhcpv4/option_subnet_mask_test.go +++ b/dhcpv4/option_subnet_mask_test.go @@ -15,15 +15,15 @@ func TestOptSubnetMask(t *testing.T) { } func TestGetSubnetMask(t *testing.T) { - o := OptionsFromList(OptSubnetMask(net.IPMask{})) - mask := GetSubnetMask(o) + m, _ := New(WithOption(OptSubnetMask(net.IPMask{}))) + mask := m.SubnetMask() require.Nil(t, mask, "empty byte stream") - o = OptionsFromList(OptSubnetMask(net.IPMask{255})) - mask = GetSubnetMask(o) + m, _ = New(WithOption(OptSubnetMask(net.IPMask{255}))) + mask = m.SubnetMask() require.Nil(t, mask, "short byte stream") - o = OptionsFromList(OptSubnetMask(net.IPMask{255, 255, 255, 0})) - mask = GetSubnetMask(o) + m, _ = New(WithOption(OptSubnetMask(net.IPMask{255, 255, 255, 0}))) + mask = m.SubnetMask() require.Equal(t, net.IPMask{255, 255, 255, 0}, mask) } |