mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +01:00
audio: change the naming convention: Num -> Count
This commit is contained in:
parent
5f17264c74
commit
c77e5884aa
@ -40,15 +40,15 @@ func TestGC(t *testing.T) {
|
|||||||
defer teardown()
|
defer teardown()
|
||||||
|
|
||||||
p, _ := context.NewPlayer(bytes.NewReader(make([]byte, 4)))
|
p, _ := context.NewPlayer(bytes.NewReader(make([]byte, 4)))
|
||||||
got := audio.PlayersNumForTesting()
|
got := audio.PlayersCountForTesting()
|
||||||
if want := 0; got != want {
|
if want := 0; got != want {
|
||||||
t.Errorf("PlayersNum(): got: %d, want: %d", got, want)
|
t.Errorf("PlayersCountForTesting(): got: %d, want: %d", got, want)
|
||||||
}
|
}
|
||||||
|
|
||||||
p.Play()
|
p.Play()
|
||||||
got = audio.PlayersNumForTesting()
|
got = audio.PlayersCountForTesting()
|
||||||
if want := 1; got != want {
|
if want := 1; got != want {
|
||||||
t.Errorf("PlayersNum() after Play: got: %d, want: %d", got, want)
|
t.Errorf("PlayersCountForTesting() after Play: got: %d, want: %d", got, want)
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime.KeepAlive(p)
|
runtime.KeepAlive(p)
|
||||||
@ -56,7 +56,7 @@ func TestGC(t *testing.T) {
|
|||||||
runtime.GC()
|
runtime.GC()
|
||||||
|
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
got = audio.PlayersNumForTesting()
|
got = audio.PlayersCountForTesting()
|
||||||
if want := 0; got == want {
|
if want := 0; got == want {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ func UpdateForTesting() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func PlayersNumForTesting() int {
|
func PlayersCountForTesting() int {
|
||||||
c := CurrentContext()
|
c := CurrentContext()
|
||||||
c.m.Lock()
|
c.m.Lock()
|
||||||
n := len(c.players)
|
n := len(c.players)
|
||||||
|
Loading…
Reference in New Issue
Block a user