//------------------------------------------------------------------------------ // // This code was generated by a tool. // // TextTransform Samples/Packages/com.unity.collections/Unity.Collections.Tests.Playmode/FixedListPlayModeTests.tt // // These tests require UNITY_DOTS_DEBUG to be enabled. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ using System.Collections; using NUnit.Framework; using UnityEngine.TestTools; using System; using Unity.Collections; [TestFixture] internal class FixedListPlaymodeTests { [UnityTest] #if UNITY_EDITOR // standalone only [Ignore("Test is for standalone builds only")] #endif public IEnumerator FixedListPlaymode_AreCollectionsChecksEnabled() { #if ENABLE_UNITY_COLLECTIONS_CHECKS Assert.IsTrue(false, "Collections checks should not be enabled in standalone playmode tests"); #endif #if !UNITY_DOTS_DEBUG Assert.IsTrue(false, "UNITY_DOTS_DEBUG should be defined in standalone playmode tests"); #endif yield break; } [UnityTest] public IEnumerator FixedList32BytePlaymode_GenericHasExpectedCapacity() { var list = new FixedList32Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((byte)i); Assert.Throws (() => { list.Add((byte)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList64BytePlaymode_GenericHasExpectedCapacity() { var list = new FixedList64Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((byte)i); Assert.Throws (() => { list.Add((byte)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList128BytePlaymode_GenericHasExpectedCapacity() { var list = new FixedList128Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((byte)i); Assert.Throws (() => { list.Add((byte)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList32BytePlaymode_HasExpectedCapacity() { var list = new FixedList32Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((byte)i); Assert.Throws (() => { list.Add((byte)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList64BytePlaymode_HasExpectedCapacity() { var list = new FixedList64Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((byte)i); Assert.Throws (() => { list.Add((byte)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList64BytePlaymode_To_FixedList32Byte() { var a = new FixedList64Bytes(); for(var i = 0; i < 62; ++i) a.Add((byte)i); Assert.Throws (() => { var b = new FixedList32Bytes(a); } ); yield break; } [UnityTest] public IEnumerator FixedList128BytePlaymode_HasExpectedCapacity() { var list = new FixedList128Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((byte)i); Assert.Throws (() => { list.Add((byte)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList128BytePlaymode_To_FixedList32Byte() { var a = new FixedList128Bytes(); for(var i = 0; i < 126; ++i) a.Add((byte)i); Assert.Throws (() => { var b = new FixedList32Bytes(a); } ); yield break; } [UnityTest] public IEnumerator FixedList128BytePlaymode_To_FixedList64Byte() { var a = new FixedList128Bytes(); for(var i = 0; i < 126; ++i) a.Add((byte)i); Assert.Throws (() => { var b = new FixedList64Bytes(a); } ); yield break; } [UnityTest] public IEnumerator FixedList32IntPlaymode_GenericHasExpectedCapacity() { var list = new FixedList32Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((int)i); Assert.Throws (() => { list.Add((int)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList64IntPlaymode_GenericHasExpectedCapacity() { var list = new FixedList64Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((int)i); Assert.Throws (() => { list.Add((int)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList128IntPlaymode_GenericHasExpectedCapacity() { var list = new FixedList128Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((int)i); Assert.Throws (() => { list.Add((int)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList32IntPlaymode_HasExpectedCapacity() { var list = new FixedList32Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((int)i); Assert.Throws (() => { list.Add((int)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList64IntPlaymode_HasExpectedCapacity() { var list = new FixedList64Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((int)i); Assert.Throws (() => { list.Add((int)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList64IntPlaymode_To_FixedList32Int() { var a = new FixedList64Bytes(); for(var i = 0; i < 15; ++i) a.Add((int)i); Assert.Throws (() => { var b = new FixedList32Bytes(a); } ); yield break; } [UnityTest] public IEnumerator FixedList128IntPlaymode_HasExpectedCapacity() { var list = new FixedList128Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((int)i); Assert.Throws (() => { list.Add((int)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList128IntPlaymode_To_FixedList32Int() { var a = new FixedList128Bytes(); for(var i = 0; i < 31; ++i) a.Add((int)i); Assert.Throws (() => { var b = new FixedList32Bytes(a); } ); yield break; } [UnityTest] public IEnumerator FixedList128IntPlaymode_To_FixedList64Int() { var a = new FixedList128Bytes(); for(var i = 0; i < 31; ++i) a.Add((int)i); Assert.Throws (() => { var b = new FixedList64Bytes(a); } ); yield break; } [UnityTest] public IEnumerator FixedList32FloatPlaymode_GenericHasExpectedCapacity() { var list = new FixedList32Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((float)i); Assert.Throws (() => { list.Add((float)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList64FloatPlaymode_GenericHasExpectedCapacity() { var list = new FixedList64Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((float)i); Assert.Throws (() => { list.Add((float)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList128FloatPlaymode_GenericHasExpectedCapacity() { var list = new FixedList128Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((float)i); Assert.Throws (() => { list.Add((float)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList32FloatPlaymode_HasExpectedCapacity() { var list = new FixedList32Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((float)i); Assert.Throws (() => { list.Add((float)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList64FloatPlaymode_HasExpectedCapacity() { var list = new FixedList64Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((float)i); Assert.Throws (() => { list.Add((float)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList64FloatPlaymode_To_FixedList32Float() { var a = new FixedList64Bytes(); for(var i = 0; i < 15; ++i) a.Add((float)i); Assert.Throws (() => { var b = new FixedList32Bytes(a); } ); yield break; } [UnityTest] public IEnumerator FixedList128FloatPlaymode_HasExpectedCapacity() { var list = new FixedList128Bytes(); var expectedCapacity = list.Capacity; for(int i = 0; i < expectedCapacity; ++i) list.Add((float)i); Assert.Throws (() => { list.Add((float)expectedCapacity); }); yield break; } [UnityTest] public IEnumerator FixedList128FloatPlaymode_To_FixedList32Float() { var a = new FixedList128Bytes(); for(var i = 0; i < 31; ++i) a.Add((float)i); Assert.Throws (() => { var b = new FixedList32Bytes(a); } ); yield break; } [UnityTest] public IEnumerator FixedList128FloatPlaymode_To_FixedList64Float() { var a = new FixedList128Bytes(); for(var i = 0; i < 31; ++i) a.Add((float)i); Assert.Throws (() => { var b = new FixedList64Bytes(a); } ); yield break; } }