diff options
author | Andrea Barberio <insomniac@slackware.it> | 2018-03-16 16:16:16 +0000 |
---|---|---|
committer | Andrea Barberio <insomniac@slackware.it> | 2018-03-16 16:16:16 +0000 |
commit | 68b69b60f15316ba804ea083129ef5636a2803a5 (patch) | |
tree | c75c8313ebcc7cbaaa6b00e3e618b204b18c6262 /dhcpv4/option_class_identifier_test.go | |
parent | 79b8450e99efee338596f15fc1f8f88c3e42edc0 (diff) |
dhcpv4: Added OptionDomainName
Diffstat (limited to 'dhcpv4/option_class_identifier_test.go')
-rw-r--r-- | dhcpv4/option_class_identifier_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dhcpv4/option_class_identifier_test.go b/dhcpv4/option_class_identifier_test.go index a6a8f21..786ecfb 100644 --- a/dhcpv4/option_class_identifier_test.go +++ b/dhcpv4/option_class_identifier_test.go @@ -10,17 +10,17 @@ func TestOptClassIdentifierInterfaceMethods(t *testing.T) { o := OptClassIdentifier{Identifier: "foo"} require.Equal(t, OptionClassIdentifier, o.Code(), "Code") require.Equal(t, 3, o.Length(), "Length") - require.Equal(t, []byte{60, 3, 'f', 'o', 'o'}, o.ToBytes(), "ToBytes") + require.Equal(t, []byte{byte(OptionClassIdentifier), 3, 'f', 'o', 'o'}, o.ToBytes(), "ToBytes") } func TestParseOptClassIdentifier(t *testing.T) { - data := []byte{60, 4, 't', 'e', 's', 't'} // DISCOVER + data := []byte{byte(OptionClassIdentifier), 4, 't', 'e', 's', 't'} // DISCOVER o, err := ParseOptClassIdentifier(data) require.NoError(t, err) require.Equal(t, &OptClassIdentifier{Identifier: "test"}, o) // Short byte stream - data = []byte{60} + data = []byte{byte(OptionClassIdentifier)} _, err = ParseOptClassIdentifier(data) require.Error(t, err, "should get error from short byte stream") @@ -30,7 +30,7 @@ func TestParseOptClassIdentifier(t *testing.T) { require.Error(t, err, "should get error from wrong code") // Bad length - data = []byte{60, 6, 1, 1, 1} + data = []byte{byte(OptionClassIdentifier), 6, 1, 1, 1} _, err = ParseOptClassIdentifier(data) require.Error(t, err, "should get error from bad length") } |