From f5c1950747619f12256e39e69b9a2a9ec6168d04 Mon Sep 17 00:00:00 2001 From: Pablo Mazzini Date: Mon, 12 Nov 2018 13:08:18 +0000 Subject: OptRelayAgentInformation: increase coverage --- dhcpv4/option_relay_agent_information_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dhcpv4') diff --git a/dhcpv4/option_relay_agent_information_test.go b/dhcpv4/option_relay_agent_information_test.go index 9146a24..88cb39a 100644 --- a/dhcpv4/option_relay_agent_information_test.go +++ b/dhcpv4/option_relay_agent_information_test.go @@ -14,7 +14,7 @@ func TestParseOptRelayAgentInformation(t *testing.T) { 2, 4, 'b', 'o', 'o', 't', } - // short bytes + // short option bytes opt, err := ParseOptRelayAgentInformation([]byte{}) require.Error(t, err) @@ -26,6 +26,10 @@ func TestParseOptRelayAgentInformation(t *testing.T) { opt, err = ParseOptRelayAgentInformation([]byte{82, 3, 1, 0}) require.Error(t, err) + // short sub-option bytes + opt, err = ParseOptRelayAgentInformation([]byte{82, 1, 1}) + require.Error(t, err) + // short sub-option length opt, err = ParseOptRelayAgentInformation([]byte{82, 2, 1, 1}) require.Error(t, err) -- cgit v1.2.3