better handling of test multicast listener initialisation errors

We handle that error explicitly in all cases and point out the common
cause, namely the absence of a default multicast interface.

Closes #481.
This commit is contained in:
Matthias Radestock committed 2015-04-11 20:22:41 +01:00
1 parent bb99b21248
commit e0bba10ead
3 files changed
+23 -13

No files matched your search

+5 -4
View File
@@ -73,15 +73,16 @@ func RunLocalMulticastServer() (*dns.Server, error) {
}
func setup(t *testing.T) (*MDNSClient, *dns.Server, error) {
server, err := RunLocalMulticastServer()
if err != nil {
t.Fatalf("Unable to run test server: %s. No default multicast interface?", err)
}
mdnsClient, err := NewMDNSClient()
wt.AssertNoErr(t, err)
err = mdnsClient.Start(nil)
wt.AssertNoErr(t, err)
server, err := RunLocalMulticastServer()
if err != nil {
t.Fatalf("Unable to run test server: %s", err)
}
return mdnsClient, server, err
}