From 9892d906e02e2bba893a9a808bde939a41eabdb1 Mon Sep 17 00:00:00 2001 From: friflo Date: Tue, 10 Dec 2024 06:43:29 +0100 Subject: [PATCH] Tests: add Test_Entity_CopyValue_no_alloc() --- src/Tests-internal/ECS/Test_Entity.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Tests-internal/ECS/Test_Entity.cs b/src/Tests-internal/ECS/Test_Entity.cs index 6b94077d..5e64b229 100644 --- a/src/Tests-internal/ECS/Test_Entity.cs +++ b/src/Tests-internal/ECS/Test_Entity.cs @@ -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.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 { }