summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/dhcpv6_test.go
diff options
context:
space:
mode:
authorAndrea Barberio <insomniac@slackware.it>2017-12-07 23:17:53 +0000
committerAndrea Barberio <insomniac@slackware.it>2017-12-07 23:17:53 +0000
commit55d9d52d0a25d3826c5109f0bf101448322ec565 (patch)
treeb953d5ad611eb4f6e6e5021d3f72fe258e1780da /dhcpv6/dhcpv6_test.go
parentd38c49539b87fb57fec7ff62f787304e4f0eccee (diff)
Refactored options into the dhcpv6 package to resolve circular imports. Sadly.
Diffstat (limited to 'dhcpv6/dhcpv6_test.go')
-rw-r--r--dhcpv6/dhcpv6_test.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/dhcpv6/dhcpv6_test.go b/dhcpv6/dhcpv6_test.go
index 3d0c5fc..770d2c4 100644
--- a/dhcpv6/dhcpv6_test.go
+++ b/dhcpv6/dhcpv6_test.go
@@ -2,7 +2,6 @@ package dhcpv6
import (
"bytes"
- "github.com/insomniacslk/dhcp/dhcpv6/options"
"testing"
)
@@ -88,13 +87,13 @@ func TestSettersAndGetters(t *testing.T) {
if len(opts) != 0 {
t.Fatalf("Invalid Options. Expected empty array, got %v", opts)
}
- opt := options.OptionGeneric{OptionCode: 0, OptionData: []byte{}}
- d.SetOptions([]options.Option{&opt})
+ opt := OptionGeneric{OptionCode: 0, OptionData: []byte{}}
+ d.SetOptions([]Option{&opt})
opts = d.Options()
if len(opts) != 1 {
t.Fatalf("Invalid Options. Expected one-element array, got %v", len(opts))
}
- if _, ok := opts[0].(*options.OptionGeneric); !ok {
+ if _, ok := opts[0].(*OptionGeneric); !ok {
t.Fatalf("Invalid Options. Expected one OptionGeneric, got %v", opts[0])
}
}
@@ -105,13 +104,13 @@ func TestAddOption(t *testing.T) {
if len(opts) != 0 {
t.Fatalf("Invalid Options. Expected empty array, got %v", opts)
}
- opt := options.OptionGeneric{OptionCode: 0, OptionData: []byte{}}
+ opt := OptionGeneric{OptionCode: 0, OptionData: []byte{}}
d.AddOption(&opt)
opts = d.Options()
if len(opts) != 1 {
t.Fatalf("Invalid Options. Expected one-element array, got %v", len(opts))
}
- if _, ok := opts[0].(*options.OptionGeneric); !ok {
+ if _, ok := opts[0].(*OptionGeneric); !ok {
t.Fatalf("Invalid Options. Expected one OptionGeneric, got %v", opts[0])
}
}
@@ -120,7 +119,7 @@ func TestToBytes(t *testing.T) {
d := DHCPv6Message{}
d.SetMessage(SOLICIT)
d.SetTransactionID(0xabcdef)
- opt := options.OptionGeneric{OptionCode: 0, OptionData: []byte{}}
+ opt := OptionGeneric{OptionCode: 0, OptionData: []byte{}}
d.AddOption(&opt)
toBytes := d.ToBytes()
expected := []byte{01, 0xab, 0xcd, 0xef, 0x00, 0x00, 0x00, 0x00}