test: expand channelserver coverage from 20% to 25%

Add tests for:
- Discord handlers (getPlayerSlice, getCharacterList)
- House handlers (boxToBytes, HouseData, Title structs)
- Mail struct tests
- Mercenary handlers (Partner, HunterNavi structs)
- Shop/Gacha handlers (writeShopItems, ShopItem, Gacha structs)
- Additional handler coverage for guild, tower, and simple handlers
- Stage handler tests for binary operations and enumeration
- Channel server tests for BroadcastMHF and session management
This commit is contained in:
Houmgaor
2026-02-02 16:02:01 +01:00
parent 2d8f1d3b41
commit 7e9440d8cc
14 changed files with 2162 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package channelserver
import (
"testing"
"erupe-ce/network/mhfpacket"
)
func TestHandleMsgMhfLoadLegendDispatch(t *testing.T) {
server := createMockServer()
session := createMockSession(1, server)
pkt := &mhfpacket.MsgMhfLoadLegendDispatch{
AckHandle: 12345,
}
handleMsgMhfLoadLegendDispatch(session, pkt)
select {
case p := <-session.sendPackets:
if len(p.data) == 0 {
t.Error("Response packet should have data")
}
default:
t.Error("No response packet queued")
}
}