No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FixedListPlaymodeTests.gen.cs 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. 
  2. //------------------------------------------------------------------------------
  3. // <auto-generated>
  4. // This code was generated by a tool.
  5. //
  6. // TextTransform Samples/Packages/com.unity.collections/Unity.Collections.Tests.Playmode/FixedListPlayModeTests.tt
  7. //
  8. // These tests require UNITY_DOTS_DEBUG to be enabled.
  9. //
  10. // Changes to this file may cause incorrect behavior and will be lost if
  11. // the code is regenerated.
  12. // </auto-generated>
  13. //------------------------------------------------------------------------------
  14. using System.Collections;
  15. using NUnit.Framework;
  16. using UnityEngine.TestTools;
  17. using System;
  18. using Unity.Collections;
  19. [TestFixture]
  20. internal class FixedListPlaymodeTests
  21. {
  22. [UnityTest]
  23. #if UNITY_EDITOR // standalone only
  24. [Ignore("Test is for standalone builds only")]
  25. #endif
  26. public IEnumerator FixedListPlaymode_AreCollectionsChecksEnabled()
  27. {
  28. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  29. Assert.IsTrue(false, "Collections checks should not be enabled in standalone playmode tests");
  30. #endif
  31. #if !UNITY_DOTS_DEBUG
  32. Assert.IsTrue(false, "UNITY_DOTS_DEBUG should be defined in standalone playmode tests");
  33. #endif
  34. yield break;
  35. }
  36. [UnityTest]
  37. public IEnumerator FixedList32BytePlaymode_GenericHasExpectedCapacity()
  38. {
  39. var list = new FixedList32Bytes<byte>();
  40. var expectedCapacity = list.Capacity;
  41. for(int i = 0; i < expectedCapacity; ++i)
  42. list.Add((byte)i);
  43. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((byte)expectedCapacity); });
  44. yield break;
  45. }
  46. [UnityTest]
  47. public IEnumerator FixedList64BytePlaymode_GenericHasExpectedCapacity()
  48. {
  49. var list = new FixedList64Bytes<byte>();
  50. var expectedCapacity = list.Capacity;
  51. for(int i = 0; i < expectedCapacity; ++i)
  52. list.Add((byte)i);
  53. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((byte)expectedCapacity); });
  54. yield break;
  55. }
  56. [UnityTest]
  57. public IEnumerator FixedList128BytePlaymode_GenericHasExpectedCapacity()
  58. {
  59. var list = new FixedList128Bytes<byte>();
  60. var expectedCapacity = list.Capacity;
  61. for(int i = 0; i < expectedCapacity; ++i)
  62. list.Add((byte)i);
  63. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((byte)expectedCapacity); });
  64. yield break;
  65. }
  66. [UnityTest]
  67. public IEnumerator FixedList32BytePlaymode_HasExpectedCapacity()
  68. {
  69. var list = new FixedList32Bytes<byte>();
  70. var expectedCapacity = list.Capacity;
  71. for(int i = 0; i < expectedCapacity; ++i)
  72. list.Add((byte)i);
  73. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((byte)expectedCapacity); });
  74. yield break;
  75. }
  76. [UnityTest]
  77. public IEnumerator FixedList64BytePlaymode_HasExpectedCapacity()
  78. {
  79. var list = new FixedList64Bytes<byte>();
  80. var expectedCapacity = list.Capacity;
  81. for(int i = 0; i < expectedCapacity; ++i)
  82. list.Add((byte)i);
  83. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((byte)expectedCapacity); });
  84. yield break;
  85. }
  86. [UnityTest]
  87. public IEnumerator FixedList64BytePlaymode_To_FixedList32Byte()
  88. {
  89. var a = new FixedList64Bytes<byte>();
  90. for(var i = 0; i < 62; ++i)
  91. a.Add((byte)i);
  92. Assert.Throws<IndexOutOfRangeException> (() => { var b = new FixedList32Bytes<byte>(a); } );
  93. yield break;
  94. }
  95. [UnityTest]
  96. public IEnumerator FixedList128BytePlaymode_HasExpectedCapacity()
  97. {
  98. var list = new FixedList128Bytes<byte>();
  99. var expectedCapacity = list.Capacity;
  100. for(int i = 0; i < expectedCapacity; ++i)
  101. list.Add((byte)i);
  102. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((byte)expectedCapacity); });
  103. yield break;
  104. }
  105. [UnityTest]
  106. public IEnumerator FixedList128BytePlaymode_To_FixedList32Byte()
  107. {
  108. var a = new FixedList128Bytes<byte>();
  109. for(var i = 0; i < 126; ++i)
  110. a.Add((byte)i);
  111. Assert.Throws<IndexOutOfRangeException> (() => { var b = new FixedList32Bytes<byte>(a); } );
  112. yield break;
  113. }
  114. [UnityTest]
  115. public IEnumerator FixedList128BytePlaymode_To_FixedList64Byte()
  116. {
  117. var a = new FixedList128Bytes<byte>();
  118. for(var i = 0; i < 126; ++i)
  119. a.Add((byte)i);
  120. Assert.Throws<IndexOutOfRangeException> (() => { var b = new FixedList64Bytes<byte>(a); } );
  121. yield break;
  122. }
  123. [UnityTest]
  124. public IEnumerator FixedList32IntPlaymode_GenericHasExpectedCapacity()
  125. {
  126. var list = new FixedList32Bytes<int>();
  127. var expectedCapacity = list.Capacity;
  128. for(int i = 0; i < expectedCapacity; ++i)
  129. list.Add((int)i);
  130. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((int)expectedCapacity); });
  131. yield break;
  132. }
  133. [UnityTest]
  134. public IEnumerator FixedList64IntPlaymode_GenericHasExpectedCapacity()
  135. {
  136. var list = new FixedList64Bytes<int>();
  137. var expectedCapacity = list.Capacity;
  138. for(int i = 0; i < expectedCapacity; ++i)
  139. list.Add((int)i);
  140. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((int)expectedCapacity); });
  141. yield break;
  142. }
  143. [UnityTest]
  144. public IEnumerator FixedList128IntPlaymode_GenericHasExpectedCapacity()
  145. {
  146. var list = new FixedList128Bytes<int>();
  147. var expectedCapacity = list.Capacity;
  148. for(int i = 0; i < expectedCapacity; ++i)
  149. list.Add((int)i);
  150. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((int)expectedCapacity); });
  151. yield break;
  152. }
  153. [UnityTest]
  154. public IEnumerator FixedList32IntPlaymode_HasExpectedCapacity()
  155. {
  156. var list = new FixedList32Bytes<int>();
  157. var expectedCapacity = list.Capacity;
  158. for(int i = 0; i < expectedCapacity; ++i)
  159. list.Add((int)i);
  160. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((int)expectedCapacity); });
  161. yield break;
  162. }
  163. [UnityTest]
  164. public IEnumerator FixedList64IntPlaymode_HasExpectedCapacity()
  165. {
  166. var list = new FixedList64Bytes<int>();
  167. var expectedCapacity = list.Capacity;
  168. for(int i = 0; i < expectedCapacity; ++i)
  169. list.Add((int)i);
  170. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((int)expectedCapacity); });
  171. yield break;
  172. }
  173. [UnityTest]
  174. public IEnumerator FixedList64IntPlaymode_To_FixedList32Int()
  175. {
  176. var a = new FixedList64Bytes<int>();
  177. for(var i = 0; i < 15; ++i)
  178. a.Add((int)i);
  179. Assert.Throws<IndexOutOfRangeException> (() => { var b = new FixedList32Bytes<int>(a); } );
  180. yield break;
  181. }
  182. [UnityTest]
  183. public IEnumerator FixedList128IntPlaymode_HasExpectedCapacity()
  184. {
  185. var list = new FixedList128Bytes<int>();
  186. var expectedCapacity = list.Capacity;
  187. for(int i = 0; i < expectedCapacity; ++i)
  188. list.Add((int)i);
  189. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((int)expectedCapacity); });
  190. yield break;
  191. }
  192. [UnityTest]
  193. public IEnumerator FixedList128IntPlaymode_To_FixedList32Int()
  194. {
  195. var a = new FixedList128Bytes<int>();
  196. for(var i = 0; i < 31; ++i)
  197. a.Add((int)i);
  198. Assert.Throws<IndexOutOfRangeException> (() => { var b = new FixedList32Bytes<int>(a); } );
  199. yield break;
  200. }
  201. [UnityTest]
  202. public IEnumerator FixedList128IntPlaymode_To_FixedList64Int()
  203. {
  204. var a = new FixedList128Bytes<int>();
  205. for(var i = 0; i < 31; ++i)
  206. a.Add((int)i);
  207. Assert.Throws<IndexOutOfRangeException> (() => { var b = new FixedList64Bytes<int>(a); } );
  208. yield break;
  209. }
  210. [UnityTest]
  211. public IEnumerator FixedList32FloatPlaymode_GenericHasExpectedCapacity()
  212. {
  213. var list = new FixedList32Bytes<float>();
  214. var expectedCapacity = list.Capacity;
  215. for(int i = 0; i < expectedCapacity; ++i)
  216. list.Add((float)i);
  217. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((float)expectedCapacity); });
  218. yield break;
  219. }
  220. [UnityTest]
  221. public IEnumerator FixedList64FloatPlaymode_GenericHasExpectedCapacity()
  222. {
  223. var list = new FixedList64Bytes<float>();
  224. var expectedCapacity = list.Capacity;
  225. for(int i = 0; i < expectedCapacity; ++i)
  226. list.Add((float)i);
  227. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((float)expectedCapacity); });
  228. yield break;
  229. }
  230. [UnityTest]
  231. public IEnumerator FixedList128FloatPlaymode_GenericHasExpectedCapacity()
  232. {
  233. var list = new FixedList128Bytes<float>();
  234. var expectedCapacity = list.Capacity;
  235. for(int i = 0; i < expectedCapacity; ++i)
  236. list.Add((float)i);
  237. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((float)expectedCapacity); });
  238. yield break;
  239. }
  240. [UnityTest]
  241. public IEnumerator FixedList32FloatPlaymode_HasExpectedCapacity()
  242. {
  243. var list = new FixedList32Bytes<float>();
  244. var expectedCapacity = list.Capacity;
  245. for(int i = 0; i < expectedCapacity; ++i)
  246. list.Add((float)i);
  247. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((float)expectedCapacity); });
  248. yield break;
  249. }
  250. [UnityTest]
  251. public IEnumerator FixedList64FloatPlaymode_HasExpectedCapacity()
  252. {
  253. var list = new FixedList64Bytes<float>();
  254. var expectedCapacity = list.Capacity;
  255. for(int i = 0; i < expectedCapacity; ++i)
  256. list.Add((float)i);
  257. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((float)expectedCapacity); });
  258. yield break;
  259. }
  260. [UnityTest]
  261. public IEnumerator FixedList64FloatPlaymode_To_FixedList32Float()
  262. {
  263. var a = new FixedList64Bytes<float>();
  264. for(var i = 0; i < 15; ++i)
  265. a.Add((float)i);
  266. Assert.Throws<IndexOutOfRangeException> (() => { var b = new FixedList32Bytes<float>(a); } );
  267. yield break;
  268. }
  269. [UnityTest]
  270. public IEnumerator FixedList128FloatPlaymode_HasExpectedCapacity()
  271. {
  272. var list = new FixedList128Bytes<float>();
  273. var expectedCapacity = list.Capacity;
  274. for(int i = 0; i < expectedCapacity; ++i)
  275. list.Add((float)i);
  276. Assert.Throws<IndexOutOfRangeException> (() => { list.Add((float)expectedCapacity); });
  277. yield break;
  278. }
  279. [UnityTest]
  280. public IEnumerator FixedList128FloatPlaymode_To_FixedList32Float()
  281. {
  282. var a = new FixedList128Bytes<float>();
  283. for(var i = 0; i < 31; ++i)
  284. a.Add((float)i);
  285. Assert.Throws<IndexOutOfRangeException> (() => { var b = new FixedList32Bytes<float>(a); } );
  286. yield break;
  287. }
  288. [UnityTest]
  289. public IEnumerator FixedList128FloatPlaymode_To_FixedList64Float()
  290. {
  291. var a = new FixedList128Bytes<float>();
  292. for(var i = 0; i < 31; ++i)
  293. a.Add((float)i);
  294. Assert.Throws<IndexOutOfRangeException> (() => { var b = new FixedList64Bytes<float>(a); } );
  295. yield break;
  296. }
  297. }