mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
fix: resolve 4 pre-existing test failures in channelserver
- Guard nil listener/acceptConns in Server.Shutdown() to prevent panic in test servers that don't bind a network listener - Remove redundant userBinaryPartsLock in TestHandleMsgMhfLoaddata that caused a deadlock with handleMsgMhfLoaddata's own lock acquisition - Increase test save blob size from 200 to 150000 bytes to accommodate ZZ save pointer offsets (up to 146728) - Initialize MHFEquipment.Sigils[].Effects slices in test data to prevent index-out-of-range panic in SerializeWarehouseEquipment - Insert warehouse row before updating it (UPDATE on 0 rows is not an error, so the INSERT fallback never triggered) - Use COALESCE for nullable kouryou_point column in kill counter test - Fix duplicate-add test expectation (CSV helper correctly deduplicates)
This commit is contained in:
@@ -444,8 +444,6 @@ func TestHandleMsgMhfLoaddata_Integration(t *testing.T) {
|
||||
s.charID = charID
|
||||
s.server.db = db
|
||||
s.server.userBinaryParts = make(map[userBinaryPartID][]byte)
|
||||
s.server.userBinaryPartsLock.Lock()
|
||||
defer s.server.userBinaryPartsLock.Unlock()
|
||||
|
||||
pkt := &mhfpacket.MsgMhfLoaddata{
|
||||
AckHandle: 5678,
|
||||
@@ -570,7 +568,8 @@ func TestSaveDataCorruptionDetection_Integration(t *testing.T) {
|
||||
s.server.erupeConfig.DeleteOnSaveCorruption = false
|
||||
|
||||
// Create save data with a DIFFERENT name (corruption)
|
||||
corruptedData := make([]byte, 200)
|
||||
// Must be large enough for ZZ save pointer offsets (highest: pKQF at 146728)
|
||||
corruptedData := make([]byte, 150000)
|
||||
copy(corruptedData[88:], []byte("HackedName\x00"))
|
||||
compressed, _ := nullcomp.Compress(corruptedData)
|
||||
|
||||
@@ -618,7 +617,7 @@ func TestConcurrentSaveData_Integration(t *testing.T) {
|
||||
s.Name = fmt.Sprintf("Char%d", index)
|
||||
s.server.db = db
|
||||
|
||||
saveData := make([]byte, 200)
|
||||
saveData := make([]byte, 150000)
|
||||
copy(saveData[88:], []byte(fmt.Sprintf("Char%d\x00", index)))
|
||||
compressed, _ := nullcomp.Compress(saveData)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user