修改测试错误

This commit is contained in:
liuxiaobo 2025-05-29 11:56:53 +08:00
parent 197fb1dbaa
commit 8552265220

View File

@ -2,6 +2,7 @@ package service
import (
"fmt"
"github.com/fox/fox/ipb"
"github.com/fox/fox/log"
"testing"
"time"
@ -76,8 +77,8 @@ func (s *gameService) OnMessage(msg []byte) error {
func TestGameService(t *testing.T) {
log.Open("test.log", log.DebugL)
s := newGameService()
msg := "hello world"
if err := s.Send(Topic(s), []byte(msg)); err != nil {
msg := ipb.MakeMsg(GameSrv, 0, 1, 2, []byte("hello world"))
if err := s.Send(Topic(s), msg); err != nil {
log.Error(err.Error())
}
s.GetServiceNodes().Range(func(key, value interface{}) bool {