Nessuna descrizione
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.

NativeHashSetTests.gen.cs 64KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013
  1. using System;
  2. using NUnit.Framework;
  3. using Unity.Collections;
  4. using Unity.Collections.LowLevel.Unsafe;
  5. using Unity.Collections.Tests;
  6. internal class NativeHashSetTestsGenerated : CollectionsTestFixture
  7. {
  8. static void ExpectedCount<T>(ref NativeHashSet<T> container, int expected)
  9. where T : unmanaged, IEquatable<T>
  10. {
  11. Assert.AreEqual(expected == 0, container.IsEmpty);
  12. Assert.AreEqual(expected, container.Count);
  13. }
  14. [Test]
  15. public void NativeHashSet_NativeHashSet_EIU_ExceptWith_Empty()
  16. {
  17. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  18. var other = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  19. container.ExceptWith(other);
  20. ExpectedCount(ref container, 0);
  21. container.Dispose();
  22. other.Dispose();
  23. }
  24. [Test]
  25. public void NativeHashSet_NativeHashSet_EIU_ExceptWith_AxB()
  26. {
  27. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  28. var other = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  29. container.ExceptWith(other);
  30. ExpectedCount(ref container, 3);
  31. Assert.True(container.Contains(0));
  32. Assert.True(container.Contains(1));
  33. Assert.True(container.Contains(2));
  34. container.Dispose();
  35. other.Dispose();
  36. }
  37. [Test]
  38. public void NativeHashSet_NativeHashSet_EIU_IntersectWith_Empty()
  39. {
  40. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  41. var other = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  42. container.IntersectWith(other);
  43. ExpectedCount(ref container, 0);
  44. container.Dispose();
  45. other.Dispose();
  46. }
  47. [Test]
  48. public void NativeHashSet_NativeHashSet_EIU_IntersectWith()
  49. {
  50. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  51. var other = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  52. container.IntersectWith(other);
  53. ExpectedCount(ref container, 3);
  54. Assert.True(container.Contains(3));
  55. Assert.True(container.Contains(4));
  56. Assert.True(container.Contains(5));
  57. container.Dispose();
  58. other.Dispose();
  59. }
  60. [Test]
  61. public void NativeHashSet_NativeHashSet_EIU_UnionWith_Empty()
  62. {
  63. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  64. var other = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  65. container.UnionWith(other);
  66. ExpectedCount(ref container, 0);
  67. container.Dispose();
  68. other.Dispose();
  69. }
  70. [Test]
  71. public void NativeHashSet_NativeHashSet_EIU_UnionWith()
  72. {
  73. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  74. var other = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  75. container.UnionWith(other);
  76. ExpectedCount(ref container, 9);
  77. Assert.True(container.Contains(0));
  78. Assert.True(container.Contains(1));
  79. Assert.True(container.Contains(2));
  80. Assert.True(container.Contains(3));
  81. Assert.True(container.Contains(4));
  82. Assert.True(container.Contains(5));
  83. Assert.True(container.Contains(6));
  84. Assert.True(container.Contains(7));
  85. Assert.True(container.Contains(8));
  86. container.Dispose();
  87. other.Dispose();
  88. }
  89. [Test]
  90. public void NativeHashSet_UnsafeHashSet_EIU_ExceptWith_Empty()
  91. {
  92. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  93. var other = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  94. container.ExceptWith(other);
  95. ExpectedCount(ref container, 0);
  96. container.Dispose();
  97. other.Dispose();
  98. }
  99. [Test]
  100. public void NativeHashSet_UnsafeHashSet_EIU_ExceptWith_AxB()
  101. {
  102. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  103. var other = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  104. container.ExceptWith(other);
  105. ExpectedCount(ref container, 3);
  106. Assert.True(container.Contains(0));
  107. Assert.True(container.Contains(1));
  108. Assert.True(container.Contains(2));
  109. container.Dispose();
  110. other.Dispose();
  111. }
  112. [Test]
  113. public void NativeHashSet_UnsafeHashSet_EIU_IntersectWith_Empty()
  114. {
  115. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  116. var other = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  117. container.IntersectWith(other);
  118. ExpectedCount(ref container, 0);
  119. container.Dispose();
  120. other.Dispose();
  121. }
  122. [Test]
  123. public void NativeHashSet_UnsafeHashSet_EIU_IntersectWith()
  124. {
  125. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  126. var other = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  127. container.IntersectWith(other);
  128. ExpectedCount(ref container, 3);
  129. Assert.True(container.Contains(3));
  130. Assert.True(container.Contains(4));
  131. Assert.True(container.Contains(5));
  132. container.Dispose();
  133. other.Dispose();
  134. }
  135. [Test]
  136. public void NativeHashSet_UnsafeHashSet_EIU_UnionWith_Empty()
  137. {
  138. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  139. var other = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  140. container.UnionWith(other);
  141. ExpectedCount(ref container, 0);
  142. container.Dispose();
  143. other.Dispose();
  144. }
  145. [Test]
  146. public void NativeHashSet_UnsafeHashSet_EIU_UnionWith()
  147. {
  148. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  149. var other = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  150. container.UnionWith(other);
  151. ExpectedCount(ref container, 9);
  152. Assert.True(container.Contains(0));
  153. Assert.True(container.Contains(1));
  154. Assert.True(container.Contains(2));
  155. Assert.True(container.Contains(3));
  156. Assert.True(container.Contains(4));
  157. Assert.True(container.Contains(5));
  158. Assert.True(container.Contains(6));
  159. Assert.True(container.Contains(7));
  160. Assert.True(container.Contains(8));
  161. container.Dispose();
  162. other.Dispose();
  163. }
  164. [Test]
  165. public void NativeHashSet_NativeParallelHashSet_EIU_ExceptWith_Empty()
  166. {
  167. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  168. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  169. container.ExceptWith(other);
  170. ExpectedCount(ref container, 0);
  171. container.Dispose();
  172. other.Dispose();
  173. }
  174. [Test]
  175. public void NativeHashSet_NativeParallelHashSet_EIU_ExceptWith_AxB()
  176. {
  177. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  178. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  179. container.ExceptWith(other);
  180. ExpectedCount(ref container, 3);
  181. Assert.True(container.Contains(0));
  182. Assert.True(container.Contains(1));
  183. Assert.True(container.Contains(2));
  184. container.Dispose();
  185. other.Dispose();
  186. }
  187. [Test]
  188. public void NativeHashSet_NativeParallelHashSet_EIU_IntersectWith_Empty()
  189. {
  190. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  191. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  192. container.IntersectWith(other);
  193. ExpectedCount(ref container, 0);
  194. container.Dispose();
  195. other.Dispose();
  196. }
  197. [Test]
  198. public void NativeHashSet_NativeParallelHashSet_EIU_IntersectWith()
  199. {
  200. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  201. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  202. container.IntersectWith(other);
  203. ExpectedCount(ref container, 3);
  204. Assert.True(container.Contains(3));
  205. Assert.True(container.Contains(4));
  206. Assert.True(container.Contains(5));
  207. container.Dispose();
  208. other.Dispose();
  209. }
  210. [Test]
  211. public void NativeHashSet_NativeParallelHashSet_EIU_UnionWith_Empty()
  212. {
  213. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  214. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  215. container.UnionWith(other);
  216. ExpectedCount(ref container, 0);
  217. container.Dispose();
  218. other.Dispose();
  219. }
  220. [Test]
  221. public void NativeHashSet_NativeParallelHashSet_EIU_UnionWith()
  222. {
  223. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  224. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  225. container.UnionWith(other);
  226. ExpectedCount(ref container, 9);
  227. Assert.True(container.Contains(0));
  228. Assert.True(container.Contains(1));
  229. Assert.True(container.Contains(2));
  230. Assert.True(container.Contains(3));
  231. Assert.True(container.Contains(4));
  232. Assert.True(container.Contains(5));
  233. Assert.True(container.Contains(6));
  234. Assert.True(container.Contains(7));
  235. Assert.True(container.Contains(8));
  236. container.Dispose();
  237. other.Dispose();
  238. }
  239. [Test]
  240. public void NativeHashSet_UnsafeParallelHashSet_EIU_ExceptWith_Empty()
  241. {
  242. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  243. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  244. container.ExceptWith(other);
  245. ExpectedCount(ref container, 0);
  246. container.Dispose();
  247. other.Dispose();
  248. }
  249. [Test]
  250. public void NativeHashSet_UnsafeParallelHashSet_EIU_ExceptWith_AxB()
  251. {
  252. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  253. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  254. container.ExceptWith(other);
  255. ExpectedCount(ref container, 3);
  256. Assert.True(container.Contains(0));
  257. Assert.True(container.Contains(1));
  258. Assert.True(container.Contains(2));
  259. container.Dispose();
  260. other.Dispose();
  261. }
  262. [Test]
  263. public void NativeHashSet_UnsafeParallelHashSet_EIU_IntersectWith_Empty()
  264. {
  265. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  266. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  267. container.IntersectWith(other);
  268. ExpectedCount(ref container, 0);
  269. container.Dispose();
  270. other.Dispose();
  271. }
  272. [Test]
  273. public void NativeHashSet_UnsafeParallelHashSet_EIU_IntersectWith()
  274. {
  275. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  276. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  277. container.IntersectWith(other);
  278. ExpectedCount(ref container, 3);
  279. Assert.True(container.Contains(3));
  280. Assert.True(container.Contains(4));
  281. Assert.True(container.Contains(5));
  282. container.Dispose();
  283. other.Dispose();
  284. }
  285. [Test]
  286. public void NativeHashSet_UnsafeParallelHashSet_EIU_UnionWith_Empty()
  287. {
  288. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  289. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  290. container.UnionWith(other);
  291. ExpectedCount(ref container, 0);
  292. container.Dispose();
  293. other.Dispose();
  294. }
  295. [Test]
  296. public void NativeHashSet_UnsafeParallelHashSet_EIU_UnionWith()
  297. {
  298. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  299. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  300. container.UnionWith(other);
  301. ExpectedCount(ref container, 9);
  302. Assert.True(container.Contains(0));
  303. Assert.True(container.Contains(1));
  304. Assert.True(container.Contains(2));
  305. Assert.True(container.Contains(3));
  306. Assert.True(container.Contains(4));
  307. Assert.True(container.Contains(5));
  308. Assert.True(container.Contains(6));
  309. Assert.True(container.Contains(7));
  310. Assert.True(container.Contains(8));
  311. container.Dispose();
  312. other.Dispose();
  313. }
  314. [Test]
  315. public void NativeHashSet_NativeList_EIU_ExceptWith_Empty()
  316. {
  317. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  318. var other = new NativeList<int>(8, CommonRwdAllocator.Handle) { };
  319. container.ExceptWith(other);
  320. ExpectedCount(ref container, 0);
  321. container.Dispose();
  322. other.Dispose();
  323. }
  324. [Test]
  325. public void NativeHashSet_NativeList_EIU_ExceptWith_AxB()
  326. {
  327. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  328. var other = new NativeList<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  329. container.ExceptWith(other);
  330. ExpectedCount(ref container, 3);
  331. Assert.True(container.Contains(0));
  332. Assert.True(container.Contains(1));
  333. Assert.True(container.Contains(2));
  334. container.Dispose();
  335. other.Dispose();
  336. }
  337. [Test]
  338. public void NativeHashSet_NativeList_EIU_IntersectWith_Empty()
  339. {
  340. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  341. var other = new NativeList<int>(8, CommonRwdAllocator.Handle) { };
  342. container.IntersectWith(other);
  343. ExpectedCount(ref container, 0);
  344. container.Dispose();
  345. other.Dispose();
  346. }
  347. [Test]
  348. public void NativeHashSet_NativeList_EIU_IntersectWith()
  349. {
  350. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  351. var other = new NativeList<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  352. container.IntersectWith(other);
  353. ExpectedCount(ref container, 3);
  354. Assert.True(container.Contains(3));
  355. Assert.True(container.Contains(4));
  356. Assert.True(container.Contains(5));
  357. container.Dispose();
  358. other.Dispose();
  359. }
  360. [Test]
  361. public void NativeHashSet_NativeList_EIU_UnionWith_Empty()
  362. {
  363. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  364. var other = new NativeList<int>(8, CommonRwdAllocator.Handle) { };
  365. container.UnionWith(other);
  366. ExpectedCount(ref container, 0);
  367. container.Dispose();
  368. other.Dispose();
  369. }
  370. [Test]
  371. public void NativeHashSet_NativeList_EIU_UnionWith()
  372. {
  373. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  374. var other = new NativeList<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  375. container.UnionWith(other);
  376. ExpectedCount(ref container, 9);
  377. Assert.True(container.Contains(0));
  378. Assert.True(container.Contains(1));
  379. Assert.True(container.Contains(2));
  380. Assert.True(container.Contains(3));
  381. Assert.True(container.Contains(4));
  382. Assert.True(container.Contains(5));
  383. Assert.True(container.Contains(6));
  384. Assert.True(container.Contains(7));
  385. Assert.True(container.Contains(8));
  386. container.Dispose();
  387. other.Dispose();
  388. }
  389. [Test]
  390. public void NativeHashSet_UnsafeList_EIU_ExceptWith_Empty()
  391. {
  392. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  393. var other = new UnsafeList<int>(8, CommonRwdAllocator.Handle) { };
  394. container.ExceptWith(other);
  395. ExpectedCount(ref container, 0);
  396. container.Dispose();
  397. other.Dispose();
  398. }
  399. [Test]
  400. public void NativeHashSet_UnsafeList_EIU_ExceptWith_AxB()
  401. {
  402. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  403. var other = new UnsafeList<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  404. container.ExceptWith(other);
  405. ExpectedCount(ref container, 3);
  406. Assert.True(container.Contains(0));
  407. Assert.True(container.Contains(1));
  408. Assert.True(container.Contains(2));
  409. container.Dispose();
  410. other.Dispose();
  411. }
  412. [Test]
  413. public void NativeHashSet_UnsafeList_EIU_IntersectWith_Empty()
  414. {
  415. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  416. var other = new UnsafeList<int>(8, CommonRwdAllocator.Handle) { };
  417. container.IntersectWith(other);
  418. ExpectedCount(ref container, 0);
  419. container.Dispose();
  420. other.Dispose();
  421. }
  422. [Test]
  423. public void NativeHashSet_UnsafeList_EIU_IntersectWith()
  424. {
  425. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  426. var other = new UnsafeList<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  427. container.IntersectWith(other);
  428. ExpectedCount(ref container, 3);
  429. Assert.True(container.Contains(3));
  430. Assert.True(container.Contains(4));
  431. Assert.True(container.Contains(5));
  432. container.Dispose();
  433. other.Dispose();
  434. }
  435. [Test]
  436. public void NativeHashSet_UnsafeList_EIU_UnionWith_Empty()
  437. {
  438. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  439. var other = new UnsafeList<int>(8, CommonRwdAllocator.Handle) { };
  440. container.UnionWith(other);
  441. ExpectedCount(ref container, 0);
  442. container.Dispose();
  443. other.Dispose();
  444. }
  445. [Test]
  446. public void NativeHashSet_UnsafeList_EIU_UnionWith()
  447. {
  448. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  449. var other = new UnsafeList<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  450. container.UnionWith(other);
  451. ExpectedCount(ref container, 9);
  452. Assert.True(container.Contains(0));
  453. Assert.True(container.Contains(1));
  454. Assert.True(container.Contains(2));
  455. Assert.True(container.Contains(3));
  456. Assert.True(container.Contains(4));
  457. Assert.True(container.Contains(5));
  458. Assert.True(container.Contains(6));
  459. Assert.True(container.Contains(7));
  460. Assert.True(container.Contains(8));
  461. container.Dispose();
  462. other.Dispose();
  463. }
  464. [Test]
  465. public void NativeHashSet_FixedList32Bytes_EIU_ExceptWith_Empty()
  466. {
  467. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  468. var other = new FixedList32Bytes<int>() { };
  469. container.ExceptWith(other);
  470. ExpectedCount(ref container, 0);
  471. container.Dispose();
  472. }
  473. [Test]
  474. public void NativeHashSet_FixedList32Bytes_EIU_ExceptWith_AxB()
  475. {
  476. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  477. var other = new FixedList32Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  478. container.ExceptWith(other);
  479. ExpectedCount(ref container, 3);
  480. Assert.True(container.Contains(0));
  481. Assert.True(container.Contains(1));
  482. Assert.True(container.Contains(2));
  483. container.Dispose();
  484. }
  485. [Test]
  486. public void NativeHashSet_FixedList32Bytes_EIU_IntersectWith_Empty()
  487. {
  488. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  489. var other = new FixedList32Bytes<int>() { };
  490. container.IntersectWith(other);
  491. ExpectedCount(ref container, 0);
  492. container.Dispose();
  493. }
  494. [Test]
  495. public void NativeHashSet_FixedList32Bytes_EIU_IntersectWith()
  496. {
  497. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  498. var other = new FixedList32Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  499. container.IntersectWith(other);
  500. ExpectedCount(ref container, 3);
  501. Assert.True(container.Contains(3));
  502. Assert.True(container.Contains(4));
  503. Assert.True(container.Contains(5));
  504. container.Dispose();
  505. }
  506. [Test]
  507. public void NativeHashSet_FixedList32Bytes_EIU_UnionWith_Empty()
  508. {
  509. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  510. var other = new FixedList32Bytes<int>() { };
  511. container.UnionWith(other);
  512. ExpectedCount(ref container, 0);
  513. container.Dispose();
  514. }
  515. [Test]
  516. public void NativeHashSet_FixedList32Bytes_EIU_UnionWith()
  517. {
  518. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  519. var other = new FixedList32Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  520. container.UnionWith(other);
  521. ExpectedCount(ref container, 9);
  522. Assert.True(container.Contains(0));
  523. Assert.True(container.Contains(1));
  524. Assert.True(container.Contains(2));
  525. Assert.True(container.Contains(3));
  526. Assert.True(container.Contains(4));
  527. Assert.True(container.Contains(5));
  528. Assert.True(container.Contains(6));
  529. Assert.True(container.Contains(7));
  530. Assert.True(container.Contains(8));
  531. container.Dispose();
  532. }
  533. [Test]
  534. public void NativeHashSet_FixedList64Bytes_EIU_ExceptWith_Empty()
  535. {
  536. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  537. var other = new FixedList64Bytes<int>() { };
  538. container.ExceptWith(other);
  539. ExpectedCount(ref container, 0);
  540. container.Dispose();
  541. }
  542. [Test]
  543. public void NativeHashSet_FixedList64Bytes_EIU_ExceptWith_AxB()
  544. {
  545. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  546. var other = new FixedList64Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  547. container.ExceptWith(other);
  548. ExpectedCount(ref container, 3);
  549. Assert.True(container.Contains(0));
  550. Assert.True(container.Contains(1));
  551. Assert.True(container.Contains(2));
  552. container.Dispose();
  553. }
  554. [Test]
  555. public void NativeHashSet_FixedList64Bytes_EIU_IntersectWith_Empty()
  556. {
  557. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  558. var other = new FixedList64Bytes<int>() { };
  559. container.IntersectWith(other);
  560. ExpectedCount(ref container, 0);
  561. container.Dispose();
  562. }
  563. [Test]
  564. public void NativeHashSet_FixedList64Bytes_EIU_IntersectWith()
  565. {
  566. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  567. var other = new FixedList64Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  568. container.IntersectWith(other);
  569. ExpectedCount(ref container, 3);
  570. Assert.True(container.Contains(3));
  571. Assert.True(container.Contains(4));
  572. Assert.True(container.Contains(5));
  573. container.Dispose();
  574. }
  575. [Test]
  576. public void NativeHashSet_FixedList64Bytes_EIU_UnionWith_Empty()
  577. {
  578. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  579. var other = new FixedList64Bytes<int>() { };
  580. container.UnionWith(other);
  581. ExpectedCount(ref container, 0);
  582. container.Dispose();
  583. }
  584. [Test]
  585. public void NativeHashSet_FixedList64Bytes_EIU_UnionWith()
  586. {
  587. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  588. var other = new FixedList64Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  589. container.UnionWith(other);
  590. ExpectedCount(ref container, 9);
  591. Assert.True(container.Contains(0));
  592. Assert.True(container.Contains(1));
  593. Assert.True(container.Contains(2));
  594. Assert.True(container.Contains(3));
  595. Assert.True(container.Contains(4));
  596. Assert.True(container.Contains(5));
  597. Assert.True(container.Contains(6));
  598. Assert.True(container.Contains(7));
  599. Assert.True(container.Contains(8));
  600. container.Dispose();
  601. }
  602. [Test]
  603. public void NativeHashSet_FixedList128Bytes_EIU_ExceptWith_Empty()
  604. {
  605. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  606. var other = new FixedList128Bytes<int>() { };
  607. container.ExceptWith(other);
  608. ExpectedCount(ref container, 0);
  609. container.Dispose();
  610. }
  611. [Test]
  612. public void NativeHashSet_FixedList128Bytes_EIU_ExceptWith_AxB()
  613. {
  614. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  615. var other = new FixedList128Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  616. container.ExceptWith(other);
  617. ExpectedCount(ref container, 3);
  618. Assert.True(container.Contains(0));
  619. Assert.True(container.Contains(1));
  620. Assert.True(container.Contains(2));
  621. container.Dispose();
  622. }
  623. [Test]
  624. public void NativeHashSet_FixedList128Bytes_EIU_IntersectWith_Empty()
  625. {
  626. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  627. var other = new FixedList128Bytes<int>() { };
  628. container.IntersectWith(other);
  629. ExpectedCount(ref container, 0);
  630. container.Dispose();
  631. }
  632. [Test]
  633. public void NativeHashSet_FixedList128Bytes_EIU_IntersectWith()
  634. {
  635. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  636. var other = new FixedList128Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  637. container.IntersectWith(other);
  638. ExpectedCount(ref container, 3);
  639. Assert.True(container.Contains(3));
  640. Assert.True(container.Contains(4));
  641. Assert.True(container.Contains(5));
  642. container.Dispose();
  643. }
  644. [Test]
  645. public void NativeHashSet_FixedList128Bytes_EIU_UnionWith_Empty()
  646. {
  647. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  648. var other = new FixedList128Bytes<int>() { };
  649. container.UnionWith(other);
  650. ExpectedCount(ref container, 0);
  651. container.Dispose();
  652. }
  653. [Test]
  654. public void NativeHashSet_FixedList128Bytes_EIU_UnionWith()
  655. {
  656. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  657. var other = new FixedList128Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  658. container.UnionWith(other);
  659. ExpectedCount(ref container, 9);
  660. Assert.True(container.Contains(0));
  661. Assert.True(container.Contains(1));
  662. Assert.True(container.Contains(2));
  663. Assert.True(container.Contains(3));
  664. Assert.True(container.Contains(4));
  665. Assert.True(container.Contains(5));
  666. Assert.True(container.Contains(6));
  667. Assert.True(container.Contains(7));
  668. Assert.True(container.Contains(8));
  669. container.Dispose();
  670. }
  671. [Test]
  672. public void NativeHashSet_FixedList512Bytes_EIU_ExceptWith_Empty()
  673. {
  674. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  675. var other = new FixedList512Bytes<int>() { };
  676. container.ExceptWith(other);
  677. ExpectedCount(ref container, 0);
  678. container.Dispose();
  679. }
  680. [Test]
  681. public void NativeHashSet_FixedList512Bytes_EIU_ExceptWith_AxB()
  682. {
  683. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  684. var other = new FixedList512Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  685. container.ExceptWith(other);
  686. ExpectedCount(ref container, 3);
  687. Assert.True(container.Contains(0));
  688. Assert.True(container.Contains(1));
  689. Assert.True(container.Contains(2));
  690. container.Dispose();
  691. }
  692. [Test]
  693. public void NativeHashSet_FixedList512Bytes_EIU_IntersectWith_Empty()
  694. {
  695. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  696. var other = new FixedList512Bytes<int>() { };
  697. container.IntersectWith(other);
  698. ExpectedCount(ref container, 0);
  699. container.Dispose();
  700. }
  701. [Test]
  702. public void NativeHashSet_FixedList512Bytes_EIU_IntersectWith()
  703. {
  704. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  705. var other = new FixedList512Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  706. container.IntersectWith(other);
  707. ExpectedCount(ref container, 3);
  708. Assert.True(container.Contains(3));
  709. Assert.True(container.Contains(4));
  710. Assert.True(container.Contains(5));
  711. container.Dispose();
  712. }
  713. [Test]
  714. public void NativeHashSet_FixedList512Bytes_EIU_UnionWith_Empty()
  715. {
  716. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  717. var other = new FixedList512Bytes<int>() { };
  718. container.UnionWith(other);
  719. ExpectedCount(ref container, 0);
  720. container.Dispose();
  721. }
  722. [Test]
  723. public void NativeHashSet_FixedList512Bytes_EIU_UnionWith()
  724. {
  725. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  726. var other = new FixedList512Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  727. container.UnionWith(other);
  728. ExpectedCount(ref container, 9);
  729. Assert.True(container.Contains(0));
  730. Assert.True(container.Contains(1));
  731. Assert.True(container.Contains(2));
  732. Assert.True(container.Contains(3));
  733. Assert.True(container.Contains(4));
  734. Assert.True(container.Contains(5));
  735. Assert.True(container.Contains(6));
  736. Assert.True(container.Contains(7));
  737. Assert.True(container.Contains(8));
  738. container.Dispose();
  739. }
  740. [Test]
  741. public void NativeHashSet_FixedList4096Bytes_EIU_ExceptWith_Empty()
  742. {
  743. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  744. var other = new FixedList4096Bytes<int>() { };
  745. container.ExceptWith(other);
  746. ExpectedCount(ref container, 0);
  747. container.Dispose();
  748. }
  749. [Test]
  750. public void NativeHashSet_FixedList4096Bytes_EIU_ExceptWith_AxB()
  751. {
  752. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  753. var other = new FixedList4096Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  754. container.ExceptWith(other);
  755. ExpectedCount(ref container, 3);
  756. Assert.True(container.Contains(0));
  757. Assert.True(container.Contains(1));
  758. Assert.True(container.Contains(2));
  759. container.Dispose();
  760. }
  761. [Test]
  762. public void NativeHashSet_FixedList4096Bytes_EIU_IntersectWith_Empty()
  763. {
  764. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  765. var other = new FixedList4096Bytes<int>() { };
  766. container.IntersectWith(other);
  767. ExpectedCount(ref container, 0);
  768. container.Dispose();
  769. }
  770. [Test]
  771. public void NativeHashSet_FixedList4096Bytes_EIU_IntersectWith()
  772. {
  773. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  774. var other = new FixedList4096Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  775. container.IntersectWith(other);
  776. ExpectedCount(ref container, 3);
  777. Assert.True(container.Contains(3));
  778. Assert.True(container.Contains(4));
  779. Assert.True(container.Contains(5));
  780. container.Dispose();
  781. }
  782. [Test]
  783. public void NativeHashSet_FixedList4096Bytes_EIU_UnionWith_Empty()
  784. {
  785. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  786. var other = new FixedList4096Bytes<int>() { };
  787. container.UnionWith(other);
  788. ExpectedCount(ref container, 0);
  789. container.Dispose();
  790. }
  791. [Test]
  792. public void NativeHashSet_FixedList4096Bytes_EIU_UnionWith()
  793. {
  794. var container = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  795. var other = new FixedList4096Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  796. container.UnionWith(other);
  797. ExpectedCount(ref container, 9);
  798. Assert.True(container.Contains(0));
  799. Assert.True(container.Contains(1));
  800. Assert.True(container.Contains(2));
  801. Assert.True(container.Contains(3));
  802. Assert.True(container.Contains(4));
  803. Assert.True(container.Contains(5));
  804. Assert.True(container.Contains(6));
  805. Assert.True(container.Contains(7));
  806. Assert.True(container.Contains(8));
  807. container.Dispose();
  808. }
  809. static void ExpectedCount<T>(ref UnsafeHashSet<T> container, int expected)
  810. where T : unmanaged, IEquatable<T>
  811. {
  812. Assert.AreEqual(expected == 0, container.IsEmpty);
  813. Assert.AreEqual(expected, container.Count);
  814. }
  815. [Test]
  816. public void UnsafeHashSet_NativeHashSet_EIU_ExceptWith_Empty()
  817. {
  818. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  819. var other = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  820. container.ExceptWith(other);
  821. ExpectedCount(ref container, 0);
  822. container.Dispose();
  823. other.Dispose();
  824. }
  825. [Test]
  826. public void UnsafeHashSet_NativeHashSet_EIU_ExceptWith_AxB()
  827. {
  828. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  829. var other = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  830. container.ExceptWith(other);
  831. ExpectedCount(ref container, 3);
  832. Assert.True(container.Contains(0));
  833. Assert.True(container.Contains(1));
  834. Assert.True(container.Contains(2));
  835. container.Dispose();
  836. other.Dispose();
  837. }
  838. [Test]
  839. public void UnsafeHashSet_NativeHashSet_EIU_IntersectWith_Empty()
  840. {
  841. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  842. var other = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  843. container.IntersectWith(other);
  844. ExpectedCount(ref container, 0);
  845. container.Dispose();
  846. other.Dispose();
  847. }
  848. [Test]
  849. public void UnsafeHashSet_NativeHashSet_EIU_IntersectWith()
  850. {
  851. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  852. var other = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  853. container.IntersectWith(other);
  854. ExpectedCount(ref container, 3);
  855. Assert.True(container.Contains(3));
  856. Assert.True(container.Contains(4));
  857. Assert.True(container.Contains(5));
  858. container.Dispose();
  859. other.Dispose();
  860. }
  861. [Test]
  862. public void UnsafeHashSet_NativeHashSet_EIU_UnionWith_Empty()
  863. {
  864. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  865. var other = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  866. container.UnionWith(other);
  867. ExpectedCount(ref container, 0);
  868. container.Dispose();
  869. other.Dispose();
  870. }
  871. [Test]
  872. public void UnsafeHashSet_NativeHashSet_EIU_UnionWith()
  873. {
  874. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  875. var other = new NativeHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  876. container.UnionWith(other);
  877. ExpectedCount(ref container, 9);
  878. Assert.True(container.Contains(0));
  879. Assert.True(container.Contains(1));
  880. Assert.True(container.Contains(2));
  881. Assert.True(container.Contains(3));
  882. Assert.True(container.Contains(4));
  883. Assert.True(container.Contains(5));
  884. Assert.True(container.Contains(6));
  885. Assert.True(container.Contains(7));
  886. Assert.True(container.Contains(8));
  887. container.Dispose();
  888. other.Dispose();
  889. }
  890. [Test]
  891. public void UnsafeHashSet_UnsafeHashSet_EIU_ExceptWith_Empty()
  892. {
  893. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  894. var other = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  895. container.ExceptWith(other);
  896. ExpectedCount(ref container, 0);
  897. container.Dispose();
  898. other.Dispose();
  899. }
  900. [Test]
  901. public void UnsafeHashSet_UnsafeHashSet_EIU_ExceptWith_AxB()
  902. {
  903. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  904. var other = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  905. container.ExceptWith(other);
  906. ExpectedCount(ref container, 3);
  907. Assert.True(container.Contains(0));
  908. Assert.True(container.Contains(1));
  909. Assert.True(container.Contains(2));
  910. container.Dispose();
  911. other.Dispose();
  912. }
  913. [Test]
  914. public void UnsafeHashSet_UnsafeHashSet_EIU_IntersectWith_Empty()
  915. {
  916. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  917. var other = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  918. container.IntersectWith(other);
  919. ExpectedCount(ref container, 0);
  920. container.Dispose();
  921. other.Dispose();
  922. }
  923. [Test]
  924. public void UnsafeHashSet_UnsafeHashSet_EIU_IntersectWith()
  925. {
  926. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  927. var other = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  928. container.IntersectWith(other);
  929. ExpectedCount(ref container, 3);
  930. Assert.True(container.Contains(3));
  931. Assert.True(container.Contains(4));
  932. Assert.True(container.Contains(5));
  933. container.Dispose();
  934. other.Dispose();
  935. }
  936. [Test]
  937. public void UnsafeHashSet_UnsafeHashSet_EIU_UnionWith_Empty()
  938. {
  939. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  940. var other = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  941. container.UnionWith(other);
  942. ExpectedCount(ref container, 0);
  943. container.Dispose();
  944. other.Dispose();
  945. }
  946. [Test]
  947. public void UnsafeHashSet_UnsafeHashSet_EIU_UnionWith()
  948. {
  949. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  950. var other = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  951. container.UnionWith(other);
  952. ExpectedCount(ref container, 9);
  953. Assert.True(container.Contains(0));
  954. Assert.True(container.Contains(1));
  955. Assert.True(container.Contains(2));
  956. Assert.True(container.Contains(3));
  957. Assert.True(container.Contains(4));
  958. Assert.True(container.Contains(5));
  959. Assert.True(container.Contains(6));
  960. Assert.True(container.Contains(7));
  961. Assert.True(container.Contains(8));
  962. container.Dispose();
  963. other.Dispose();
  964. }
  965. [Test]
  966. public void UnsafeHashSet_NativeParallelHashSet_EIU_ExceptWith_Empty()
  967. {
  968. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  969. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  970. container.ExceptWith(other);
  971. ExpectedCount(ref container, 0);
  972. container.Dispose();
  973. other.Dispose();
  974. }
  975. [Test]
  976. public void UnsafeHashSet_NativeParallelHashSet_EIU_ExceptWith_AxB()
  977. {
  978. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  979. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  980. container.ExceptWith(other);
  981. ExpectedCount(ref container, 3);
  982. Assert.True(container.Contains(0));
  983. Assert.True(container.Contains(1));
  984. Assert.True(container.Contains(2));
  985. container.Dispose();
  986. other.Dispose();
  987. }
  988. [Test]
  989. public void UnsafeHashSet_NativeParallelHashSet_EIU_IntersectWith_Empty()
  990. {
  991. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  992. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  993. container.IntersectWith(other);
  994. ExpectedCount(ref container, 0);
  995. container.Dispose();
  996. other.Dispose();
  997. }
  998. [Test]
  999. public void UnsafeHashSet_NativeParallelHashSet_EIU_IntersectWith()
  1000. {
  1001. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1002. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  1003. container.IntersectWith(other);
  1004. ExpectedCount(ref container, 3);
  1005. Assert.True(container.Contains(3));
  1006. Assert.True(container.Contains(4));
  1007. Assert.True(container.Contains(5));
  1008. container.Dispose();
  1009. other.Dispose();
  1010. }
  1011. [Test]
  1012. public void UnsafeHashSet_NativeParallelHashSet_EIU_UnionWith_Empty()
  1013. {
  1014. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1015. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1016. container.UnionWith(other);
  1017. ExpectedCount(ref container, 0);
  1018. container.Dispose();
  1019. other.Dispose();
  1020. }
  1021. [Test]
  1022. public void UnsafeHashSet_NativeParallelHashSet_EIU_UnionWith()
  1023. {
  1024. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1025. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  1026. container.UnionWith(other);
  1027. ExpectedCount(ref container, 9);
  1028. Assert.True(container.Contains(0));
  1029. Assert.True(container.Contains(1));
  1030. Assert.True(container.Contains(2));
  1031. Assert.True(container.Contains(3));
  1032. Assert.True(container.Contains(4));
  1033. Assert.True(container.Contains(5));
  1034. Assert.True(container.Contains(6));
  1035. Assert.True(container.Contains(7));
  1036. Assert.True(container.Contains(8));
  1037. container.Dispose();
  1038. other.Dispose();
  1039. }
  1040. [Test]
  1041. public void UnsafeHashSet_UnsafeParallelHashSet_EIU_ExceptWith_Empty()
  1042. {
  1043. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1044. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1045. container.ExceptWith(other);
  1046. ExpectedCount(ref container, 0);
  1047. container.Dispose();
  1048. other.Dispose();
  1049. }
  1050. [Test]
  1051. public void UnsafeHashSet_UnsafeParallelHashSet_EIU_ExceptWith_AxB()
  1052. {
  1053. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1054. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  1055. container.ExceptWith(other);
  1056. ExpectedCount(ref container, 3);
  1057. Assert.True(container.Contains(0));
  1058. Assert.True(container.Contains(1));
  1059. Assert.True(container.Contains(2));
  1060. container.Dispose();
  1061. other.Dispose();
  1062. }
  1063. [Test]
  1064. public void UnsafeHashSet_UnsafeParallelHashSet_EIU_IntersectWith_Empty()
  1065. {
  1066. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1067. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1068. container.IntersectWith(other);
  1069. ExpectedCount(ref container, 0);
  1070. container.Dispose();
  1071. other.Dispose();
  1072. }
  1073. [Test]
  1074. public void UnsafeHashSet_UnsafeParallelHashSet_EIU_IntersectWith()
  1075. {
  1076. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1077. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  1078. container.IntersectWith(other);
  1079. ExpectedCount(ref container, 3);
  1080. Assert.True(container.Contains(3));
  1081. Assert.True(container.Contains(4));
  1082. Assert.True(container.Contains(5));
  1083. container.Dispose();
  1084. other.Dispose();
  1085. }
  1086. [Test]
  1087. public void UnsafeHashSet_UnsafeParallelHashSet_EIU_UnionWith_Empty()
  1088. {
  1089. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1090. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1091. container.UnionWith(other);
  1092. ExpectedCount(ref container, 0);
  1093. container.Dispose();
  1094. other.Dispose();
  1095. }
  1096. [Test]
  1097. public void UnsafeHashSet_UnsafeParallelHashSet_EIU_UnionWith()
  1098. {
  1099. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1100. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  1101. container.UnionWith(other);
  1102. ExpectedCount(ref container, 9);
  1103. Assert.True(container.Contains(0));
  1104. Assert.True(container.Contains(1));
  1105. Assert.True(container.Contains(2));
  1106. Assert.True(container.Contains(3));
  1107. Assert.True(container.Contains(4));
  1108. Assert.True(container.Contains(5));
  1109. Assert.True(container.Contains(6));
  1110. Assert.True(container.Contains(7));
  1111. Assert.True(container.Contains(8));
  1112. container.Dispose();
  1113. other.Dispose();
  1114. }
  1115. [Test]
  1116. public void UnsafeHashSet_NativeList_EIU_ExceptWith_Empty()
  1117. {
  1118. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1119. var other = new NativeList<int>(8, CommonRwdAllocator.Handle) { };
  1120. container.ExceptWith(other);
  1121. ExpectedCount(ref container, 0);
  1122. container.Dispose();
  1123. other.Dispose();
  1124. }
  1125. [Test]
  1126. public void UnsafeHashSet_NativeList_EIU_ExceptWith_AxB()
  1127. {
  1128. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1129. var other = new NativeList<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  1130. container.ExceptWith(other);
  1131. ExpectedCount(ref container, 3);
  1132. Assert.True(container.Contains(0));
  1133. Assert.True(container.Contains(1));
  1134. Assert.True(container.Contains(2));
  1135. container.Dispose();
  1136. other.Dispose();
  1137. }
  1138. [Test]
  1139. public void UnsafeHashSet_NativeList_EIU_IntersectWith_Empty()
  1140. {
  1141. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1142. var other = new NativeList<int>(8, CommonRwdAllocator.Handle) { };
  1143. container.IntersectWith(other);
  1144. ExpectedCount(ref container, 0);
  1145. container.Dispose();
  1146. other.Dispose();
  1147. }
  1148. [Test]
  1149. public void UnsafeHashSet_NativeList_EIU_IntersectWith()
  1150. {
  1151. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1152. var other = new NativeList<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  1153. container.IntersectWith(other);
  1154. ExpectedCount(ref container, 3);
  1155. Assert.True(container.Contains(3));
  1156. Assert.True(container.Contains(4));
  1157. Assert.True(container.Contains(5));
  1158. container.Dispose();
  1159. other.Dispose();
  1160. }
  1161. [Test]
  1162. public void UnsafeHashSet_NativeList_EIU_UnionWith_Empty()
  1163. {
  1164. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1165. var other = new NativeList<int>(8, CommonRwdAllocator.Handle) { };
  1166. container.UnionWith(other);
  1167. ExpectedCount(ref container, 0);
  1168. container.Dispose();
  1169. other.Dispose();
  1170. }
  1171. [Test]
  1172. public void UnsafeHashSet_NativeList_EIU_UnionWith()
  1173. {
  1174. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1175. var other = new NativeList<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  1176. container.UnionWith(other);
  1177. ExpectedCount(ref container, 9);
  1178. Assert.True(container.Contains(0));
  1179. Assert.True(container.Contains(1));
  1180. Assert.True(container.Contains(2));
  1181. Assert.True(container.Contains(3));
  1182. Assert.True(container.Contains(4));
  1183. Assert.True(container.Contains(5));
  1184. Assert.True(container.Contains(6));
  1185. Assert.True(container.Contains(7));
  1186. Assert.True(container.Contains(8));
  1187. container.Dispose();
  1188. other.Dispose();
  1189. }
  1190. [Test]
  1191. public void UnsafeHashSet_UnsafeList_EIU_ExceptWith_Empty()
  1192. {
  1193. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1194. var other = new UnsafeList<int>(8, CommonRwdAllocator.Handle) { };
  1195. container.ExceptWith(other);
  1196. ExpectedCount(ref container, 0);
  1197. container.Dispose();
  1198. other.Dispose();
  1199. }
  1200. [Test]
  1201. public void UnsafeHashSet_UnsafeList_EIU_ExceptWith_AxB()
  1202. {
  1203. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1204. var other = new UnsafeList<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  1205. container.ExceptWith(other);
  1206. ExpectedCount(ref container, 3);
  1207. Assert.True(container.Contains(0));
  1208. Assert.True(container.Contains(1));
  1209. Assert.True(container.Contains(2));
  1210. container.Dispose();
  1211. other.Dispose();
  1212. }
  1213. [Test]
  1214. public void UnsafeHashSet_UnsafeList_EIU_IntersectWith_Empty()
  1215. {
  1216. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1217. var other = new UnsafeList<int>(8, CommonRwdAllocator.Handle) { };
  1218. container.IntersectWith(other);
  1219. ExpectedCount(ref container, 0);
  1220. container.Dispose();
  1221. other.Dispose();
  1222. }
  1223. [Test]
  1224. public void UnsafeHashSet_UnsafeList_EIU_IntersectWith()
  1225. {
  1226. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1227. var other = new UnsafeList<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  1228. container.IntersectWith(other);
  1229. ExpectedCount(ref container, 3);
  1230. Assert.True(container.Contains(3));
  1231. Assert.True(container.Contains(4));
  1232. Assert.True(container.Contains(5));
  1233. container.Dispose();
  1234. other.Dispose();
  1235. }
  1236. [Test]
  1237. public void UnsafeHashSet_UnsafeList_EIU_UnionWith_Empty()
  1238. {
  1239. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1240. var other = new UnsafeList<int>(8, CommonRwdAllocator.Handle) { };
  1241. container.UnionWith(other);
  1242. ExpectedCount(ref container, 0);
  1243. container.Dispose();
  1244. other.Dispose();
  1245. }
  1246. [Test]
  1247. public void UnsafeHashSet_UnsafeList_EIU_UnionWith()
  1248. {
  1249. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1250. var other = new UnsafeList<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  1251. container.UnionWith(other);
  1252. ExpectedCount(ref container, 9);
  1253. Assert.True(container.Contains(0));
  1254. Assert.True(container.Contains(1));
  1255. Assert.True(container.Contains(2));
  1256. Assert.True(container.Contains(3));
  1257. Assert.True(container.Contains(4));
  1258. Assert.True(container.Contains(5));
  1259. Assert.True(container.Contains(6));
  1260. Assert.True(container.Contains(7));
  1261. Assert.True(container.Contains(8));
  1262. container.Dispose();
  1263. other.Dispose();
  1264. }
  1265. [Test]
  1266. public void UnsafeHashSet_FixedList32Bytes_EIU_ExceptWith_Empty()
  1267. {
  1268. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1269. var other = new FixedList32Bytes<int>() { };
  1270. container.ExceptWith(other);
  1271. ExpectedCount(ref container, 0);
  1272. container.Dispose();
  1273. }
  1274. [Test]
  1275. public void UnsafeHashSet_FixedList32Bytes_EIU_ExceptWith_AxB()
  1276. {
  1277. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1278. var other = new FixedList32Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1279. container.ExceptWith(other);
  1280. ExpectedCount(ref container, 3);
  1281. Assert.True(container.Contains(0));
  1282. Assert.True(container.Contains(1));
  1283. Assert.True(container.Contains(2));
  1284. container.Dispose();
  1285. }
  1286. [Test]
  1287. public void UnsafeHashSet_FixedList32Bytes_EIU_IntersectWith_Empty()
  1288. {
  1289. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1290. var other = new FixedList32Bytes<int>() { };
  1291. container.IntersectWith(other);
  1292. ExpectedCount(ref container, 0);
  1293. container.Dispose();
  1294. }
  1295. [Test]
  1296. public void UnsafeHashSet_FixedList32Bytes_EIU_IntersectWith()
  1297. {
  1298. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1299. var other = new FixedList32Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1300. container.IntersectWith(other);
  1301. ExpectedCount(ref container, 3);
  1302. Assert.True(container.Contains(3));
  1303. Assert.True(container.Contains(4));
  1304. Assert.True(container.Contains(5));
  1305. container.Dispose();
  1306. }
  1307. [Test]
  1308. public void UnsafeHashSet_FixedList32Bytes_EIU_UnionWith_Empty()
  1309. {
  1310. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1311. var other = new FixedList32Bytes<int>() { };
  1312. container.UnionWith(other);
  1313. ExpectedCount(ref container, 0);
  1314. container.Dispose();
  1315. }
  1316. [Test]
  1317. public void UnsafeHashSet_FixedList32Bytes_EIU_UnionWith()
  1318. {
  1319. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1320. var other = new FixedList32Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1321. container.UnionWith(other);
  1322. ExpectedCount(ref container, 9);
  1323. Assert.True(container.Contains(0));
  1324. Assert.True(container.Contains(1));
  1325. Assert.True(container.Contains(2));
  1326. Assert.True(container.Contains(3));
  1327. Assert.True(container.Contains(4));
  1328. Assert.True(container.Contains(5));
  1329. Assert.True(container.Contains(6));
  1330. Assert.True(container.Contains(7));
  1331. Assert.True(container.Contains(8));
  1332. container.Dispose();
  1333. }
  1334. [Test]
  1335. public void UnsafeHashSet_FixedList64Bytes_EIU_ExceptWith_Empty()
  1336. {
  1337. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1338. var other = new FixedList64Bytes<int>() { };
  1339. container.ExceptWith(other);
  1340. ExpectedCount(ref container, 0);
  1341. container.Dispose();
  1342. }
  1343. [Test]
  1344. public void UnsafeHashSet_FixedList64Bytes_EIU_ExceptWith_AxB()
  1345. {
  1346. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1347. var other = new FixedList64Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1348. container.ExceptWith(other);
  1349. ExpectedCount(ref container, 3);
  1350. Assert.True(container.Contains(0));
  1351. Assert.True(container.Contains(1));
  1352. Assert.True(container.Contains(2));
  1353. container.Dispose();
  1354. }
  1355. [Test]
  1356. public void UnsafeHashSet_FixedList64Bytes_EIU_IntersectWith_Empty()
  1357. {
  1358. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1359. var other = new FixedList64Bytes<int>() { };
  1360. container.IntersectWith(other);
  1361. ExpectedCount(ref container, 0);
  1362. container.Dispose();
  1363. }
  1364. [Test]
  1365. public void UnsafeHashSet_FixedList64Bytes_EIU_IntersectWith()
  1366. {
  1367. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1368. var other = new FixedList64Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1369. container.IntersectWith(other);
  1370. ExpectedCount(ref container, 3);
  1371. Assert.True(container.Contains(3));
  1372. Assert.True(container.Contains(4));
  1373. Assert.True(container.Contains(5));
  1374. container.Dispose();
  1375. }
  1376. [Test]
  1377. public void UnsafeHashSet_FixedList64Bytes_EIU_UnionWith_Empty()
  1378. {
  1379. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1380. var other = new FixedList64Bytes<int>() { };
  1381. container.UnionWith(other);
  1382. ExpectedCount(ref container, 0);
  1383. container.Dispose();
  1384. }
  1385. [Test]
  1386. public void UnsafeHashSet_FixedList64Bytes_EIU_UnionWith()
  1387. {
  1388. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1389. var other = new FixedList64Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1390. container.UnionWith(other);
  1391. ExpectedCount(ref container, 9);
  1392. Assert.True(container.Contains(0));
  1393. Assert.True(container.Contains(1));
  1394. Assert.True(container.Contains(2));
  1395. Assert.True(container.Contains(3));
  1396. Assert.True(container.Contains(4));
  1397. Assert.True(container.Contains(5));
  1398. Assert.True(container.Contains(6));
  1399. Assert.True(container.Contains(7));
  1400. Assert.True(container.Contains(8));
  1401. container.Dispose();
  1402. }
  1403. [Test]
  1404. public void UnsafeHashSet_FixedList128Bytes_EIU_ExceptWith_Empty()
  1405. {
  1406. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1407. var other = new FixedList128Bytes<int>() { };
  1408. container.ExceptWith(other);
  1409. ExpectedCount(ref container, 0);
  1410. container.Dispose();
  1411. }
  1412. [Test]
  1413. public void UnsafeHashSet_FixedList128Bytes_EIU_ExceptWith_AxB()
  1414. {
  1415. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1416. var other = new FixedList128Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1417. container.ExceptWith(other);
  1418. ExpectedCount(ref container, 3);
  1419. Assert.True(container.Contains(0));
  1420. Assert.True(container.Contains(1));
  1421. Assert.True(container.Contains(2));
  1422. container.Dispose();
  1423. }
  1424. [Test]
  1425. public void UnsafeHashSet_FixedList128Bytes_EIU_IntersectWith_Empty()
  1426. {
  1427. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1428. var other = new FixedList128Bytes<int>() { };
  1429. container.IntersectWith(other);
  1430. ExpectedCount(ref container, 0);
  1431. container.Dispose();
  1432. }
  1433. [Test]
  1434. public void UnsafeHashSet_FixedList128Bytes_EIU_IntersectWith()
  1435. {
  1436. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1437. var other = new FixedList128Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1438. container.IntersectWith(other);
  1439. ExpectedCount(ref container, 3);
  1440. Assert.True(container.Contains(3));
  1441. Assert.True(container.Contains(4));
  1442. Assert.True(container.Contains(5));
  1443. container.Dispose();
  1444. }
  1445. [Test]
  1446. public void UnsafeHashSet_FixedList128Bytes_EIU_UnionWith_Empty()
  1447. {
  1448. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1449. var other = new FixedList128Bytes<int>() { };
  1450. container.UnionWith(other);
  1451. ExpectedCount(ref container, 0);
  1452. container.Dispose();
  1453. }
  1454. [Test]
  1455. public void UnsafeHashSet_FixedList128Bytes_EIU_UnionWith()
  1456. {
  1457. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1458. var other = new FixedList128Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1459. container.UnionWith(other);
  1460. ExpectedCount(ref container, 9);
  1461. Assert.True(container.Contains(0));
  1462. Assert.True(container.Contains(1));
  1463. Assert.True(container.Contains(2));
  1464. Assert.True(container.Contains(3));
  1465. Assert.True(container.Contains(4));
  1466. Assert.True(container.Contains(5));
  1467. Assert.True(container.Contains(6));
  1468. Assert.True(container.Contains(7));
  1469. Assert.True(container.Contains(8));
  1470. container.Dispose();
  1471. }
  1472. [Test]
  1473. public void UnsafeHashSet_FixedList512Bytes_EIU_ExceptWith_Empty()
  1474. {
  1475. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1476. var other = new FixedList512Bytes<int>() { };
  1477. container.ExceptWith(other);
  1478. ExpectedCount(ref container, 0);
  1479. container.Dispose();
  1480. }
  1481. [Test]
  1482. public void UnsafeHashSet_FixedList512Bytes_EIU_ExceptWith_AxB()
  1483. {
  1484. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1485. var other = new FixedList512Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1486. container.ExceptWith(other);
  1487. ExpectedCount(ref container, 3);
  1488. Assert.True(container.Contains(0));
  1489. Assert.True(container.Contains(1));
  1490. Assert.True(container.Contains(2));
  1491. container.Dispose();
  1492. }
  1493. [Test]
  1494. public void UnsafeHashSet_FixedList512Bytes_EIU_IntersectWith_Empty()
  1495. {
  1496. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1497. var other = new FixedList512Bytes<int>() { };
  1498. container.IntersectWith(other);
  1499. ExpectedCount(ref container, 0);
  1500. container.Dispose();
  1501. }
  1502. [Test]
  1503. public void UnsafeHashSet_FixedList512Bytes_EIU_IntersectWith()
  1504. {
  1505. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1506. var other = new FixedList512Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1507. container.IntersectWith(other);
  1508. ExpectedCount(ref container, 3);
  1509. Assert.True(container.Contains(3));
  1510. Assert.True(container.Contains(4));
  1511. Assert.True(container.Contains(5));
  1512. container.Dispose();
  1513. }
  1514. [Test]
  1515. public void UnsafeHashSet_FixedList512Bytes_EIU_UnionWith_Empty()
  1516. {
  1517. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1518. var other = new FixedList512Bytes<int>() { };
  1519. container.UnionWith(other);
  1520. ExpectedCount(ref container, 0);
  1521. container.Dispose();
  1522. }
  1523. [Test]
  1524. public void UnsafeHashSet_FixedList512Bytes_EIU_UnionWith()
  1525. {
  1526. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1527. var other = new FixedList512Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1528. container.UnionWith(other);
  1529. ExpectedCount(ref container, 9);
  1530. Assert.True(container.Contains(0));
  1531. Assert.True(container.Contains(1));
  1532. Assert.True(container.Contains(2));
  1533. Assert.True(container.Contains(3));
  1534. Assert.True(container.Contains(4));
  1535. Assert.True(container.Contains(5));
  1536. Assert.True(container.Contains(6));
  1537. Assert.True(container.Contains(7));
  1538. Assert.True(container.Contains(8));
  1539. container.Dispose();
  1540. }
  1541. [Test]
  1542. public void UnsafeHashSet_FixedList4096Bytes_EIU_ExceptWith_Empty()
  1543. {
  1544. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1545. var other = new FixedList4096Bytes<int>() { };
  1546. container.ExceptWith(other);
  1547. ExpectedCount(ref container, 0);
  1548. container.Dispose();
  1549. }
  1550. [Test]
  1551. public void UnsafeHashSet_FixedList4096Bytes_EIU_ExceptWith_AxB()
  1552. {
  1553. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1554. var other = new FixedList4096Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1555. container.ExceptWith(other);
  1556. ExpectedCount(ref container, 3);
  1557. Assert.True(container.Contains(0));
  1558. Assert.True(container.Contains(1));
  1559. Assert.True(container.Contains(2));
  1560. container.Dispose();
  1561. }
  1562. [Test]
  1563. public void UnsafeHashSet_FixedList4096Bytes_EIU_IntersectWith_Empty()
  1564. {
  1565. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1566. var other = new FixedList4096Bytes<int>() { };
  1567. container.IntersectWith(other);
  1568. ExpectedCount(ref container, 0);
  1569. container.Dispose();
  1570. }
  1571. [Test]
  1572. public void UnsafeHashSet_FixedList4096Bytes_EIU_IntersectWith()
  1573. {
  1574. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1575. var other = new FixedList4096Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1576. container.IntersectWith(other);
  1577. ExpectedCount(ref container, 3);
  1578. Assert.True(container.Contains(3));
  1579. Assert.True(container.Contains(4));
  1580. Assert.True(container.Contains(5));
  1581. container.Dispose();
  1582. }
  1583. [Test]
  1584. public void UnsafeHashSet_FixedList4096Bytes_EIU_UnionWith_Empty()
  1585. {
  1586. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1587. var other = new FixedList4096Bytes<int>() { };
  1588. container.UnionWith(other);
  1589. ExpectedCount(ref container, 0);
  1590. container.Dispose();
  1591. }
  1592. [Test]
  1593. public void UnsafeHashSet_FixedList4096Bytes_EIU_UnionWith()
  1594. {
  1595. var container = new UnsafeHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1596. var other = new FixedList4096Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1597. container.UnionWith(other);
  1598. ExpectedCount(ref container, 9);
  1599. Assert.True(container.Contains(0));
  1600. Assert.True(container.Contains(1));
  1601. Assert.True(container.Contains(2));
  1602. Assert.True(container.Contains(3));
  1603. Assert.True(container.Contains(4));
  1604. Assert.True(container.Contains(5));
  1605. Assert.True(container.Contains(6));
  1606. Assert.True(container.Contains(7));
  1607. Assert.True(container.Contains(8));
  1608. container.Dispose();
  1609. }
  1610. }