From 68b69b60f15316ba804ea083129ef5636a2803a5 Mon Sep 17 00:00:00 2001 From: Andrea Barberio Date: Fri, 16 Mar 2018 16:16:16 +0000 Subject: dhcpv4: Added OptionDomainName --- dhcpv4/option_class_identifier_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dhcpv4/option_class_identifier_test.go') 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") } -- cgit v1.2.3