You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Tests/Editor/Serialization/NetworkSceneHandleTests.cs
+16-6Lines changed: 16 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,20 @@ public void NetworkSceneHandleSerializationTest()
14
14
Assert.That(writer.Position,Is.EqualTo(0),"Writer position should be zero");
15
15
16
16
writer.WriteValue(handle);
17
-
18
-
Assert.That(writer.Position,Is.EqualTo(sizeof(ulong)),"Writer position should not be beyond size");
17
+
#if SCENE_MANAGEMENT_SCENE_HANDLE_MUST_USE_ULONG
18
+
Assert.That(writer.Position,Is.EqualTo(sizeof(ulong)),$"Writer position should not be beyond size! Expected: {sizeof(ulong)} Actual: {writer.Position}");
19
+
#else
20
+
Assert.That(writer.Position,Is.EqualTo(sizeof(int)),$"Writer position should not be beyond size! Expected: {sizeof(int)} Actual: {writer.Position}");
Assert.That(writer.Position,Is.EqualTo(sizeof(ulong)),"Reader position should not be beyond size");
26
+
#if SCENE_MANAGEMENT_SCENE_HANDLE_MUST_USE_ULONG
27
+
Assert.That(reader.Position,Is.EqualTo(sizeof(ulong)),$"Reader position should not be beyond size! Expected: {sizeof(ulong)} Actual: {reader.Position}");
28
+
#else
29
+
Assert.That(reader.Position,Is.EqualTo(sizeof(int)),$"Reader position should not be beyond size! Expected: {sizeof(int)} Actual: {reader.Position}");
30
+
#endif
24
31
25
32
Assert.AreEqual(handle,deserializedHandle);
26
33
@@ -32,14 +39,17 @@ public void NetworkSceneHandleSerializationTest()
32
39
Assert.That(listWriter.Position,Is.EqualTo(0),"Writer position should be zero");
Assert.That(listWriter.Position,Is.EqualTo(expectedSize),$"Writer position should not be beyond size! Expected: {expectedSize} Actual: {listWriter.Position}");
Assert.That(listReader.Position,Is.EqualTo(expectedSize),"Reader position should not be beyond expected size");
52
+
Assert.That(listReader.Position,Is.EqualTo(expectedSize),$"Reader position should not be beyond expected size! Expected: {expectedSize} Actual: {listReader.Position}");
0 commit comments