audio: change the naming convention: Num -> Count

This commit is contained in:
Hajime Hoshi 2022-07-13 01:29:28 +09:00
parent 5f17264c74
commit c77e5884aa
2 changed files with 6 additions and 6 deletions

View File

@ -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
} }

View File

@ -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)