]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix SpawnAndDeleteEntityCountTest Entities and last assert being incorrect (#40511)
authorDrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
Tue, 23 Sep 2025 21:52:15 +0000 (14:52 -0700)
committerGitHub <noreply@github.com>
Tue, 23 Sep 2025 21:52:15 +0000 (23:52 +0200)
Fix SpawnAndDeleteEntityCountTest last assert being incorrect

Content.IntegrationTests/Tests/EntityTest.cs

index 1222096e0193d925df241d7b5f2aa97389053927..9b0e7729f5bccd1263d7a2a9656ffdcfc197c2e1 100644 (file)
@@ -271,7 +271,7 @@ namespace Content.IntegrationTests.Tests
 
             // We consider only non-audio entities, as some entities will just play sounds when they spawn.
             int Count(IEntityManager ent) => ent.EntityCount - ent.Count<AudioComponent>();
-            IEnumerable<EntityUid> Entities(IEntityManager entMan) => entMan.GetEntities().Where(entMan.HasComponent<AudioComponent>);
+            IEnumerable<EntityUid> Entities(IEntityManager entMan) => entMan.GetEntities().Where(e => !entMan.HasComponent<AudioComponent>(e));
 
             await Assert.MultipleAsync(async () =>
             {
@@ -311,8 +311,8 @@ namespace Content.IntegrationTests.Tests
                     // Check that the number of entities has gone back to the original value.
                     Assert.That(Count(server.EntMan), Is.EqualTo(count), $"Server prototype {protoId} failed on deletion: count didn't reset properly\n" +
                         BuildDiffString(serverEntities, Entities(server.EntMan), server.EntMan));
-                    Assert.That(client.EntMan.EntityCount, Is.EqualTo(clientCount), $"Client prototype {protoId} failed on deletion: count didn't reset properly:\n" +
-                        $"Expected {clientCount} and found {client.EntMan.EntityCount}.\n" +
+                    Assert.That(Count(client.EntMan), Is.EqualTo(clientCount), $"Client prototype {protoId} failed on deletion: count didn't reset properly:\n" +
+                        $"Expected {clientCount} and found {Count(client.EntMan)}.\n" +
                         $"Server count was {count}.\n" +
                         BuildDiffString(clientEntities, Entities(client.EntMan), client.EntMan));
                 }