소스 검색

Merge pull request #2165 from idealhack/tests

test: fix ineffectual assignments
Chris Telfer 7 년 전
부모
커밋
55567d88e4
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      libnetwork/hostdiscovery/hostdiscovery_test.go

+ 6 - 0
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")
 	}