Skip to content

Commit f1c0334

Browse files
committed
Autoreleasepool NSDictionary conversions in Dictionary validation tests.
Not sure if this is by design (cc @gribozavr), but the test harness counts the bridged values in these dictionaries as "leaks" if they aren't popped early.
1 parent 82ca1ca commit f1c0334

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

validation-test/stdlib/Dictionary.swift

+8-4
Original file line numberDiff line numberDiff line change
@@ -1426,8 +1426,10 @@ DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.DictionaryIsCopied") {
14261426

14271427

14281428
DictionaryTestSuite.test("BridgedFromObjC.Verbatim.NSDictionaryIsRetained") {
1429-
var nsd: NSDictionary = NSDictionary(dictionary:
1430-
getAsNSDictionary([10: 1010, 20: 1020, 30: 1030]))
1429+
var nsd: NSDictionary = autoreleasepool {
1430+
NSDictionary(dictionary:
1431+
getAsNSDictionary([10: 1010, 20: 1020, 30: 1030]))
1432+
}
14311433

14321434
var d: [NSObject : AnyObject] = convertNSDictionaryToDictionary(nsd)
14331435

@@ -1443,8 +1445,10 @@ DictionaryTestSuite.test("BridgedFromObjC.Verbatim.NSDictionaryIsRetained") {
14431445
}
14441446

14451447
DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.NSDictionaryIsCopied") {
1446-
var nsd: NSDictionary = NSDictionary(dictionary:
1447-
getAsNSDictionary([10: 1010, 20: 1020, 30: 1030]))
1448+
var nsd: NSDictionary = autoreleasepool {
1449+
NSDictionary(dictionary:
1450+
getAsNSDictionary([10: 1010, 20: 1020, 30: 1030]))
1451+
}
14481452

14491453
var d: [TestBridgedKeyTy : TestBridgedValueTy] =
14501454
convertNSDictionaryToDictionary(nsd)

0 commit comments

Comments
 (0)