summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2018-11-11 23:01:36 +0000
committerPablo Mazzini <pmazzini@gmail.com>2018-11-11 23:01:36 +0000
commit8ea757126815ff6d795142d3b2e31bde47acd7fa (patch)
treeb65686e3c319b691081c5d1ca4ac6b2c897b8ff0 /dhcpv4
parent44c5227b7ac262bcbd0aa050e1d3cbb1ba4bc74d (diff)
OptRelayAgentInformation: increase coverage
Diffstat (limited to 'dhcpv4')
-rw-r--r--dhcpv4/option_relay_agent_information_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/dhcpv4/option_relay_agent_information_test.go b/dhcpv4/option_relay_agent_information_test.go
index f4f46c9..a3eb3ef 100644
--- a/dhcpv4/option_relay_agent_information_test.go
+++ b/dhcpv4/option_relay_agent_information_test.go
@@ -13,8 +13,14 @@ func TestParseOptRelayAgentInformation(t *testing.T) {
1, 5, 'l', 'i', 'n', 'u', 'x',
2, 4, 'b', 'o', 'o', 't',
}
- opt, err := ParseOptRelayAgentInformation([]byte(""))
+
+ // short bytes
+ opt, err := ParseOptRelayAgentInformation([]byte{})
require.Error(t, err)
+
+ // wrong code
+ opt, err = ParseOptRelayAgentInformation([]byte{1, 2, 1, 0})
+
opt, err = ParseOptRelayAgentInformation(data)
require.NoError(t, err)
require.Equal(t, len(opt.Options), 2)