@@ -1081,15 +1081,15 @@ DictionaryTestSuite.test("COW.Slow.RemoveValueForKeyDoesNotReallocate")
1081
1081
DictionaryTestSuite . test ( " COW.Fast.RemoveAllDoesNotReallocate " ) {
1082
1082
do {
1083
1083
var d = getCOWFastDictionary ( )
1084
- let originalCapacity = d. _variantBuffer . asNative . capacity
1084
+ let originalCapacity = d. capacity
1085
1085
assert ( d. count == 3 )
1086
1086
assert ( d [ 10 ] ! == 1010 )
1087
1087
1088
1088
d. removeAll ( )
1089
1089
// We cannot assert that identity changed, since the new buffer of smaller
1090
1090
// size can be allocated at the same address as the old one.
1091
1091
var identity1 = d. _rawIdentifier ( )
1092
- assert ( d. _variantBuffer . asNative . capacity < originalCapacity)
1092
+ assert ( d. capacity < originalCapacity)
1093
1093
assert ( d. count == 0 )
1094
1094
assert ( d [ 10 ] == nil )
1095
1095
@@ -1102,19 +1102,19 @@ DictionaryTestSuite.test("COW.Fast.RemoveAllDoesNotReallocate") {
1102
1102
do {
1103
1103
var d = getCOWFastDictionary ( )
1104
1104
var identity1 = d. _rawIdentifier ( )
1105
- let originalCapacity = d. _variantBuffer . asNative . capacity
1105
+ let originalCapacity = d. capacity
1106
1106
assert ( d. count == 3 )
1107
1107
assert ( d [ 10 ] ! == 1010 )
1108
1108
1109
1109
d. removeAll ( keepingCapacity: true )
1110
1110
assert ( identity1 == d. _rawIdentifier ( ) )
1111
- assert ( d. _variantBuffer . asNative . capacity == originalCapacity)
1111
+ assert ( d. capacity == originalCapacity)
1112
1112
assert ( d. count == 0 )
1113
1113
assert ( d [ 10 ] == nil )
1114
1114
1115
1115
d. removeAll ( keepingCapacity: true )
1116
1116
assert ( identity1 == d. _rawIdentifier ( ) )
1117
- assert ( d. _variantBuffer . asNative . capacity == originalCapacity)
1117
+ assert ( d. capacity == originalCapacity)
1118
1118
assert ( d. count == 0 )
1119
1119
assert ( d [ 10 ] == nil )
1120
1120
}
@@ -1143,7 +1143,7 @@ DictionaryTestSuite.test("COW.Fast.RemoveAllDoesNotReallocate") {
1143
1143
do {
1144
1144
var d1 = getCOWFastDictionary ( )
1145
1145
var identity1 = d1. _rawIdentifier ( )
1146
- let originalCapacity = d1. _variantBuffer . asNative . capacity
1146
+ let originalCapacity = d1. capacity
1147
1147
assert ( d1. count == 3 )
1148
1148
assert ( d1 [ 10 ] == 1010 )
1149
1149
@@ -1154,7 +1154,7 @@ DictionaryTestSuite.test("COW.Fast.RemoveAllDoesNotReallocate") {
1154
1154
assert ( identity2 != identity1)
1155
1155
assert ( d1. count == 3 )
1156
1156
assert ( d1 [ 10 ] ! == 1010 )
1157
- assert ( d2. _variantBuffer . asNative . capacity == originalCapacity)
1157
+ assert ( d2. capacity == originalCapacity)
1158
1158
assert ( d2. count == 0 )
1159
1159
assert ( d2 [ 10 ] == nil )
1160
1160
@@ -1167,15 +1167,15 @@ DictionaryTestSuite.test("COW.Fast.RemoveAllDoesNotReallocate") {
1167
1167
DictionaryTestSuite . test ( " COW.Slow.RemoveAllDoesNotReallocate " ) {
1168
1168
do {
1169
1169
var d = getCOWSlowDictionary ( )
1170
- let originalCapacity = d. _variantBuffer . asNative . capacity
1170
+ let originalCapacity = d. capacity
1171
1171
assert ( d. count == 3 )
1172
1172
assert ( d [ TestKeyTy ( 10 ) ] !. value == 1010 )
1173
1173
1174
1174
d. removeAll ( )
1175
1175
// We cannot assert that identity changed, since the new buffer of smaller
1176
1176
// size can be allocated at the same address as the old one.
1177
1177
var identity1 = d. _rawIdentifier ( )
1178
- assert ( d. _variantBuffer . asNative . capacity < originalCapacity)
1178
+ assert ( d. capacity < originalCapacity)
1179
1179
assert ( d. count == 0 )
1180
1180
assert ( d [ TestKeyTy ( 10 ) ] == nil )
1181
1181
@@ -1188,19 +1188,19 @@ DictionaryTestSuite.test("COW.Slow.RemoveAllDoesNotReallocate") {
1188
1188
do {
1189
1189
var d = getCOWSlowDictionary ( )
1190
1190
var identity1 = d. _rawIdentifier ( )
1191
- let originalCapacity = d. _variantBuffer . asNative . capacity
1191
+ let originalCapacity = d. capacity
1192
1192
assert ( d. count == 3 )
1193
1193
assert ( d [ TestKeyTy ( 10 ) ] !. value == 1010 )
1194
1194
1195
1195
d. removeAll ( keepingCapacity: true )
1196
1196
assert ( identity1 == d. _rawIdentifier ( ) )
1197
- assert ( d. _variantBuffer . asNative . capacity == originalCapacity)
1197
+ assert ( d. capacity == originalCapacity)
1198
1198
assert ( d. count == 0 )
1199
1199
assert ( d [ TestKeyTy ( 10 ) ] == nil )
1200
1200
1201
1201
d. removeAll ( keepingCapacity: true )
1202
1202
assert ( identity1 == d. _rawIdentifier ( ) )
1203
- assert ( d. _variantBuffer . asNative . capacity == originalCapacity)
1203
+ assert ( d. capacity == originalCapacity)
1204
1204
assert ( d. count == 0 )
1205
1205
assert ( d [ TestKeyTy ( 10 ) ] == nil )
1206
1206
}
@@ -1229,7 +1229,7 @@ DictionaryTestSuite.test("COW.Slow.RemoveAllDoesNotReallocate") {
1229
1229
do {
1230
1230
var d1 = getCOWSlowDictionary ( )
1231
1231
var identity1 = d1. _rawIdentifier ( )
1232
- let originalCapacity = d1. _variantBuffer . asNative . capacity
1232
+ let originalCapacity = d1. capacity
1233
1233
assert ( d1. count == 3 )
1234
1234
assert ( d1 [ TestKeyTy ( 10 ) ] !. value == 1010 )
1235
1235
@@ -1240,7 +1240,7 @@ DictionaryTestSuite.test("COW.Slow.RemoveAllDoesNotReallocate") {
1240
1240
assert ( identity2 != identity1)
1241
1241
assert ( d1. count == 3 )
1242
1242
assert ( d1 [ TestKeyTy ( 10 ) ] !. value == 1010 )
1243
- assert ( d2. _variantBuffer . asNative . capacity == originalCapacity)
1243
+ assert ( d2. capacity == originalCapacity)
1244
1244
assert ( d2. count == 0 )
1245
1245
assert ( d2 [ TestKeyTy ( 10 ) ] == nil )
1246
1246
@@ -2644,7 +2644,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Verbatim.RemoveAll") {
2644
2644
2645
2645
d. removeAll ( )
2646
2646
assert ( identity1 != d. _rawIdentifier ( ) )
2647
- assert ( d. _variantBuffer . asNative . capacity < originalCapacity)
2647
+ assert ( d. capacity < originalCapacity)
2648
2648
assert ( d. count == 0 )
2649
2649
assert ( d [ TestObjCKeyTy ( 10 ) ] == nil )
2650
2650
}
@@ -2659,7 +2659,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Verbatim.RemoveAll") {
2659
2659
2660
2660
d. removeAll ( keepingCapacity: true )
2661
2661
assert ( identity1 != d. _rawIdentifier ( ) )
2662
- assert ( d. _variantBuffer . asNative . capacity >= originalCapacity)
2662
+ assert ( d. capacity >= originalCapacity)
2663
2663
assert ( d. count == 0 )
2664
2664
assert ( d [ TestObjCKeyTy ( 10 ) ] == nil )
2665
2665
}
@@ -2679,7 +2679,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Verbatim.RemoveAll") {
2679
2679
assert ( identity2 != identity1)
2680
2680
assert ( d1. count == 3 )
2681
2681
assert ( ( d1 [ TestObjCKeyTy ( 10 ) ] as! TestObjCValueTy ) . value == 1010 )
2682
- assert ( d2. _variantBuffer . asNative . capacity < originalCapacity)
2682
+ assert ( d2. capacity < originalCapacity)
2683
2683
assert ( d2. count == 0 )
2684
2684
assert ( d2 [ TestObjCKeyTy ( 10 ) ] == nil )
2685
2685
}
@@ -2699,7 +2699,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Verbatim.RemoveAll") {
2699
2699
assert ( identity2 != identity1)
2700
2700
assert ( d1. count == 3 )
2701
2701
assert ( ( d1 [ TestObjCKeyTy ( 10 ) ] as! TestObjCValueTy ) . value == 1010 )
2702
- assert ( d2. _variantBuffer . asNative . capacity >= originalCapacity)
2702
+ assert ( d2. capacity >= originalCapacity)
2703
2703
assert ( d2. count == 0 )
2704
2704
assert ( d2 [ TestObjCKeyTy ( 10 ) ] == nil )
2705
2705
}
@@ -2727,7 +2727,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.RemoveAll") {
2727
2727
2728
2728
d. removeAll ( )
2729
2729
assert ( identity1 != d. _rawIdentifier ( ) )
2730
- assert ( d. _variantBuffer . asNative . capacity < originalCapacity)
2730
+ assert ( d. capacity < originalCapacity)
2731
2731
assert ( d. count == 0 )
2732
2732
assert ( d [ TestBridgedKeyTy ( 10 ) ] == nil )
2733
2733
}
@@ -2742,7 +2742,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.RemoveAll") {
2742
2742
2743
2743
d. removeAll ( keepingCapacity: true )
2744
2744
assert ( identity1 == d. _rawIdentifier ( ) )
2745
- assert ( d. _variantBuffer . asNative . capacity >= originalCapacity)
2745
+ assert ( d. capacity >= originalCapacity)
2746
2746
assert ( d. count == 0 )
2747
2747
assert ( d [ TestBridgedKeyTy ( 10 ) ] == nil )
2748
2748
}
@@ -2762,7 +2762,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.RemoveAll") {
2762
2762
assert ( identity2 != identity1)
2763
2763
assert ( d1. count == 3 )
2764
2764
assert ( d1 [ TestBridgedKeyTy ( 10 ) ] !. value == 1010 )
2765
- assert ( d2. _variantBuffer . asNative . capacity < originalCapacity)
2765
+ assert ( d2. capacity < originalCapacity)
2766
2766
assert ( d2. count == 0 )
2767
2767
assert ( d2 [ TestBridgedKeyTy ( 10 ) ] == nil )
2768
2768
}
@@ -2782,7 +2782,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.RemoveAll") {
2782
2782
assert ( identity2 != identity1)
2783
2783
assert ( d1. count == 3 )
2784
2784
assert ( d1 [ TestBridgedKeyTy ( 10 ) ] !. value == 1010 )
2785
- assert ( d2. _variantBuffer . asNative . capacity >= originalCapacity)
2785
+ assert ( d2. capacity >= originalCapacity)
2786
2786
assert ( d2. count == 0 )
2787
2787
assert ( d2 [ TestBridgedKeyTy ( 10 ) ] == nil )
2788
2788
}
0 commit comments