From e81cd12b55a01f9bec8325f4a57cbff357570972 Mon Sep 17 00:00:00 2001 From: Pablo Mazzini Date: Sat, 22 Dec 2018 14:39:10 +0000 Subject: increase coverage --- dhcpv4/ztpv4/ztp_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'dhcpv4') diff --git a/dhcpv4/ztpv4/ztp_test.go b/dhcpv4/ztpv4/ztp_test.go index c9c8d86..9950bf5 100644 --- a/dhcpv4/ztpv4/ztp_test.go +++ b/dhcpv4/ztpv4/ztp_test.go @@ -53,9 +53,11 @@ func TestParseV4VendorClass(t *testing.T) { t.Fatalf("failed to creat dhcpv4 packet object: %v", err) } - packet.AddOption(&dhcpv4.OptClassIdentifier{ - Identifier: tc.vc, - }) + if tc.vc != "" { + packet.AddOption(&dhcpv4.OptClassIdentifier{ + Identifier: tc.vc, + }) + } if tc.hostname != "" { packet.AddOption(&dhcpv4.OptHostName{ -- cgit v1.2.3