Skip to content

Commit 861ef54

Browse files
fix and update
fixed issue with WhenListContainsManyLargeValues_OverflowExceptionIsNotThrown count comparison value. Updated removed FixedString32Test by removing yield return that was not needed.
1 parent 3e70580 commit 861ef54

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableTests.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,6 @@ public IEnumerator FixedString32Test([Values(true, false)] bool useHost)
227227
yield return InitializeServerAndClients(useHost);
228228
m_Player1OnServer.FixedString32.Value = k_FixedStringTestValue;
229229

230-
// Wait a tick
231-
yield return m_DefaultWaitForTick;
232-
233230
// Now wait for the client side version to be updated to k_FixedStringTestValue
234231
yield return WaitForConditionOrTimeOut((c) => m_Player1OnClient1.FixedString32.Value == c, k_FixedStringTestValue);
235232
Assert.IsFalse(s_GloabalTimeOutHelper.TimedOut, "Timed out waiting for client-side NetworkVariable to update!");
@@ -269,7 +266,8 @@ bool TestCompleted(int listCount)
269266
public IEnumerator WhenListContainsManyLargeValues_OverflowExceptionIsNotThrown([Values(true, false)] bool useHost)
270267
{
271268
yield return InitializeServerAndClients(useHost);
272-
for (var i = 0; i < 20; ++i)
269+
var numberOfEntries = 20;
270+
for (var i = 0; i < numberOfEntries; ++i)
273271
{
274272
m_Player1OnServer.TheLargeList.Add(new FixedString128Bytes());
275273
}
@@ -280,7 +278,7 @@ bool TestCompleted(int listCount)
280278
m_Player1OnClient1.TheLargeList.Count == listCount;
281279
}
282280

283-
yield return WaitForConditionOrTimeOut(TestCompleted, m_Player1OnServer.TheList.Count);
281+
yield return WaitForConditionOrTimeOut(TestCompleted, numberOfEntries);
284282
Assert.IsFalse(s_GloabalTimeOutHelper.TimedOut, $"Timed out waiting for {nameof(WhenListContainsManyLargeValues_OverflowExceptionIsNotThrown)} to complete its test!");
285283
}
286284

0 commit comments

Comments
 (0)