summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/option_bootfileparam_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6/option_bootfileparam_test.go')
-rw-r--r--dhcpv6/option_bootfileparam_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/dhcpv6/option_bootfileparam_test.go b/dhcpv6/option_bootfileparam_test.go
index 467f245..3bc266d 100644
--- a/dhcpv6/option_bootfileparam_test.go
+++ b/dhcpv6/option_bootfileparam_test.go
@@ -41,8 +41,8 @@ func compileTestBootfileParams(t *testing.T, params []string) []byte {
func TestOptBootFileParam(t *testing.T) {
expected := string(compileTestBootfileParams(t, testBootfileParams1))
- opt, err := parseOptBootFileParam([]byte(expected))
- if err != nil {
+ var opt optBootFileParam
+ if err := opt.FromBytes([]byte(expected)); err != nil {
t.Fatal(err)
}
if string(opt.ToBytes()) != expected {
@@ -54,10 +54,10 @@ func TestParsedTypeOptBootFileParam(t *testing.T) {
tryParse := func(compiled []byte, expected []string) {
opt, err := ParseOption(OptionBootfileParam, compiled)
require.NoError(t, err)
- bootfileParamOpt, ok := opt.(optBootFileParam)
+ bootfileParamOpt, ok := opt.(*optBootFileParam)
require.True(t, ok, fmt.Sprintf("invalid type: %T instead of %T", opt, bootfileParamOpt))
require.Equal(t, compiled, bootfileParamOpt.ToBytes())
- require.Equal(t, expected, ([]string)(bootfileParamOpt))
+ require.Equal(t, expected, bootfileParamOpt.params)
}
tryParse(