mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-01-23 02:34:42 +00:00
Fix map test
This commit is contained in:
parent
9191861cab
commit
129690e901
1 changed files with 6 additions and 2 deletions
|
|
@ -25,7 +25,9 @@ type lookMap struct {
|
|||
|
||||
func (l *lookMap) Reset() {
|
||||
l.prev = com.NewNetMap[string, *tSession]()
|
||||
l.Map.ForEach(func(s *tSession) { l.prev.Add(s) })
|
||||
for s := range l.Map.Values() {
|
||||
l.prev.Add(s)
|
||||
}
|
||||
l.NetMap.Reset()
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +61,9 @@ func TestRouterReset(t *testing.T) {
|
|||
router.Reset()
|
||||
|
||||
disconnected := true
|
||||
u.prev.ForEach(func(u *tSession) { disconnected = disconnected && !u.connected })
|
||||
for u := range u.prev.Values() {
|
||||
disconnected = disconnected && !u.connected
|
||||
}
|
||||
if !disconnected {
|
||||
t.Errorf("not all users were disconnected, but should")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue