Skip to content

Commit 1900de6

Browse files
fix: PVP-151-1
Fixing the remaining PVP-151-1 errors.
1 parent d7a0e7c commit 1900de6

16 files changed

+656
-622
lines changed

com.unity.netcode.gameobjects/Tests/Runtime/DistributedAuthority/ExtendedNetworkShowAndHideTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Unity.Netcode.RuntimeTests
88
{
99
[TestFixture(HostOrServer.DAHost, true)]
1010
[TestFixture(HostOrServer.DAHost, false)]
11-
public class ExtendedNetworkShowAndHideTests : NetcodeIntegrationTest
11+
internal class ExtendedNetworkShowAndHideTests : NetcodeIntegrationTest
1212
{
1313
protected override int NumberOfClients => 3;
1414
private bool m_EnableSceneManagement;

com.unity.netcode.gameobjects/Tests/Runtime/DistributedAuthority/RpcProxyMessageTesting.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace Unity.Netcode.RuntimeTests
1717
/// </summary>
1818
[TestFixture(HostOrServer.Host)]
1919
[TestFixture(HostOrServer.DAHost)]
20-
public class RpcProxyMessageTesting : NetcodeIntegrationTest
20+
internal class RpcProxyMessageTesting : NetcodeIntegrationTest
2121
{
2222
protected override int NumberOfClients => 2;
2323

com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableBaseInitializesWhenPersisted.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Unity.Netcode.RuntimeTests
1212
[TestFixture(NetworkTopologyTypes.ClientServer, HostOrServer.Server)]
1313
[TestFixture(NetworkTopologyTypes.ClientServer, HostOrServer.Host)]
1414
[TestFixture(NetworkTopologyTypes.DistributedAuthority, HostOrServer.DAHost)]
15-
public class NetworkVariableBaseInitializesWhenPersisted : NetcodeIntegrationTest
15+
internal class NetworkVariableBaseInitializesWhenPersisted : NetcodeIntegrationTest
1616
{
1717
protected override int NumberOfClients => 1;
1818

com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableCollectionsTests.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Unity.Netcode.RuntimeTests
2323
/// </summary>
2424
[TestFixture(HostOrServer.Host)]
2525
[TestFixture(HostOrServer.Server)]
26-
public class NetworkVariableCollectionsTests : NetcodeIntegrationTest
26+
internal class NetworkVariableCollectionsTests : NetcodeIntegrationTest
2727
{
2828
protected override int NumberOfClients => 2;
2929

@@ -1218,7 +1218,7 @@ public IEnumerator TestHashSetBuiltInTypeCollections()
12181218
[TestFixture(HostOrServer.Host, CollectionTypes.Dictionary)]
12191219
[TestFixture(HostOrServer.Server, CollectionTypes.List)]
12201220
[TestFixture(HostOrServer.Server, CollectionTypes.Dictionary)]
1221-
public class NetworkVariableCollectionsChangingTests : NetcodeIntegrationTest
1221+
internal class NetworkVariableCollectionsChangingTests : NetcodeIntegrationTest
12221222
{
12231223
protected override int NumberOfClients => 2;
12241224
public enum CollectionTypes
@@ -1411,7 +1411,7 @@ public IEnumerator CollectionAndOwnershipChangingTest()
14111411
/// Helper class to test adding <see cref="NetworkVariable{T}"/> dictionary entries rapidly with frequent ownership changes.
14121412
/// This includes a companion <see cref="NetworkVariable{T}"/> integer that is continually incremented and used as the key value for each entry.
14131413
/// </summary>
1414-
public class DictionaryCollectionUpdateHelper : BaseCollectionUpdateHelper
1414+
internal class DictionaryCollectionUpdateHelper : BaseCollectionUpdateHelper
14151415
{
14161416
private NetworkVariable<Dictionary<int, int>> m_DictionaryCollection = new NetworkVariable<Dictionary<int, int>>(new Dictionary<int, int>(), NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner);
14171417
private NetworkVariable<int> m_CurrentKeyValue = new NetworkVariable<int>(0, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner);
@@ -1459,7 +1459,7 @@ protected override void AddItem()
14591459
/// <summary>
14601460
/// Helper class to test adding list entries rapidly with frequent ownership changes
14611461
/// </summary>
1462-
public class ListCollectionUpdateHelper : BaseCollectionUpdateHelper
1462+
internal class ListCollectionUpdateHelper : BaseCollectionUpdateHelper
14631463
{
14641464
private NetworkVariable<List<int>> m_ListCollection = new NetworkVariable<List<int>>(new List<int>(), NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner);
14651465

@@ -1507,7 +1507,7 @@ protected override void AddItem()
15071507
/// <summary>
15081508
/// The base class to test rapidly adding items to a collection type
15091509
/// </summary>
1510-
public class BaseCollectionUpdateHelper : NetworkBehaviour
1510+
internal class BaseCollectionUpdateHelper : NetworkBehaviour
15111511
{
15121512
public static bool VerboseMode;
15131513
private const int k_OwnershipTickDelay = 1;
@@ -1700,7 +1700,7 @@ protected void Log(string msg)
17001700
#endregion
17011701

17021702
#region HASHSET COMPONENT HELPERS
1703-
public class HashSetBaseTypeTestHelper : ListTestHelperBase, IHashSetTestHelperBase<int>
1703+
internal class HashSetBaseTypeTestHelper : ListTestHelperBase, IHashSetTestHelperBase<int>
17041704
{
17051705
public static Dictionary<ulong, Dictionary<ulong, HashSetBaseTypeTestHelper>> Instances = new Dictionary<ulong, Dictionary<ulong, HashSetBaseTypeTestHelper>>();
17061706

@@ -1949,7 +1949,7 @@ public override void OnNetworkDespawn()
19491949
#endregion
19501950

19511951
#region DICTIONARY COMPONENT HELPERS
1952-
public class NestedDictionaryTestHelper : ListTestHelperBase, IDictionaryTestHelperBase<int, Dictionary<int, SerializableObject>>
1952+
internal class NestedDictionaryTestHelper : ListTestHelperBase, IDictionaryTestHelperBase<int, Dictionary<int, SerializableObject>>
19531953
{
19541954
public static Dictionary<ulong, Dictionary<ulong, NestedDictionaryTestHelper>> Instances = new Dictionary<ulong, Dictionary<ulong, NestedDictionaryTestHelper>>();
19551955

@@ -2256,7 +2256,7 @@ public override void OnNetworkDespawn()
22562256
}
22572257
}
22582258

2259-
public class DictionaryTestHelper : ListTestHelperBase, IDictionaryTestHelperBase<int, SerializableObject>
2259+
internal class DictionaryTestHelper : ListTestHelperBase, IDictionaryTestHelperBase<int, SerializableObject>
22602260
{
22612261
public static Dictionary<ulong, Dictionary<ulong, DictionaryTestHelper>> Instances = new Dictionary<ulong, Dictionary<ulong, DictionaryTestHelper>>();
22622262

@@ -2542,7 +2542,7 @@ public override void OnNetworkDespawn()
25422542
#endregion
25432543

25442544
#region INETWORKSERIALIZABLE LIST TEST COMPONENT HELPERS
2545-
public class SerializableObject : INetworkSerializable, IEquatable<SerializableObject>
2545+
internal class SerializableObject : INetworkSerializable, IEquatable<SerializableObject>
25462546
{
25472547
public static SerializableObject GetRandomObject()
25482548
{
@@ -2598,7 +2598,7 @@ public bool Equals(SerializableObject other)
25982598

25992599
}
26002600

2601-
public class ListTestHelperListSerializableObject : ListTestHelperBase, IListTestHelperBase<List<SerializableObject>>
2601+
internal class ListTestHelperListSerializableObject : ListTestHelperBase, IListTestHelperBase<List<SerializableObject>>
26022602
{
26032603
public static Dictionary<ulong, Dictionary<ulong, ListTestHelperListSerializableObject>> Instances = new Dictionary<ulong, Dictionary<ulong, ListTestHelperListSerializableObject>>();
26042604

@@ -2897,7 +2897,7 @@ public override void OnNetworkDespawn()
28972897
}
28982898
}
28992899

2900-
public class ListTestHelperSerializableObject : ListTestHelperBase, IListTestHelperBase<SerializableObject>
2900+
internal class ListTestHelperSerializableObject : ListTestHelperBase, IListTestHelperBase<SerializableObject>
29012901
{
29022902
public static Dictionary<ulong, Dictionary<ulong, ListTestHelperSerializableObject>> Instances = new Dictionary<ulong, Dictionary<ulong, ListTestHelperSerializableObject>>();
29032903

@@ -3162,7 +3162,7 @@ public override void OnNetworkDespawn()
31623162
#endregion
31633163

31643164
#region BUILT-IN LIST TEST COMPONENT HELPERS
3165-
public class ListTestHelperListInt : ListTestHelperBase, IListTestHelperBase<List<int>>
3165+
internal class ListTestHelperListInt : ListTestHelperBase, IListTestHelperBase<List<int>>
31663166
{
31673167
public static Dictionary<ulong, Dictionary<ulong, ListTestHelperListInt>> Instances = new Dictionary<ulong, Dictionary<ulong, ListTestHelperListInt>>();
31683168

@@ -3466,7 +3466,7 @@ public override void OnNetworkDespawn()
34663466

34673467
}
34683468

3469-
public class ListTestHelperInt : ListTestHelperBase, IListTestHelperBase<int>
3469+
internal class ListTestHelperInt : ListTestHelperBase, IListTestHelperBase<int>
34703470
{
34713471
public static Dictionary<ulong, Dictionary<ulong, ListTestHelperInt>> Instances = new Dictionary<ulong, Dictionary<ulong, ListTestHelperInt>>();
34723472

@@ -3735,7 +3735,7 @@ public override void OnNetworkDespawn()
37353735
#endregion
37363736

37373737
#region BASE TEST COMPONENT HELPERS
3738-
public class ListTestHelperBase : NetworkBehaviour
3738+
internal class ListTestHelperBase : NetworkBehaviour
37393739
{
37403740
protected static bool IsDebugMode { get; private set; }
37413741

@@ -3782,7 +3782,7 @@ public virtual bool CompareTrackedChanges(Targets target)
37823782
}
37833783
}
37843784

3785-
public interface IListTestHelperBase<T>
3785+
internal interface IListTestHelperBase<T>
37863786
{
37873787
public bool ValidateInstances();
37883788

@@ -3815,7 +3815,7 @@ public interface IListTestHelperBase<T>
38153815
public void ResetTrackedChanges();
38163816
}
38173817

3818-
public interface IDictionaryTestHelperBase<TKey, TValue>
3818+
internal interface IDictionaryTestHelperBase<TKey, TValue>
38193819
{
38203820
public bool ValidateInstances();
38213821

@@ -3844,7 +3844,7 @@ public interface IDictionaryTestHelperBase<TKey, TValue>
38443844
public void ResetTrackedChanges();
38453845
}
38463846

3847-
public interface IHashSetTestHelperBase<T>
3847+
internal interface IHashSetTestHelperBase<T>
38483848
{
38493849
public bool ValidateInstances();
38503850

com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/Components/ObjectNameIdentifier.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
using System;
22
namespace Unity.Netcode.TestHelpers.Runtime
33
{
4+
/// <summary>
5+
/// Used in conjunction with integratioin tests, this <see cref="NetworkBehaviour"/> derived
6+
/// class is used to provide additional identification information in the name of the spawned
7+
/// objects in order to simplify finding a specific instance.
8+
/// <see cref="NetcodeIntegrationTest"/>
9+
/// </summary>
410
public class ObjectNameIdentifier : NetworkBehaviour
511
{
612
private ulong m_CurrentOwner;
@@ -18,12 +24,16 @@ public class ObjectNameIdentifier : NetworkBehaviour
1824
private NetworkObject m_NetworkObject;
1925
private string m_OriginalName;
2026

27+
/// <inheritdoc/>
2128
public override void OnNetworkSpawn()
2229
{
2330
RegisterAndLabelNetworkObject();
2431
}
2532

2633

34+
/// <summary>
35+
/// Invoke to register and label the spawned <see cref="NetworkObject"/>.
36+
/// </summary>
2737
protected void RegisterAndLabelNetworkObject()
2838
{
2939
if (!m_IsRegistered)
@@ -58,6 +68,9 @@ protected void RegisterAndLabelNetworkObject()
5868
}
5969
}
6070

71+
/// <summary>
72+
/// Invoke to remove the object from registration.
73+
/// </summary>
6174
protected void DeRegisterNetworkObject()
6275
{
6376
if (m_IsRegistered)
@@ -67,23 +80,27 @@ protected void DeRegisterNetworkObject()
6780
}
6881
}
6982

83+
/// <inheritdoc/>
7084
public override void OnLostOwnership()
7185
{
7286
DeRegisterNetworkObject();
7387
RegisterAndLabelNetworkObject();
7488
}
7589

90+
/// <inheritdoc/>
7691
public override void OnGainedOwnership()
7792
{
7893
DeRegisterNetworkObject();
7994
RegisterAndLabelNetworkObject();
8095
}
8196

97+
/// <inheritdoc/>
8298
public override void OnNetworkDespawn()
8399
{
84100
DeRegisterNetworkObject();
85101
}
86102

103+
/// <inheritdoc/>
87104
public override void OnDestroy()
88105
{
89106
if (m_NetworkObject != null)

com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/ConditionalPredicate.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,48 @@ public class ConditionalPredicateBase : IConditionalPredicate
1212

1313
public bool TimedOut { get { return m_TimedOut; } }
1414

15+
/// <summary>
16+
/// Override this method to incorporate your own conditional logic
17+
/// </summary>
18+
/// <returns>true for condition being met and false for the condition has yet to be met.</returns>
1519
protected virtual bool OnHasConditionBeenReached()
1620
{
1721
return true;
1822
}
1923

24+
/// <inheritdoc/>
2025
public bool HasConditionBeenReached()
2126
{
2227
return OnHasConditionBeenReached();
2328
}
2429

30+
/// <summary>
31+
/// Override this to initialize anything for the conditioinal check.
32+
/// </summary>
2533
protected virtual void OnStarted() { }
2634

35+
/// <inheritdoc/>
2736
public void Started()
2837
{
2938
OnStarted();
3039
}
3140

41+
/// <summary>
42+
/// Override this to clean up anything used in the conditional check.
43+
/// </summary>
3244
protected virtual void OnFinished() { }
3345

46+
/// <inheritdoc/>
3447
public void Finished(bool timedOut)
3548
{
3649
m_TimedOut = timedOut;
3750
OnFinished();
3851
}
3952
}
4053

54+
/// <summary>
55+
/// A conditional predicate interface used with integration testing.
56+
/// </summary>
4157
public interface IConditionalPredicate
4258
{
4359
/// <summary>

0 commit comments

Comments
 (0)