public void NativeBucket_Copy_Add_Clear_Add() { var list = new NativeBucket <int>(100, Allocator.Persistent); var listC = (NativeBucket <int> .Concurrent)list; listC.Add(1); listC.Add(2); var listC2 = listC; listC2.Add(3); listC2.Add(4); list.Clear(); Assert.AreEqual(0, list.Length); listC.Add(10); listC.Add(20); listC2.Add(30); listC2.Add(40); var array = list.ToArray(); Assert.AreEqual(4, array.Length); Assert.AreEqual(10, array[0]); Assert.AreEqual(20, array[1]); Assert.AreEqual(30, array[2]); Assert.AreEqual(40, array[3]); list.Dispose(); }
public void NativeBucket_Copy_Add_Clear() { var list = new NativeBucket <int>(100, Allocator.Persistent); var listC = (NativeBucket <int> .Concurrent)list; listC.Add(1); listC.Add(2); var listC2 = listC; listC2.Add(3); listC2.Add(4); list.Clear(); Assert.AreEqual(0, list.Length); list.Dispose(); }