From f6d9d22e6f554e47674488f210375d3c7277900a Mon Sep 17 00:00:00 2001 From: Yang Li Date: Tue, 29 May 2018 17:17:28 +0800 Subject: [PATCH] test: fix ineffectual assignments Signed-off-by: Yang Li --- libnetwork/hostdiscovery/hostdiscovery_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libnetwork/hostdiscovery/hostdiscovery_test.go b/libnetwork/hostdiscovery/hostdiscovery_test.go index 9afb3c3b46..231885e64b 100644 --- a/libnetwork/hostdiscovery/hostdiscovery_test.go +++ b/libnetwork/hostdiscovery/hostdiscovery_test.go @@ -48,6 +48,9 @@ func TestAddedCallback(t *testing.T) { if !added { t.Fatal("Expecting an Added callback notification. But none received") } + if removed { + t.Fatal("Not expecting a Removed callback notification. But received a callback") + } } func TestRemovedCallback(t *testing.T) { @@ -58,6 +61,9 @@ func TestRemovedCallback(t *testing.T) { added := false removed := false hd.processCallback(update, func() {}, func(hosts []net.IP) { added = true }, func(hosts []net.IP) { removed = true }) + if added { + t.Fatal("Not expecting an Added callback notification. But received a callback") + } if !removed { t.Fatal("Expecting a Removed callback notification. But none received") }