暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

NativeParallelHashSetTests.gen.cs 54KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637
  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 NativeParallelHashSetTestsGenerated : CollectionsTestFixture
  7. {
  8. static void ExpectedCount<T>(ref NativeParallelHashSet<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 NativeParallelHashSet_NativeParallelHashSet_EIU_ExceptWith_Empty()
  16. {
  17. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  18. var other = new NativeParallelHashSet<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 NativeParallelHashSet_NativeParallelHashSet_EIU_ExceptWith_AxB()
  26. {
  27. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  28. var other = new NativeParallelHashSet<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 NativeParallelHashSet_NativeParallelHashSet_EIU_IntersectWith_Empty()
  39. {
  40. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  41. var other = new NativeParallelHashSet<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 NativeParallelHashSet_NativeParallelHashSet_EIU_IntersectWith()
  49. {
  50. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  51. var other = new NativeParallelHashSet<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 NativeParallelHashSet_NativeParallelHashSet_EIU_UnionWith_Empty()
  62. {
  63. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  64. var other = new NativeParallelHashSet<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 NativeParallelHashSet_NativeParallelHashSet_EIU_UnionWith()
  72. {
  73. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  74. var other = new NativeParallelHashSet<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 NativeParallelHashSet_UnsafeParallelHashSet_EIU_ExceptWith_Empty()
  91. {
  92. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  93. var other = new UnsafeParallelHashSet<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 NativeParallelHashSet_UnsafeParallelHashSet_EIU_ExceptWith_AxB()
  101. {
  102. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  103. var other = new UnsafeParallelHashSet<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 NativeParallelHashSet_UnsafeParallelHashSet_EIU_IntersectWith_Empty()
  114. {
  115. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  116. var other = new UnsafeParallelHashSet<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 NativeParallelHashSet_UnsafeParallelHashSet_EIU_IntersectWith()
  124. {
  125. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  126. var other = new UnsafeParallelHashSet<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 NativeParallelHashSet_UnsafeParallelHashSet_EIU_UnionWith_Empty()
  137. {
  138. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  139. var other = new UnsafeParallelHashSet<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 NativeParallelHashSet_UnsafeParallelHashSet_EIU_UnionWith()
  147. {
  148. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  149. var other = new UnsafeParallelHashSet<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 NativeParallelHashSet_NativeList_EIU_ExceptWith_Empty()
  166. {
  167. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  168. var other = new NativeList<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 NativeParallelHashSet_NativeList_EIU_ExceptWith_AxB()
  176. {
  177. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  178. var other = new NativeList<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 NativeParallelHashSet_NativeList_EIU_IntersectWith_Empty()
  189. {
  190. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  191. var other = new NativeList<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 NativeParallelHashSet_NativeList_EIU_IntersectWith()
  199. {
  200. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  201. var other = new NativeList<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 NativeParallelHashSet_NativeList_EIU_UnionWith_Empty()
  212. {
  213. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  214. var other = new NativeList<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 NativeParallelHashSet_NativeList_EIU_UnionWith()
  222. {
  223. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  224. var other = new NativeList<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 NativeParallelHashSet_UnsafeList_EIU_ExceptWith_Empty()
  241. {
  242. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  243. var other = new UnsafeList<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 NativeParallelHashSet_UnsafeList_EIU_ExceptWith_AxB()
  251. {
  252. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  253. var other = new UnsafeList<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 NativeParallelHashSet_UnsafeList_EIU_IntersectWith_Empty()
  264. {
  265. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  266. var other = new UnsafeList<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 NativeParallelHashSet_UnsafeList_EIU_IntersectWith()
  274. {
  275. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  276. var other = new UnsafeList<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 NativeParallelHashSet_UnsafeList_EIU_UnionWith_Empty()
  287. {
  288. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  289. var other = new UnsafeList<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 NativeParallelHashSet_UnsafeList_EIU_UnionWith()
  297. {
  298. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  299. var other = new UnsafeList<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 NativeParallelHashSet_FixedList32Bytes_EIU_ExceptWith_Empty()
  316. {
  317. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  318. var other = new FixedList32Bytes<int>() { };
  319. container.ExceptWith(other);
  320. ExpectedCount(ref container, 0);
  321. container.Dispose();
  322. }
  323. [Test]
  324. public void NativeParallelHashSet_FixedList32Bytes_EIU_ExceptWith_AxB()
  325. {
  326. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  327. var other = new FixedList32Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  328. container.ExceptWith(other);
  329. ExpectedCount(ref container, 3);
  330. Assert.True(container.Contains(0));
  331. Assert.True(container.Contains(1));
  332. Assert.True(container.Contains(2));
  333. container.Dispose();
  334. }
  335. [Test]
  336. public void NativeParallelHashSet_FixedList32Bytes_EIU_IntersectWith_Empty()
  337. {
  338. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  339. var other = new FixedList32Bytes<int>() { };
  340. container.IntersectWith(other);
  341. ExpectedCount(ref container, 0);
  342. container.Dispose();
  343. }
  344. [Test]
  345. public void NativeParallelHashSet_FixedList32Bytes_EIU_IntersectWith()
  346. {
  347. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  348. var other = new FixedList32Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  349. container.IntersectWith(other);
  350. ExpectedCount(ref container, 3);
  351. Assert.True(container.Contains(3));
  352. Assert.True(container.Contains(4));
  353. Assert.True(container.Contains(5));
  354. container.Dispose();
  355. }
  356. [Test]
  357. public void NativeParallelHashSet_FixedList32Bytes_EIU_UnionWith_Empty()
  358. {
  359. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  360. var other = new FixedList32Bytes<int>() { };
  361. container.UnionWith(other);
  362. ExpectedCount(ref container, 0);
  363. container.Dispose();
  364. }
  365. [Test]
  366. public void NativeParallelHashSet_FixedList32Bytes_EIU_UnionWith()
  367. {
  368. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  369. var other = new FixedList32Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  370. container.UnionWith(other);
  371. ExpectedCount(ref container, 9);
  372. Assert.True(container.Contains(0));
  373. Assert.True(container.Contains(1));
  374. Assert.True(container.Contains(2));
  375. Assert.True(container.Contains(3));
  376. Assert.True(container.Contains(4));
  377. Assert.True(container.Contains(5));
  378. Assert.True(container.Contains(6));
  379. Assert.True(container.Contains(7));
  380. Assert.True(container.Contains(8));
  381. container.Dispose();
  382. }
  383. [Test]
  384. public void NativeParallelHashSet_FixedList64Bytes_EIU_ExceptWith_Empty()
  385. {
  386. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  387. var other = new FixedList64Bytes<int>() { };
  388. container.ExceptWith(other);
  389. ExpectedCount(ref container, 0);
  390. container.Dispose();
  391. }
  392. [Test]
  393. public void NativeParallelHashSet_FixedList64Bytes_EIU_ExceptWith_AxB()
  394. {
  395. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  396. var other = new FixedList64Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  397. container.ExceptWith(other);
  398. ExpectedCount(ref container, 3);
  399. Assert.True(container.Contains(0));
  400. Assert.True(container.Contains(1));
  401. Assert.True(container.Contains(2));
  402. container.Dispose();
  403. }
  404. [Test]
  405. public void NativeParallelHashSet_FixedList64Bytes_EIU_IntersectWith_Empty()
  406. {
  407. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  408. var other = new FixedList64Bytes<int>() { };
  409. container.IntersectWith(other);
  410. ExpectedCount(ref container, 0);
  411. container.Dispose();
  412. }
  413. [Test]
  414. public void NativeParallelHashSet_FixedList64Bytes_EIU_IntersectWith()
  415. {
  416. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  417. var other = new FixedList64Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  418. container.IntersectWith(other);
  419. ExpectedCount(ref container, 3);
  420. Assert.True(container.Contains(3));
  421. Assert.True(container.Contains(4));
  422. Assert.True(container.Contains(5));
  423. container.Dispose();
  424. }
  425. [Test]
  426. public void NativeParallelHashSet_FixedList64Bytes_EIU_UnionWith_Empty()
  427. {
  428. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  429. var other = new FixedList64Bytes<int>() { };
  430. container.UnionWith(other);
  431. ExpectedCount(ref container, 0);
  432. container.Dispose();
  433. }
  434. [Test]
  435. public void NativeParallelHashSet_FixedList64Bytes_EIU_UnionWith()
  436. {
  437. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  438. var other = new FixedList64Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  439. container.UnionWith(other);
  440. ExpectedCount(ref container, 9);
  441. Assert.True(container.Contains(0));
  442. Assert.True(container.Contains(1));
  443. Assert.True(container.Contains(2));
  444. Assert.True(container.Contains(3));
  445. Assert.True(container.Contains(4));
  446. Assert.True(container.Contains(5));
  447. Assert.True(container.Contains(6));
  448. Assert.True(container.Contains(7));
  449. Assert.True(container.Contains(8));
  450. container.Dispose();
  451. }
  452. [Test]
  453. public void NativeParallelHashSet_FixedList128Bytes_EIU_ExceptWith_Empty()
  454. {
  455. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  456. var other = new FixedList128Bytes<int>() { };
  457. container.ExceptWith(other);
  458. ExpectedCount(ref container, 0);
  459. container.Dispose();
  460. }
  461. [Test]
  462. public void NativeParallelHashSet_FixedList128Bytes_EIU_ExceptWith_AxB()
  463. {
  464. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  465. var other = new FixedList128Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  466. container.ExceptWith(other);
  467. ExpectedCount(ref container, 3);
  468. Assert.True(container.Contains(0));
  469. Assert.True(container.Contains(1));
  470. Assert.True(container.Contains(2));
  471. container.Dispose();
  472. }
  473. [Test]
  474. public void NativeParallelHashSet_FixedList128Bytes_EIU_IntersectWith_Empty()
  475. {
  476. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  477. var other = new FixedList128Bytes<int>() { };
  478. container.IntersectWith(other);
  479. ExpectedCount(ref container, 0);
  480. container.Dispose();
  481. }
  482. [Test]
  483. public void NativeParallelHashSet_FixedList128Bytes_EIU_IntersectWith()
  484. {
  485. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  486. var other = new FixedList128Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  487. container.IntersectWith(other);
  488. ExpectedCount(ref container, 3);
  489. Assert.True(container.Contains(3));
  490. Assert.True(container.Contains(4));
  491. Assert.True(container.Contains(5));
  492. container.Dispose();
  493. }
  494. [Test]
  495. public void NativeParallelHashSet_FixedList128Bytes_EIU_UnionWith_Empty()
  496. {
  497. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  498. var other = new FixedList128Bytes<int>() { };
  499. container.UnionWith(other);
  500. ExpectedCount(ref container, 0);
  501. container.Dispose();
  502. }
  503. [Test]
  504. public void NativeParallelHashSet_FixedList128Bytes_EIU_UnionWith()
  505. {
  506. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  507. var other = new FixedList128Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  508. container.UnionWith(other);
  509. ExpectedCount(ref container, 9);
  510. Assert.True(container.Contains(0));
  511. Assert.True(container.Contains(1));
  512. Assert.True(container.Contains(2));
  513. Assert.True(container.Contains(3));
  514. Assert.True(container.Contains(4));
  515. Assert.True(container.Contains(5));
  516. Assert.True(container.Contains(6));
  517. Assert.True(container.Contains(7));
  518. Assert.True(container.Contains(8));
  519. container.Dispose();
  520. }
  521. [Test]
  522. public void NativeParallelHashSet_FixedList512Bytes_EIU_ExceptWith_Empty()
  523. {
  524. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  525. var other = new FixedList512Bytes<int>() { };
  526. container.ExceptWith(other);
  527. ExpectedCount(ref container, 0);
  528. container.Dispose();
  529. }
  530. [Test]
  531. public void NativeParallelHashSet_FixedList512Bytes_EIU_ExceptWith_AxB()
  532. {
  533. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  534. var other = new FixedList512Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  535. container.ExceptWith(other);
  536. ExpectedCount(ref container, 3);
  537. Assert.True(container.Contains(0));
  538. Assert.True(container.Contains(1));
  539. Assert.True(container.Contains(2));
  540. container.Dispose();
  541. }
  542. [Test]
  543. public void NativeParallelHashSet_FixedList512Bytes_EIU_IntersectWith_Empty()
  544. {
  545. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  546. var other = new FixedList512Bytes<int>() { };
  547. container.IntersectWith(other);
  548. ExpectedCount(ref container, 0);
  549. container.Dispose();
  550. }
  551. [Test]
  552. public void NativeParallelHashSet_FixedList512Bytes_EIU_IntersectWith()
  553. {
  554. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  555. var other = new FixedList512Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  556. container.IntersectWith(other);
  557. ExpectedCount(ref container, 3);
  558. Assert.True(container.Contains(3));
  559. Assert.True(container.Contains(4));
  560. Assert.True(container.Contains(5));
  561. container.Dispose();
  562. }
  563. [Test]
  564. public void NativeParallelHashSet_FixedList512Bytes_EIU_UnionWith_Empty()
  565. {
  566. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  567. var other = new FixedList512Bytes<int>() { };
  568. container.UnionWith(other);
  569. ExpectedCount(ref container, 0);
  570. container.Dispose();
  571. }
  572. [Test]
  573. public void NativeParallelHashSet_FixedList512Bytes_EIU_UnionWith()
  574. {
  575. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  576. var other = new FixedList512Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  577. container.UnionWith(other);
  578. ExpectedCount(ref container, 9);
  579. Assert.True(container.Contains(0));
  580. Assert.True(container.Contains(1));
  581. Assert.True(container.Contains(2));
  582. Assert.True(container.Contains(3));
  583. Assert.True(container.Contains(4));
  584. Assert.True(container.Contains(5));
  585. Assert.True(container.Contains(6));
  586. Assert.True(container.Contains(7));
  587. Assert.True(container.Contains(8));
  588. container.Dispose();
  589. }
  590. [Test]
  591. public void NativeParallelHashSet_FixedList4096Bytes_EIU_ExceptWith_Empty()
  592. {
  593. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  594. var other = new FixedList4096Bytes<int>() { };
  595. container.ExceptWith(other);
  596. ExpectedCount(ref container, 0);
  597. container.Dispose();
  598. }
  599. [Test]
  600. public void NativeParallelHashSet_FixedList4096Bytes_EIU_ExceptWith_AxB()
  601. {
  602. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  603. var other = new FixedList4096Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  604. container.ExceptWith(other);
  605. ExpectedCount(ref container, 3);
  606. Assert.True(container.Contains(0));
  607. Assert.True(container.Contains(1));
  608. Assert.True(container.Contains(2));
  609. container.Dispose();
  610. }
  611. [Test]
  612. public void NativeParallelHashSet_FixedList4096Bytes_EIU_IntersectWith_Empty()
  613. {
  614. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  615. var other = new FixedList4096Bytes<int>() { };
  616. container.IntersectWith(other);
  617. ExpectedCount(ref container, 0);
  618. container.Dispose();
  619. }
  620. [Test]
  621. public void NativeParallelHashSet_FixedList4096Bytes_EIU_IntersectWith()
  622. {
  623. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  624. var other = new FixedList4096Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  625. container.IntersectWith(other);
  626. ExpectedCount(ref container, 3);
  627. Assert.True(container.Contains(3));
  628. Assert.True(container.Contains(4));
  629. Assert.True(container.Contains(5));
  630. container.Dispose();
  631. }
  632. [Test]
  633. public void NativeParallelHashSet_FixedList4096Bytes_EIU_UnionWith_Empty()
  634. {
  635. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  636. var other = new FixedList4096Bytes<int>() { };
  637. container.UnionWith(other);
  638. ExpectedCount(ref container, 0);
  639. container.Dispose();
  640. }
  641. [Test]
  642. public void NativeParallelHashSet_FixedList4096Bytes_EIU_UnionWith()
  643. {
  644. var container = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  645. var other = new FixedList4096Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  646. container.UnionWith(other);
  647. ExpectedCount(ref container, 9);
  648. Assert.True(container.Contains(0));
  649. Assert.True(container.Contains(1));
  650. Assert.True(container.Contains(2));
  651. Assert.True(container.Contains(3));
  652. Assert.True(container.Contains(4));
  653. Assert.True(container.Contains(5));
  654. Assert.True(container.Contains(6));
  655. Assert.True(container.Contains(7));
  656. Assert.True(container.Contains(8));
  657. container.Dispose();
  658. }
  659. static void ExpectedCount<T>(ref UnsafeParallelHashSet<T> container, int expected)
  660. where T : unmanaged, IEquatable<T>
  661. {
  662. Assert.AreEqual(expected == 0, container.IsEmpty);
  663. Assert.AreEqual(expected, container.Count());
  664. }
  665. [Test]
  666. public void UnsafeParallelHashSet_NativeParallelHashSet_EIU_ExceptWith_Empty()
  667. {
  668. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  669. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  670. container.ExceptWith(other);
  671. ExpectedCount(ref container, 0);
  672. container.Dispose();
  673. other.Dispose();
  674. }
  675. [Test]
  676. public void UnsafeParallelHashSet_NativeParallelHashSet_EIU_ExceptWith_AxB()
  677. {
  678. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  679. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  680. container.ExceptWith(other);
  681. ExpectedCount(ref container, 3);
  682. Assert.True(container.Contains(0));
  683. Assert.True(container.Contains(1));
  684. Assert.True(container.Contains(2));
  685. container.Dispose();
  686. other.Dispose();
  687. }
  688. [Test]
  689. public void UnsafeParallelHashSet_NativeParallelHashSet_EIU_IntersectWith_Empty()
  690. {
  691. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  692. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  693. container.IntersectWith(other);
  694. ExpectedCount(ref container, 0);
  695. container.Dispose();
  696. other.Dispose();
  697. }
  698. [Test]
  699. public void UnsafeParallelHashSet_NativeParallelHashSet_EIU_IntersectWith()
  700. {
  701. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  702. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  703. container.IntersectWith(other);
  704. ExpectedCount(ref container, 3);
  705. Assert.True(container.Contains(3));
  706. Assert.True(container.Contains(4));
  707. Assert.True(container.Contains(5));
  708. container.Dispose();
  709. other.Dispose();
  710. }
  711. [Test]
  712. public void UnsafeParallelHashSet_NativeParallelHashSet_EIU_UnionWith_Empty()
  713. {
  714. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  715. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  716. container.UnionWith(other);
  717. ExpectedCount(ref container, 0);
  718. container.Dispose();
  719. other.Dispose();
  720. }
  721. [Test]
  722. public void UnsafeParallelHashSet_NativeParallelHashSet_EIU_UnionWith()
  723. {
  724. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  725. var other = new NativeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  726. container.UnionWith(other);
  727. ExpectedCount(ref container, 9);
  728. Assert.True(container.Contains(0));
  729. Assert.True(container.Contains(1));
  730. Assert.True(container.Contains(2));
  731. Assert.True(container.Contains(3));
  732. Assert.True(container.Contains(4));
  733. Assert.True(container.Contains(5));
  734. Assert.True(container.Contains(6));
  735. Assert.True(container.Contains(7));
  736. Assert.True(container.Contains(8));
  737. container.Dispose();
  738. other.Dispose();
  739. }
  740. [Test]
  741. public void UnsafeParallelHashSet_UnsafeParallelHashSet_EIU_ExceptWith_Empty()
  742. {
  743. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  744. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  745. container.ExceptWith(other);
  746. ExpectedCount(ref container, 0);
  747. container.Dispose();
  748. other.Dispose();
  749. }
  750. [Test]
  751. public void UnsafeParallelHashSet_UnsafeParallelHashSet_EIU_ExceptWith_AxB()
  752. {
  753. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  754. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  755. container.ExceptWith(other);
  756. ExpectedCount(ref container, 3);
  757. Assert.True(container.Contains(0));
  758. Assert.True(container.Contains(1));
  759. Assert.True(container.Contains(2));
  760. container.Dispose();
  761. other.Dispose();
  762. }
  763. [Test]
  764. public void UnsafeParallelHashSet_UnsafeParallelHashSet_EIU_IntersectWith_Empty()
  765. {
  766. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  767. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  768. container.IntersectWith(other);
  769. ExpectedCount(ref container, 0);
  770. container.Dispose();
  771. other.Dispose();
  772. }
  773. [Test]
  774. public void UnsafeParallelHashSet_UnsafeParallelHashSet_EIU_IntersectWith()
  775. {
  776. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  777. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  778. container.IntersectWith(other);
  779. ExpectedCount(ref container, 3);
  780. Assert.True(container.Contains(3));
  781. Assert.True(container.Contains(4));
  782. Assert.True(container.Contains(5));
  783. container.Dispose();
  784. other.Dispose();
  785. }
  786. [Test]
  787. public void UnsafeParallelHashSet_UnsafeParallelHashSet_EIU_UnionWith_Empty()
  788. {
  789. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  790. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  791. container.UnionWith(other);
  792. ExpectedCount(ref container, 0);
  793. container.Dispose();
  794. other.Dispose();
  795. }
  796. [Test]
  797. public void UnsafeParallelHashSet_UnsafeParallelHashSet_EIU_UnionWith()
  798. {
  799. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  800. var other = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 3, 4, 5, 6, 7, 8 };
  801. container.UnionWith(other);
  802. ExpectedCount(ref container, 9);
  803. Assert.True(container.Contains(0));
  804. Assert.True(container.Contains(1));
  805. Assert.True(container.Contains(2));
  806. Assert.True(container.Contains(3));
  807. Assert.True(container.Contains(4));
  808. Assert.True(container.Contains(5));
  809. Assert.True(container.Contains(6));
  810. Assert.True(container.Contains(7));
  811. Assert.True(container.Contains(8));
  812. container.Dispose();
  813. other.Dispose();
  814. }
  815. [Test]
  816. public void UnsafeParallelHashSet_NativeList_EIU_ExceptWith_Empty()
  817. {
  818. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  819. var other = new NativeList<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 UnsafeParallelHashSet_NativeList_EIU_ExceptWith_AxB()
  827. {
  828. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  829. var other = new NativeList<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 UnsafeParallelHashSet_NativeList_EIU_IntersectWith_Empty()
  840. {
  841. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  842. var other = new NativeList<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 UnsafeParallelHashSet_NativeList_EIU_IntersectWith()
  850. {
  851. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  852. var other = new NativeList<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 UnsafeParallelHashSet_NativeList_EIU_UnionWith_Empty()
  863. {
  864. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  865. var other = new NativeList<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 UnsafeParallelHashSet_NativeList_EIU_UnionWith()
  873. {
  874. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  875. var other = new NativeList<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 UnsafeParallelHashSet_UnsafeList_EIU_ExceptWith_Empty()
  892. {
  893. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  894. var other = new UnsafeList<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 UnsafeParallelHashSet_UnsafeList_EIU_ExceptWith_AxB()
  902. {
  903. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  904. var other = new UnsafeList<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 UnsafeParallelHashSet_UnsafeList_EIU_IntersectWith_Empty()
  915. {
  916. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  917. var other = new UnsafeList<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 UnsafeParallelHashSet_UnsafeList_EIU_IntersectWith()
  925. {
  926. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  927. var other = new UnsafeList<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 UnsafeParallelHashSet_UnsafeList_EIU_UnionWith_Empty()
  938. {
  939. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  940. var other = new UnsafeList<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 UnsafeParallelHashSet_UnsafeList_EIU_UnionWith()
  948. {
  949. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  950. var other = new UnsafeList<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 UnsafeParallelHashSet_FixedList32Bytes_EIU_ExceptWith_Empty()
  967. {
  968. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  969. var other = new FixedList32Bytes<int>() { };
  970. container.ExceptWith(other);
  971. ExpectedCount(ref container, 0);
  972. container.Dispose();
  973. }
  974. [Test]
  975. public void UnsafeParallelHashSet_FixedList32Bytes_EIU_ExceptWith_AxB()
  976. {
  977. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  978. var other = new FixedList32Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  979. container.ExceptWith(other);
  980. ExpectedCount(ref container, 3);
  981. Assert.True(container.Contains(0));
  982. Assert.True(container.Contains(1));
  983. Assert.True(container.Contains(2));
  984. container.Dispose();
  985. }
  986. [Test]
  987. public void UnsafeParallelHashSet_FixedList32Bytes_EIU_IntersectWith_Empty()
  988. {
  989. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  990. var other = new FixedList32Bytes<int>() { };
  991. container.IntersectWith(other);
  992. ExpectedCount(ref container, 0);
  993. container.Dispose();
  994. }
  995. [Test]
  996. public void UnsafeParallelHashSet_FixedList32Bytes_EIU_IntersectWith()
  997. {
  998. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  999. var other = new FixedList32Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1000. container.IntersectWith(other);
  1001. ExpectedCount(ref container, 3);
  1002. Assert.True(container.Contains(3));
  1003. Assert.True(container.Contains(4));
  1004. Assert.True(container.Contains(5));
  1005. container.Dispose();
  1006. }
  1007. [Test]
  1008. public void UnsafeParallelHashSet_FixedList32Bytes_EIU_UnionWith_Empty()
  1009. {
  1010. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1011. var other = new FixedList32Bytes<int>() { };
  1012. container.UnionWith(other);
  1013. ExpectedCount(ref container, 0);
  1014. container.Dispose();
  1015. }
  1016. [Test]
  1017. public void UnsafeParallelHashSet_FixedList32Bytes_EIU_UnionWith()
  1018. {
  1019. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1020. var other = new FixedList32Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1021. container.UnionWith(other);
  1022. ExpectedCount(ref container, 9);
  1023. Assert.True(container.Contains(0));
  1024. Assert.True(container.Contains(1));
  1025. Assert.True(container.Contains(2));
  1026. Assert.True(container.Contains(3));
  1027. Assert.True(container.Contains(4));
  1028. Assert.True(container.Contains(5));
  1029. Assert.True(container.Contains(6));
  1030. Assert.True(container.Contains(7));
  1031. Assert.True(container.Contains(8));
  1032. container.Dispose();
  1033. }
  1034. [Test]
  1035. public void UnsafeParallelHashSet_FixedList64Bytes_EIU_ExceptWith_Empty()
  1036. {
  1037. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1038. var other = new FixedList64Bytes<int>() { };
  1039. container.ExceptWith(other);
  1040. ExpectedCount(ref container, 0);
  1041. container.Dispose();
  1042. }
  1043. [Test]
  1044. public void UnsafeParallelHashSet_FixedList64Bytes_EIU_ExceptWith_AxB()
  1045. {
  1046. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1047. var other = new FixedList64Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1048. container.ExceptWith(other);
  1049. ExpectedCount(ref container, 3);
  1050. Assert.True(container.Contains(0));
  1051. Assert.True(container.Contains(1));
  1052. Assert.True(container.Contains(2));
  1053. container.Dispose();
  1054. }
  1055. [Test]
  1056. public void UnsafeParallelHashSet_FixedList64Bytes_EIU_IntersectWith_Empty()
  1057. {
  1058. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1059. var other = new FixedList64Bytes<int>() { };
  1060. container.IntersectWith(other);
  1061. ExpectedCount(ref container, 0);
  1062. container.Dispose();
  1063. }
  1064. [Test]
  1065. public void UnsafeParallelHashSet_FixedList64Bytes_EIU_IntersectWith()
  1066. {
  1067. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1068. var other = new FixedList64Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1069. container.IntersectWith(other);
  1070. ExpectedCount(ref container, 3);
  1071. Assert.True(container.Contains(3));
  1072. Assert.True(container.Contains(4));
  1073. Assert.True(container.Contains(5));
  1074. container.Dispose();
  1075. }
  1076. [Test]
  1077. public void UnsafeParallelHashSet_FixedList64Bytes_EIU_UnionWith_Empty()
  1078. {
  1079. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1080. var other = new FixedList64Bytes<int>() { };
  1081. container.UnionWith(other);
  1082. ExpectedCount(ref container, 0);
  1083. container.Dispose();
  1084. }
  1085. [Test]
  1086. public void UnsafeParallelHashSet_FixedList64Bytes_EIU_UnionWith()
  1087. {
  1088. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1089. var other = new FixedList64Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1090. container.UnionWith(other);
  1091. ExpectedCount(ref container, 9);
  1092. Assert.True(container.Contains(0));
  1093. Assert.True(container.Contains(1));
  1094. Assert.True(container.Contains(2));
  1095. Assert.True(container.Contains(3));
  1096. Assert.True(container.Contains(4));
  1097. Assert.True(container.Contains(5));
  1098. Assert.True(container.Contains(6));
  1099. Assert.True(container.Contains(7));
  1100. Assert.True(container.Contains(8));
  1101. container.Dispose();
  1102. }
  1103. [Test]
  1104. public void UnsafeParallelHashSet_FixedList128Bytes_EIU_ExceptWith_Empty()
  1105. {
  1106. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1107. var other = new FixedList128Bytes<int>() { };
  1108. container.ExceptWith(other);
  1109. ExpectedCount(ref container, 0);
  1110. container.Dispose();
  1111. }
  1112. [Test]
  1113. public void UnsafeParallelHashSet_FixedList128Bytes_EIU_ExceptWith_AxB()
  1114. {
  1115. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1116. var other = new FixedList128Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1117. container.ExceptWith(other);
  1118. ExpectedCount(ref container, 3);
  1119. Assert.True(container.Contains(0));
  1120. Assert.True(container.Contains(1));
  1121. Assert.True(container.Contains(2));
  1122. container.Dispose();
  1123. }
  1124. [Test]
  1125. public void UnsafeParallelHashSet_FixedList128Bytes_EIU_IntersectWith_Empty()
  1126. {
  1127. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1128. var other = new FixedList128Bytes<int>() { };
  1129. container.IntersectWith(other);
  1130. ExpectedCount(ref container, 0);
  1131. container.Dispose();
  1132. }
  1133. [Test]
  1134. public void UnsafeParallelHashSet_FixedList128Bytes_EIU_IntersectWith()
  1135. {
  1136. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1137. var other = new FixedList128Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1138. container.IntersectWith(other);
  1139. ExpectedCount(ref container, 3);
  1140. Assert.True(container.Contains(3));
  1141. Assert.True(container.Contains(4));
  1142. Assert.True(container.Contains(5));
  1143. container.Dispose();
  1144. }
  1145. [Test]
  1146. public void UnsafeParallelHashSet_FixedList128Bytes_EIU_UnionWith_Empty()
  1147. {
  1148. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1149. var other = new FixedList128Bytes<int>() { };
  1150. container.UnionWith(other);
  1151. ExpectedCount(ref container, 0);
  1152. container.Dispose();
  1153. }
  1154. [Test]
  1155. public void UnsafeParallelHashSet_FixedList128Bytes_EIU_UnionWith()
  1156. {
  1157. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1158. var other = new FixedList128Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1159. container.UnionWith(other);
  1160. ExpectedCount(ref container, 9);
  1161. Assert.True(container.Contains(0));
  1162. Assert.True(container.Contains(1));
  1163. Assert.True(container.Contains(2));
  1164. Assert.True(container.Contains(3));
  1165. Assert.True(container.Contains(4));
  1166. Assert.True(container.Contains(5));
  1167. Assert.True(container.Contains(6));
  1168. Assert.True(container.Contains(7));
  1169. Assert.True(container.Contains(8));
  1170. container.Dispose();
  1171. }
  1172. [Test]
  1173. public void UnsafeParallelHashSet_FixedList512Bytes_EIU_ExceptWith_Empty()
  1174. {
  1175. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1176. var other = new FixedList512Bytes<int>() { };
  1177. container.ExceptWith(other);
  1178. ExpectedCount(ref container, 0);
  1179. container.Dispose();
  1180. }
  1181. [Test]
  1182. public void UnsafeParallelHashSet_FixedList512Bytes_EIU_ExceptWith_AxB()
  1183. {
  1184. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1185. var other = new FixedList512Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1186. container.ExceptWith(other);
  1187. ExpectedCount(ref container, 3);
  1188. Assert.True(container.Contains(0));
  1189. Assert.True(container.Contains(1));
  1190. Assert.True(container.Contains(2));
  1191. container.Dispose();
  1192. }
  1193. [Test]
  1194. public void UnsafeParallelHashSet_FixedList512Bytes_EIU_IntersectWith_Empty()
  1195. {
  1196. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1197. var other = new FixedList512Bytes<int>() { };
  1198. container.IntersectWith(other);
  1199. ExpectedCount(ref container, 0);
  1200. container.Dispose();
  1201. }
  1202. [Test]
  1203. public void UnsafeParallelHashSet_FixedList512Bytes_EIU_IntersectWith()
  1204. {
  1205. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1206. var other = new FixedList512Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1207. container.IntersectWith(other);
  1208. ExpectedCount(ref container, 3);
  1209. Assert.True(container.Contains(3));
  1210. Assert.True(container.Contains(4));
  1211. Assert.True(container.Contains(5));
  1212. container.Dispose();
  1213. }
  1214. [Test]
  1215. public void UnsafeParallelHashSet_FixedList512Bytes_EIU_UnionWith_Empty()
  1216. {
  1217. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1218. var other = new FixedList512Bytes<int>() { };
  1219. container.UnionWith(other);
  1220. ExpectedCount(ref container, 0);
  1221. container.Dispose();
  1222. }
  1223. [Test]
  1224. public void UnsafeParallelHashSet_FixedList512Bytes_EIU_UnionWith()
  1225. {
  1226. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1227. var other = new FixedList512Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1228. container.UnionWith(other);
  1229. ExpectedCount(ref container, 9);
  1230. Assert.True(container.Contains(0));
  1231. Assert.True(container.Contains(1));
  1232. Assert.True(container.Contains(2));
  1233. Assert.True(container.Contains(3));
  1234. Assert.True(container.Contains(4));
  1235. Assert.True(container.Contains(5));
  1236. Assert.True(container.Contains(6));
  1237. Assert.True(container.Contains(7));
  1238. Assert.True(container.Contains(8));
  1239. container.Dispose();
  1240. }
  1241. [Test]
  1242. public void UnsafeParallelHashSet_FixedList4096Bytes_EIU_ExceptWith_Empty()
  1243. {
  1244. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1245. var other = new FixedList4096Bytes<int>() { };
  1246. container.ExceptWith(other);
  1247. ExpectedCount(ref container, 0);
  1248. container.Dispose();
  1249. }
  1250. [Test]
  1251. public void UnsafeParallelHashSet_FixedList4096Bytes_EIU_ExceptWith_AxB()
  1252. {
  1253. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1254. var other = new FixedList4096Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1255. container.ExceptWith(other);
  1256. ExpectedCount(ref container, 3);
  1257. Assert.True(container.Contains(0));
  1258. Assert.True(container.Contains(1));
  1259. Assert.True(container.Contains(2));
  1260. container.Dispose();
  1261. }
  1262. [Test]
  1263. public void UnsafeParallelHashSet_FixedList4096Bytes_EIU_IntersectWith_Empty()
  1264. {
  1265. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1266. var other = new FixedList4096Bytes<int>() { };
  1267. container.IntersectWith(other);
  1268. ExpectedCount(ref container, 0);
  1269. container.Dispose();
  1270. }
  1271. [Test]
  1272. public void UnsafeParallelHashSet_FixedList4096Bytes_EIU_IntersectWith()
  1273. {
  1274. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1275. var other = new FixedList4096Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1276. container.IntersectWith(other);
  1277. ExpectedCount(ref container, 3);
  1278. Assert.True(container.Contains(3));
  1279. Assert.True(container.Contains(4));
  1280. Assert.True(container.Contains(5));
  1281. container.Dispose();
  1282. }
  1283. [Test]
  1284. public void UnsafeParallelHashSet_FixedList4096Bytes_EIU_UnionWith_Empty()
  1285. {
  1286. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { };
  1287. var other = new FixedList4096Bytes<int>() { };
  1288. container.UnionWith(other);
  1289. ExpectedCount(ref container, 0);
  1290. container.Dispose();
  1291. }
  1292. [Test]
  1293. public void UnsafeParallelHashSet_FixedList4096Bytes_EIU_UnionWith()
  1294. {
  1295. var container = new UnsafeParallelHashSet<int>(8, CommonRwdAllocator.Handle) { 0, 1, 2, 3, 4, 5 };
  1296. var other = new FixedList4096Bytes<int>() { 3, 4, 5, 6, 7, 8 };
  1297. container.UnionWith(other);
  1298. ExpectedCount(ref container, 9);
  1299. Assert.True(container.Contains(0));
  1300. Assert.True(container.Contains(1));
  1301. Assert.True(container.Contains(2));
  1302. Assert.True(container.Contains(3));
  1303. Assert.True(container.Contains(4));
  1304. Assert.True(container.Contains(5));
  1305. Assert.True(container.Contains(6));
  1306. Assert.True(container.Contains(7));
  1307. Assert.True(container.Contains(8));
  1308. container.Dispose();
  1309. }
  1310. }