summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2018-11-12 13:08:18 +0000
committerPablo Mazzini <pmazzini@gmail.com>2018-11-12 13:08:18 +0000
commitf5c1950747619f12256e39e69b9a2a9ec6168d04 (patch)
treeadbc589de1b69bce777aa373bb0fd5a6b570e82a /dhcpv4
parent888609097f1aaea108ea2aebcb1d799688505944 (diff)
OptRelayAgentInformation: increase coverage
Diffstat (limited to 'dhcpv4')
-rw-r--r--dhcpv4/option_relay_agent_information_test.go6
1 files changed, 5 insertions, 1 deletions
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)