1
0
mirror of https://github.com/taigrr/go-fastping synced 2025-01-18 05:03:15 -08:00

Fixed RunLoop test in the same way as an example

This commit is contained in:
Tatsushi Demachi 2014-04-22 00:08:42 +09:00
parent e5a0822b78
commit 5d1967e357

View File

@ -180,13 +180,17 @@ func TestRunLoop(t *testing.T) {
wait := make(chan bool)
quit, errch := p.RunLoop()
ticker := time.NewTicker(time.Millisecond * 250)
loop:
for {
select {
case err := <-errch:
t.Fatalf("Pinger returns error %v", err)
case <-ticker.C:
ticker.Stop()
quit <- wait
case <-wait:
break
break loop
}
}
if recvCount < 2 {