Skip to content

[test] Fix leak and reenable getObjects:andKeys:count: tests #17905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions validation-test/stdlib/Dictionary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3385,13 +3385,19 @@ func checkGetObjectsAndKeys(
values[\(i)] was left unchanged
""",
file: file, line: line)
expectTrue(
value === dictionary.object(forKey: key) as AnyObject,
"""
Inconsistency at offset \(i) with count \(count):
values[\(i)] does not match value for keys[\(i)]
""",
file: file, line: line)
if key !== canary, value !== canary {
autoreleasepoolIfUnoptimizedReturnAutoreleased {
// We need an autorelease pool because objectForKey returns
// autoreleased values.
expectTrue(
value === dictionary.object(forKey: key) as AnyObject,
"""
Inconsistency at offset \(i) with count \(count):
values[\(i)] does not match value for keys[\(i)]
""",
file: file, line: line)
}
}
} else {
expectTrue(
key === canary,
Expand All @@ -3416,9 +3422,7 @@ func checkGetObjectsAndKeys(
withExtendedLifetime(canary) {}
}

DictionaryTestSuite.test("BridgedToObjC.Verbatim.getObjects:andKeys:count:")
.skip(.always("rdar://problem/41871587"))
.code {
DictionaryTestSuite.test("BridgedToObjC.Verbatim.getObjects:andKeys:count:") {
let d = getBridgedNSDictionaryOfRefTypesBridgedVerbatim()
for count in 0 ..< d.count + 2 {
checkGetObjectsAndKeys(d, count: count)
Expand Down Expand Up @@ -3523,9 +3527,7 @@ DictionaryTestSuite.test("BridgedToObjC.Custom.FastEnumeration_Empty") {
{ ($0 as! TestObjCValueTy).value })
}

DictionaryTestSuite.test("BridgedToObjC.Custom.getObjects:andKeys:count:")
.skip(.always("rdar://problem/41871587"))
.code {
DictionaryTestSuite.test("BridgedToObjC.Custom.getObjects:andKeys:count:") {
let d = getBridgedNSDictionaryOfKeyValue_ValueTypesCustomBridged()
for count in 0 ..< d.count + 2 {
checkGetObjectsAndKeys(d, count: count)
Expand Down