summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/option_vendor_opts_test.go
diff options
context:
space:
mode:
authorChris Koch <chrisko@google.com>2023-02-18 20:31:32 -0800
committerChris K <c@chrisko.ch>2023-02-19 22:39:16 -0800
commit336d4b9bd652b2bf0bc1bd0feae3f2f51009c13f (patch)
tree9c99ebb8f3067a39981d8bea07109fd7e7ba0d17 /dhcpv6/option_vendor_opts_test.go
parent1e0fe5ce427973ca92a0dfb1a06a252ddb0dd4be (diff)
dhcpv6: convert every Parse function to FromBytes
Signed-off-by: Chris Koch <chrisko@google.com>
Diffstat (limited to 'dhcpv6/option_vendor_opts_test.go')
-rw-r--r--dhcpv6/option_vendor_opts_test.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/dhcpv6/option_vendor_opts_test.go b/dhcpv6/option_vendor_opts_test.go
index f6c2b2a..5caba9c 100644
--- a/dhcpv6/option_vendor_opts_test.go
+++ b/dhcpv6/option_vendor_opts_test.go
@@ -17,13 +17,16 @@ func TestOptVendorOpts(t *testing.T) {
expectedOpts := OptVendorOpts{}
var vendorOpts []Option
expectedOpts.VendorOpts = append(vendorOpts, &OptionGeneric{OptionCode: 1, OptionData: optData})
- opt, err := ParseOptVendorOpts(expected)
+
+ var opt OptVendorOpts
+ err := opt.FromBytes(expected)
require.NoError(t, err)
require.Equal(t, uint32(0xaabbccdd), opt.EnterpriseNumber)
require.Equal(t, expectedOpts.VendorOpts, opt.VendorOpts)
shortData := make([]byte, 1)
- _, err = ParseOptVendorOpts(shortData)
+ var opt2 OptVendorOpts
+ err = opt2.FromBytes(shortData)
require.Error(t, err)
}