Skip to content

Commit 2a990c9

Browse files
Fixing Remote_CanConnectInputSystemsOverEditorPlayerConnection() unit test
Delete the two LogAssert.Expect lines. Were we intentionally validating that duplicate singleton construction still produces errors? If so, I will revert this commit
1 parent e888e90 commit 2a990c9

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

Assets/Tests/InputSystem/CoreTests_Remoting.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,8 @@ public void Remote_ResettingDevice_WillSendChangeToRemotes()
268268
public void Remote_CanConnectInputSystemsOverEditorPlayerConnection()
269269
{
270270
#if UNITY_EDITOR
271-
// In the editor, RemoteInputPlayerConnection is a scriptable singleton. Creating multiple instances of it
272-
// will cause an error messages - but will work nevertheless, so we expect those errors to let us run the test.
273-
// We call RemoteInputPlayerConnection.instance once to make sure that we an instance is created, and we get
274-
// a deterministic number of two errors.
275-
var instance = RemoteInputPlayerConnection.instance;
276-
UnityEngine.TestTools.LogAssert.Expect(LogType.Error, "ScriptableSingleton already exists. Did you query the singleton in a constructor?");
277-
UnityEngine.TestTools.LogAssert.Expect(LogType.Error, "ScriptableSingleton already exists. Did you query the singleton in a constructor?");
271+
// Ensure the singleton is initialized deterministically in editor.
272+
_ = RemoteInputPlayerConnection.instance;
278273
#endif
279274
var connectionToEditor = ScriptableObject.CreateInstance<RemoteInputPlayerConnection>();
280275
var connectionToPlayer = ScriptableObject.CreateInstance<RemoteInputPlayerConnection>();

0 commit comments

Comments
 (0)