mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkServerTests: UpdateWithNullEntryInSpawned
This commit is contained in:
parent
0f96e8ce6b
commit
d21d501bd0
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using Mirror.RemoteCalls;
|
using Mirror.RemoteCalls;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -1190,5 +1191,24 @@ public void NoConnectionsTest_WithHostAndConnection()
|
|||||||
NetworkServer.connections.Clear();
|
NetworkServer.connections.Clear();
|
||||||
NetworkServer.RemoveLocalConnection();
|
NetworkServer.RemoveLocalConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// updating NetworkServer with a null entry in NetworkIdentity.spawned
|
||||||
|
// should log a warning.
|
||||||
|
[Test]
|
||||||
|
public void UpdateWithNullEntryInSpawned()
|
||||||
|
{
|
||||||
|
// start
|
||||||
|
NetworkServer.Listen(1);
|
||||||
|
|
||||||
|
// add null
|
||||||
|
NetworkIdentity.spawned[42] = null;
|
||||||
|
|
||||||
|
// update
|
||||||
|
LogAssert.Expect(LogType.Warning, new Regex("Found 'null' entry in spawned list.*"));
|
||||||
|
NetworkServer.Update();
|
||||||
|
|
||||||
|
// clean up
|
||||||
|
NetworkServer.Shutdown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user