mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
audio: No need goroutine for tests
This commit is contained in:
parent
ed7552962d
commit
7740656054
@ -71,20 +71,14 @@ func TestGC(t *testing.T) {
|
|||||||
p = nil
|
p = nil
|
||||||
runtime.GC()
|
runtime.GC()
|
||||||
|
|
||||||
ch := make(chan struct{})
|
for i := 0; i < 10; i++ {
|
||||||
go func() {
|
got = PlayersNumForTesting()
|
||||||
defer close(ch)
|
if want := 0; got == want {
|
||||||
for i := 0; i < 10; i++ {
|
return
|
||||||
got = PlayersNumForTesting()
|
|
||||||
if want := 0; got == want {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 100[ms] should be enough all the bytes are consumed.
|
|
||||||
// TODO: This is a darty hack. Would it be possible to use virtual time?
|
|
||||||
time.Sleep(100 * time.Millisecond)
|
|
||||||
}
|
}
|
||||||
t.Errorf("time out")
|
// 100[ms] should be enough all the bytes are consumed.
|
||||||
}()
|
// TODO: This is a darty hack. Would it be possible to use virtual time?
|
||||||
|
time.Sleep(100 * time.Millisecond)
|
||||||
<-ch
|
}
|
||||||
|
t.Errorf("time out")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user