* Added version increment for TrimExcess and EnsureCapacity
* Added old unit test to exclusion list
* Excluded missing unit tests
Commit migrated from https://github.com/dotnet/coreclr/commit/
5d31194880e800a9df8eef76e7a0a53646aa72d3
{
"name": "System.Collections.Tests.Dictionary_IDictionary_NonGeneric_Tests.IEnumerable_NonGeneric_Enumerator_MoveNext_ModifiedAfterEnumeration_ThrowsInvalidOperationException",
"reason": "Assert.All() Failure: 1 out of 4 items in the collection did not pass.\r\n"
+ },
+ {
+ "name": "System.Collections.Tests.Dictionary_Generic_Tests_SimpleInt_int_With_Comparer_WrapStructural_SimpleInt.EnsureCapacity_Generic_RequestingLargerCapacity_DoesNotInvalidateEnumeration",
+ "reason": "outdated"
+ },
+ {
+ "name": "System.Collections.Tests.Dictionary_Generic_Tests_string_string.EnsureCapacity_Generic_RequestingLargerCapacity_DoesNotInvalidateEnumeration",
+ "reason": "outdated"
+ },
+ {
+ "name": "System.Collections.Tests.Dictionary_Generic_Tests_int_int.EnsureCapacity_Generic_RequestingLargerCapacity_DoesNotInvalidateEnumeration",
+ "reason": "outdated"
}
]
}
int currentCapacity = _entries == null ? 0 : _entries.Length;
if (currentCapacity >= capacity)
return currentCapacity;
+ _version++;
if (_buckets == null)
return Initialize(capacity);
int newSize = HashHelpers.GetPrime(capacity);
return;
int oldCount = _count;
+ _version++;
Initialize(newSize);
Entry[] entries = _entries;
int[] buckets = _buckets;