Skip to content

Commit b8cf6ec

Browse files
author
Alexis Beingessner
committed
Fix tests to reflect new eager bridging semantics
* Some tests were removed because they exclusively check for lazy bridge behaviour * Many checks for objc/native-ness were removed as meaningless * Many checks for identity were updated (or removed) for new semantics * Trap checks were updated to reflect more eager semantics * A keysEnumerator() impl had to be added as the new design touches it * Some tests that randomly touch impl details were updated
1 parent fee63b8 commit b8cf6ec

File tree

6 files changed

+144
-528
lines changed

6 files changed

+144
-528
lines changed

test/stdlib/Inputs/DictionaryKeyValueTypesObjC.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,6 @@ public func convertNSDictionaryToDictionary<
1818
return result!
1919
}
2020

21-
func isNativeDictionary<KeyTy : Hashable, ValueTy>(
22-
_ d: Dictionary<KeyTy, ValueTy>) -> Bool {
23-
switch d._variantBuffer {
24-
case .native:
25-
return true
26-
case .cocoa:
27-
return false
28-
}
29-
}
30-
31-
func isCocoaDictionary<KeyTy : Hashable, ValueTy>(
32-
_ d: Dictionary<KeyTy, ValueTy>) -> Bool {
33-
return !isNativeDictionary(d)
34-
}
35-
3621
func isNativeNSDictionary(_ d: NSDictionary) -> Bool {
3722
let className: NSString = NSStringFromClass(type(of: d)) as NSString
3823
return ["_SwiftDeferredNSDictionary", "NativeDictionaryStorage"].contains {

test/stdlib/RuntimeObjC.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -425,17 +425,6 @@ Runtime.test("casting AnyObject to class metatypes") {
425425

426426
var RuntimeFoundationWrappers = TestSuite("RuntimeFoundationWrappers")
427427

428-
RuntimeFoundationWrappers.test("_stdlib_NSObject_isEqual/NoLeak") {
429-
nsObjectCanaryCount = 0
430-
autoreleasepool {
431-
let a = NSObjectCanary()
432-
let b = NSObjectCanary()
433-
expectEqual(2, nsObjectCanaryCount)
434-
_stdlib_NSObject_isEqual(a, b)
435-
}
436-
expectEqual(0, nsObjectCanaryCount)
437-
}
438-
439428
var nsStringCanaryCount = 0
440429
@objc class NSStringCanary : NSString {
441430
override init() {

test/stdlib/SetTrapsObjC.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,8 @@ SetTraps.test("Downcast1")
134134
reason: "this trap is not guaranteed to happen in -Ounchecked"))
135135
.code {
136136
let s: Set<NSObject> = [ NSObject(), NSObject() ]
137-
let s2: Set<TestObjCKeyTy> = _setDownCast(s)
138137
expectCrashLater()
139-
let v1 = s2.contains(TestObjCKeyTy(10))
140-
let v2 = s2.contains(TestObjCKeyTy(20))
141-
142-
// This triggers failure.
143-
for m in s2 { }
138+
_ = _setDownCast(s) as Set<TestObjCKeyTy>
144139
}
145140

146141
SetTraps.test("Downcast2")

0 commit comments

Comments
 (0)