Skip to content

Commit

Permalink
Tests: add Test_Entity_CopyValue_no_alloc()
Browse files Browse the repository at this point in the history
  • Loading branch information
friflo committed Dec 10, 2024
1 parent acd8fdc commit 9892d90
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Tests-internal/ECS/Test_Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,17 @@ public static void Test_Entity_delete_with_Script()
AreEqual(1, store.EntityScripts.Length);
AreSame (script2, store.EntityScripts[0].scripts[0]);
}

[Test]
public static void Test_Entity_CopyValue_no_alloc()
{
var copyValue = CopyValueUtils<CopyComponent>.CopyValue;
var source = new CopyComponent();
var target = new CopyComponent();
var start = Mem.GetAllocatedBytes();
copyValue(source, ref target, default);
Mem.AssertNoAlloc(start);
}
}

internal struct MyTag : ITag { }
Expand Down

0 comments on commit 9892d90

Please sign in to comment.