@@ -3385,13 +3385,19 @@ func checkGetObjectsAndKeys(
3385
3385
values[ \( i) ] was left unchanged
3386
3386
""" ,
3387
3387
file: file, line: line)
3388
- expectTrue (
3389
- value === dictionary. object ( forKey: key) as AnyObject ,
3390
- """
3391
- Inconsistency at offset \( i) with count \( count) :
3392
- values[ \( i) ] does not match value for keys[ \( i) ]
3393
- """ ,
3394
- file: file, line: line)
3388
+ if key !== canary, value !== canary {
3389
+ autoreleasepoolIfUnoptimizedReturnAutoreleased {
3390
+ // We need an autorelease pool because objectForKey returns
3391
+ // autoreleased values.
3392
+ expectTrue (
3393
+ value === dictionary. object ( forKey: key) as AnyObject ,
3394
+ """
3395
+ Inconsistency at offset \( i) with count \( count) :
3396
+ values[ \( i) ] does not match value for keys[ \( i) ]
3397
+ """ ,
3398
+ file: file, line: line)
3399
+ }
3400
+ }
3395
3401
} else {
3396
3402
expectTrue (
3397
3403
key === canary,
@@ -3416,9 +3422,7 @@ func checkGetObjectsAndKeys(
3416
3422
withExtendedLifetime ( canary) { }
3417
3423
}
3418
3424
3419
- DictionaryTestSuite . test ( " BridgedToObjC.Verbatim.getObjects:andKeys:count: " )
3420
- . skip ( . always( " rdar://problem/41871587 " ) )
3421
- . code {
3425
+ DictionaryTestSuite . test ( " BridgedToObjC.Verbatim.getObjects:andKeys:count: " ) {
3422
3426
let d = getBridgedNSDictionaryOfRefTypesBridgedVerbatim ( )
3423
3427
for count in 0 ..< d. count + 2 {
3424
3428
checkGetObjectsAndKeys ( d, count: count)
@@ -3523,9 +3527,7 @@ DictionaryTestSuite.test("BridgedToObjC.Custom.FastEnumeration_Empty") {
3523
3527
{ ( $0 as! TestObjCValueTy ) . value } )
3524
3528
}
3525
3529
3526
- DictionaryTestSuite . test ( " BridgedToObjC.Custom.getObjects:andKeys:count: " )
3527
- . skip ( . always( " rdar://problem/41871587 " ) )
3528
- . code {
3530
+ DictionaryTestSuite . test ( " BridgedToObjC.Custom.getObjects:andKeys:count: " ) {
3529
3531
let d = getBridgedNSDictionaryOfKeyValue_ValueTypesCustomBridged ( )
3530
3532
for count in 0 ..< d. count + 2 {
3531
3533
checkGetObjectsAndKeys ( d, count: count)
0 commit comments