Skip to content

Commit b517693

Browse files
committed
[test] Tweak some tests so that they run consistently on OS X 10.9
1 parent 38b3c25 commit b517693

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/Interpreter/SDK/class_getImageName.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ testSuite.test("KVO/ObjC") {
115115
}
116116

117117
testSuite.test("dynamic") {
118-
let newClass: AnyClass = objc_allocateClassPair(/*superclass*/nil,
118+
let newClass: AnyClass = objc_allocateClassPair(/*superclass*/NSObject.self,
119119
"CompletelyDynamic",
120120
/*extraBytes*/0)!
121121
objc_registerClassPair(newClass)

test/Interpreter/SDK/objc_swift_getObjectType.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ extension P {
3131
class O: NSObject, P { }
3232
var o = O()
3333
let obase: NSObject = o
34-
print(String(cString: object_getClassName(o)))
34+
print(NSStringFromClass(object_getClass(o)!))
3535
_ = (o as P).anyP
3636
_ = (obase as! P).anyP
37-
// CHECK: main.O
37+
// CHECK: {{^}}main.O{{$}}
3838

3939
// ... and KVO's artificial subclass thereof
4040
o.addObserver(NSObject(), forKeyPath: "xxx", options: [.new], context: nil)
41-
print(String(cString: object_getClassName(o)))
41+
print(NSStringFromClass(object_getClass(o)!))
4242
_ = (o as P).anyP
4343
_ = (obase as! P).anyP
4444
// CHECK-NEXT: NSKVONotifying_main.O
@@ -47,14 +47,14 @@ _ = (obase as! P).anyP
4747
extension NSLock: P { }
4848
var l = NSLock()
4949
let lbase: NSObject = l
50-
print(String(cString: object_getClassName(l)))
50+
print(NSStringFromClass(object_getClass(l)!))
5151
_ = (l as P).anyP
5252
_ = (lbase as! P).anyP
5353
// CHECK-NEXT: NSLock
5454

5555
// ... and KVO's artificial subclass thereof
5656
l.addObserver(NSObject(), forKeyPath: "xxx", options: [.new], context: nil)
57-
print(String(cString: object_getClassName(l)))
57+
print(NSStringFromClass(object_getClass(l)!))
5858
_ = (l as P).anyP
5959
_ = (lbase as! P).anyP
6060
// CHECK-NEXT: NSKVONotifying_NSLock

0 commit comments

Comments
 (0)