mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkIdentityTests HandleEvent tests invalid component index / function hash too
This commit is contained in:
parent
bbcc3599ef
commit
4bc1c3eb20
@ -1314,6 +1314,18 @@ public void HandleSyncEvent()
|
||||
identity.HandleSyncEvent(componentIndex, functionHash, payload);
|
||||
Assert.That(comp0.called, Is.EqualTo(1));
|
||||
|
||||
// try wrong component index. syncevent shouldn't be called again.
|
||||
LogAssert.ignoreFailingMessages = true; // warning is expected
|
||||
identity.HandleSyncEvent(1, functionHash, payload);
|
||||
LogAssert.ignoreFailingMessages = false;
|
||||
Assert.That(comp0.called, Is.EqualTo(1));
|
||||
|
||||
// try wrong function hash. syncevent shouldn't be called again.
|
||||
LogAssert.ignoreFailingMessages = true; // warning is expected
|
||||
identity.HandleSyncEvent(0, functionHash+1, payload);
|
||||
LogAssert.ignoreFailingMessages = false;
|
||||
Assert.That(comp0.called, Is.EqualTo(1));
|
||||
|
||||
// clean up
|
||||
NetworkIdentity.spawned.Clear();
|
||||
NetworkBehaviour.ClearDelegates();
|
||||
|
Loading…
Reference in New Issue
Block a user