summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2022-10-01 13:29:26 +0100
committerGitHub <noreply@github.com>2022-10-01 13:29:26 +0100
commit18231451f3d97ab8e78fbad5d7e281af294d38d0 (patch)
tree7312e2eca94907a60ecd250493c4f36573b57db5
parent962b81a3c7c72027180d70695556b03a90a566b5 (diff)
parent0fe08a6d435ac81833ebee256fe0607a0b1ec9a7 (diff)
Merge pull request #479 from twelho/fix-not-nil-checks
dhcpv4: fix require.NotNil() usage in tests
-rw-r--r--dhcpv4/server4/server_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/dhcpv4/server4/server_test.go b/dhcpv4/server4/server_test.go
index b0336db..9fc44a3 100644
--- a/dhcpv4/server4/server_test.go
+++ b/dhcpv4/server4/server_test.go
@@ -110,7 +110,8 @@ func TestServer(t *testing.T) {
lease, err := c.Request(context.Background(), modifiers...)
require.NoError(t, err)
- require.NotNil(t, lease.Offer, lease.ACK)
+ require.NotNil(t, lease.Offer)
+ require.NotNil(t, lease.ACK)
for _, p := range []*dhcpv4.DHCPv4{lease.Offer, lease.ACK} {
require.Equal(t, xid, p.TransactionID)
require.Equal(t, ifaces[0].HardwareAddr, p.ClientHWAddr)
@@ -118,7 +119,8 @@ func TestServer(t *testing.T) {
lease, err = c.Renew(context.Background(), lease, modifiers...)
require.NoError(t, err)
- require.NotNil(t, lease.Offer, lease.ACK)
+ require.NotNil(t, lease.Offer)
+ require.NotNil(t, lease.ACK)
for _, p := range []*dhcpv4.DHCPv4{lease.Offer, lease.ACK} {
require.Equal(t, xid, p.TransactionID)
require.Equal(t, ifaces[0].HardwareAddr, p.ClientHWAddr)