Skip to content

Commit bd92a81

Browse files
test
increase number of bytes to adjust under CorruptBytes pass.
1 parent 160c917 commit bd92a81

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

com.unity.netcode.gameobjects/Tests/Editor/Messaging/MessageCorruptionTests.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,16 @@ public unsafe void Send(ulong clientId, NetworkDelivery delivery, FastBufferWrit
9090
break;
9191
}
9292
case TypeOfCorruption.CorruptBytes:
93-
batchData.Seek(batchData.Length - 2);
94-
var currentByte = batchData.GetUnsafePtr()[0];
95-
batchData.WriteByteSafe((byte)(currentByte == 0 ? 1 : 0));
96-
MessageQueue.Add(batchData.ToArray());
97-
break;
93+
{
94+
batchData.Seek(batchData.Length - 4);
95+
for (int i = 0;i < 4; i++)
96+
{
97+
var currentByte = batchData.GetUnsafePtr()[i];
98+
batchData.WriteByteSafe((byte)(currentByte == 0 ? 1 : 0));
99+
MessageQueue.Add(batchData.ToArray());
100+
}
101+
break;
102+
}
98103
case TypeOfCorruption.Truncated:
99104
batchData.Truncate(batchData.Length - 1);
100105
MessageQueue.Add(batchData.ToArray());

0 commit comments

Comments
 (0)