Skip to content

Commit 54c9386

Browse files
fix: guard the unified cases in SpawnCountAnalyticsTests
1 parent b461ed1 commit 54c9386

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/SpawnCountAnalyticsTests.cs‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ namespace Unity.Netcode.RuntimeTests
1313
/// - Hybrid instances are also counted on their own.<br />
1414
/// </summary>
1515
[TestFixture(HostOrServer.Host)]
16+
#if UNIFIED_NETCODE
1617
[TestFixture(HostOrServer.UnifiedHost)]
18+
#endif
1719
internal class SpawnCountAnalyticsTests : NetcodeIntegrationTest
1820
{
1921
private const int k_DefaultInstances = 3;
@@ -29,10 +31,12 @@ public SpawnCountAnalyticsTests(HostOrServer hostOrServer) : base(hostOrServer)
2931
{
3032
}
3133

34+
#if UNIFIED_NETCODE
3235
protected override bool UseUnifiedTests()
3336
{
3437
return true;
3538
}
39+
#endif
3640

3741
protected override void OnServerAndClientsCreated()
3842
{
@@ -66,7 +70,13 @@ public IEnumerator SpawnsAreCountedOnEveryPeer()
6670
AssertOnTimeout($"Failed to spawn {instance.name} on all clients!");
6771
}
6872

69-
var expectedHybridSpawns = m_UseUnifiedTests ? k_DefaultInstances : 0;
73+
var expectedHybridSpawns = 0;
74+
#if UNIFIED_NETCODE
75+
if (m_UseUnifiedTests)
76+
{
77+
expectedHybridSpawns = k_DefaultInstances;
78+
}
79+
#endif
7080
for (int i = 0; i < m_NetworkManagers.Length; i++)
7181
{
7282
var spawnManager = m_NetworkManagers[i].SpawnManager;

0 commit comments

Comments
 (0)