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