Skip to content

Commit cfcd70b

Browse files
test
making the added verbose log history internal to avoid PVP issue.
1 parent 29f5e46 commit cfcd70b

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public enum SceneManagementState
3838
}
3939

4040
private StringBuilder m_InternalErrorLog = new StringBuilder();
41-
protected StringBuilder m_VerboseDebugLog = new StringBuilder();
41+
internal StringBuilder VerboseDebugLog = new StringBuilder();
4242

4343
/// <summary>
4444
/// Registered list of all NetworkObjects spawned.
@@ -258,7 +258,7 @@ protected void VerboseDebug(string msg)
258258
{
259259
if (m_EnableVerboseDebug)
260260
{
261-
m_VerboseDebugLog.AppendLine(msg);
261+
VerboseDebugLog.AppendLine(msg);
262262
Debug.Log(msg);
263263
}
264264
}
@@ -347,7 +347,7 @@ protected virtual void OnInlineSetup()
347347
[UnitySetUp]
348348
public IEnumerator SetUp()
349349
{
350-
m_VerboseDebugLog.Clear();
350+
VerboseDebugLog.Clear();
351351
VerboseDebug($"Entering {nameof(SetUp)}");
352352
NetcodeLogAssert = new NetcodeLogAssert();
353353
if (m_EnableTimeTravel)

com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformGeneral.cs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,21 @@ public void NonAuthorityOwnerSettingStateTest([Values] Interpolation interpolati
300300
var newScale = new Vector3(2.0f, 2.0f, 2.0f);
301301
m_NonAuthoritativeTransform.SetState(newPosition, null, null, interpolate);
302302
success = WaitForConditionOrTimeOutWithTimeTravel(() => PositionsMatchesValue(newPosition), 800);
303-
Assert.True(success, $"Timed out waiting for non-authoritative position state request to be applied!\n {m_VerboseDebugLog}");
303+
Assert.True(success, $"Timed out waiting for non-authoritative position state request to be applied!\n {VerboseDebugLog}");
304304
Assert.True(Approximately(newPosition, m_AuthoritativeTransform.transform.position), "Authoritative position does not match!");
305305
Assert.True(Approximately(newPosition, m_NonAuthoritativeTransform.transform.position), "Non-Authoritative position does not match!");
306306
m_NonAuthoritativeTransform.SetState(null, newRotation, null, interpolate);
307307
success = WaitForConditionOrTimeOutWithTimeTravel(() => RotationMatchesValue(newRotation.eulerAngles), 800);
308-
Assert.True(success, $"Timed out waiting for non-authoritative rotation state request to be applied!\n {m_VerboseDebugLog}");
309-
Assert.True(Approximately(newRotation.eulerAngles, m_AuthoritativeTransform.transform.rotation.eulerAngles), $"Authoritative rotation does not match!\n {m_VerboseDebugLog}");
310-
Assert.True(Approximately(newRotation.eulerAngles, m_NonAuthoritativeTransform.transform.rotation.eulerAngles), $"Non-Authoritative rotation does not match!\n {m_VerboseDebugLog}");
308+
Assert.True(success, $"Timed out waiting for non-authoritative rotation state request to be applied!\n {VerboseDebugLog}");
309+
Assert.True(Approximately(newRotation.eulerAngles, m_AuthoritativeTransform.transform.rotation.eulerAngles), $"Authoritative rotation does not match!\n {VerboseDebugLog}");
310+
Assert.True(Approximately(newRotation.eulerAngles, m_NonAuthoritativeTransform.transform.rotation.eulerAngles), $"Non-Authoritative rotation does not match!\n {VerboseDebugLog}");
311+
Assert.True(Approximately(newRotation.eulerAngles, m_NonAuthoritativeTransform.transform.rotation.eulerAngles), $"Non-Authoritative rotation does not match!\n {VerboseDebugLog}");
311312

312313
m_NonAuthoritativeTransform.SetState(null, null, newScale, interpolate);
313314
success = WaitForConditionOrTimeOutWithTimeTravel(() => ScaleMatchesValue(newScale), 800);
314-
Assert.True(success, $"Timed out waiting for non-authoritative scale state request to be applied!\n {m_VerboseDebugLog}");
315-
Assert.True(Approximately(newScale, m_AuthoritativeTransform.transform.localScale), $"Authoritative scale does not match!\n {m_VerboseDebugLog}");
316-
Assert.True(Approximately(newScale, m_NonAuthoritativeTransform.transform.localScale), $"Non-Authoritative scale does not match!\n {m_VerboseDebugLog}");
315+
Assert.True(success, $"Timed out waiting for non-authoritative scale state request to be applied!\n {VerboseDebugLog}");
316+
Assert.True(Approximately(newScale, m_AuthoritativeTransform.transform.localScale), $"Authoritative scale does not match!\n {VerboseDebugLog}");
317+
Assert.True(Approximately(newScale, m_NonAuthoritativeTransform.transform.localScale), $"Non-Authoritative scale does not match!\n {VerboseDebugLog}");
317318

318319
// Test all parameters at once
319320
newPosition = new Vector3(-10f, 95f, -25f);
@@ -322,13 +323,13 @@ public void NonAuthorityOwnerSettingStateTest([Values] Interpolation interpolati
322323

323324
m_NonAuthoritativeTransform.SetState(newPosition, newRotation, newScale, interpolate);
324325
success = WaitForConditionOrTimeOutWithTimeTravel(() => PositionRotationScaleMatches(newPosition, newRotation.eulerAngles, newScale), 800);
325-
Assert.True(success, $"Timed out waiting for non-authoritative position, rotation, and scale state request to be applied!\n {m_VerboseDebugLog}");
326-
Assert.True(Approximately(newPosition, m_AuthoritativeTransform.transform.position), $"Authoritative position does not match!\n {m_VerboseDebugLog}");
327-
Assert.True(Approximately(newPosition, m_NonAuthoritativeTransform.transform.position), $"Non-Authoritative position does not match!\n {m_VerboseDebugLog}");
328-
Assert.True(Approximately(newRotation.eulerAngles, m_AuthoritativeTransform.transform.rotation.eulerAngles), $"Authoritative rotation does not match!\n {m_VerboseDebugLog}");
329-
Assert.True(Approximately(newRotation.eulerAngles, m_NonAuthoritativeTransform.transform.rotation.eulerAngles), $"Non-Authoritative rotation does not match!\n {m_VerboseDebugLog}");
330-
Assert.True(Approximately(newScale, m_AuthoritativeTransform.transform.localScale), $"Authoritative scale does not match!\n {m_VerboseDebugLog}");
331-
Assert.True(Approximately(newScale, m_NonAuthoritativeTransform.transform.localScale), $"Non-Authoritative scale does not match!\n {m_VerboseDebugLog}");
326+
Assert.True(success, $"Timed out waiting for non-authoritative position, rotation, and scale state request to be applied!\n {VerboseDebugLog}");
327+
Assert.True(Approximately(newPosition, m_AuthoritativeTransform.transform.position), $"Authoritative position does not match!\n {VerboseDebugLog}");
328+
Assert.True(Approximately(newPosition, m_NonAuthoritativeTransform.transform.position), $"Non-Authoritative position does not match!\n {VerboseDebugLog}");
329+
Assert.True(Approximately(newRotation.eulerAngles, m_AuthoritativeTransform.transform.rotation.eulerAngles), $"Authoritative rotation does not match!\n {VerboseDebugLog}");
330+
Assert.True(Approximately(newRotation.eulerAngles, m_NonAuthoritativeTransform.transform.rotation.eulerAngles), $"Non-Authoritative rotation does not match!\n {VerboseDebugLog}");
331+
Assert.True(Approximately(newScale, m_AuthoritativeTransform.transform.localScale), $"Authoritative scale does not match!\n {VerboseDebugLog}");
332+
Assert.True(Approximately(newScale, m_NonAuthoritativeTransform.transform.localScale), $"Non-Authoritative scale does not match!\n {VerboseDebugLog}");
332333
}
333334
}
334335
}

0 commit comments

Comments
 (0)