Skip to content

Commit 4d540c2

Browse files
committed
Fix up missed test cases for SE-0054.
1 parent 6ad5e8b commit 4d540c2

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

test/1_stdlib/Dispatch.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if #available(OSX 10.10, iOS 8.0, *) {
4949
DispatchAPI.test("dispatch_block_t identity") {
5050
let block = dispatch_block_create(DISPATCH_BLOCK_INHERIT_QOS_CLASS) {
5151
_ = 1
52-
}
52+
}!
5353

5454
dispatch_async(dispatch_get_main_queue(), block)
5555
// This will trap if the block's pointer identity is not preserved.
@@ -61,7 +61,7 @@ if #available(OSX 10.10, iOS 8.0, *) {
6161

6262
let block = dispatch_block_create(dispatch_block_flags_t(0)) {
6363
counter += 1
64-
}
64+
}!
6565
block()
6666
expectEqual(1, counter)
6767

test/IDE/newtype.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
// PRINT-NEXT: static let thirdEntry: ClosedEnum
3333
// PRINT-NEXT: }
3434
// PRINT-NEXT: struct IUONewtype : RawRepresentable {
35-
// PRINT-NEXT: init(rawValue: String!)
36-
// PRINT-NEXT: var _rawValue: NSString!
37-
// PRINT-NEXT: var rawValue: String! { get }
35+
// PRINT-NEXT: init(rawValue: String?)
36+
// PRINT-NEXT: var _rawValue: NSString?
37+
// PRINT-NEXT: var rawValue: String? { get }
3838
// PRINT-NEXT: }
3939
// PRINT-NEXT: struct MyFloat : RawRepresentable {
4040
// PRINT-NEXT: init(rawValue: Float)

test/Interpreter/objc_class_properties_runtime.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ ClassProperties.test("runtime")
7676
let prop = class_getProperty(object_getClass(theClass), "value")
7777
expectNotEmpty(prop)
7878

79-
let nameAsCString = property_getName(prop)
79+
let nameAsCString = property_getName(prop)!
8080
expectNotEmpty(nameAsCString)
8181
expectEqual("value", String(cString: nameAsCString))
8282
}

validation-test/StdlibUnittest/NSException.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ TestSuiteCrashes.test("uncaught") {
2121
raiseNSException()
2222
}
2323
// CHECK-LABEL: stdout>>> uncaught
24-
// CHECK: stderr>>> *** [StdlibUnittest] Terminating due to uncaught exception Trogdor: Burnination
24+
// CHECK: stderr>>> *** [StdlibUnittest] Terminating due to uncaught exception Trogdor: Optional(Burnination)
25+
// FIXME: listed reason above should be "Burnination", not "Optional(Burnination)"; may have to do with SE-0054
2526
// CHECK: stderr>>> CRASHED: SIG
2627
// CHECK: the test crashed unexpectedly
2728
// CHECK: [ FAIL ] NSExceptionCrashes.uncaught
@@ -32,7 +33,7 @@ TestSuiteCrashes.test("crashesAsExpected") {
3233
raiseNSException()
3334
}
3435
// CHECK-LABEL: stdout>>> crashesAsExpected
35-
// CHECK: stderr>>> *** [StdlibUnittest] Terminating due to uncaught exception Trogdor: Burnination
36+
// CHECK: stderr>>> *** [StdlibUnittest] Terminating due to uncaught exception Trogdor: Optional(Burnination)
3637
// CHECK: stderr>>> OK: saw expected "crashed: sig
3738
// CHECK: [ OK ] NSExceptionCrashes.crashesAsExpected
3839

@@ -45,7 +46,7 @@ TestSuiteCrashes.test("crashesWithMessage")
4546
raiseNSException()
4647
}
4748
// CHECK-LABEL: stdout>>> crashesWithMessage
48-
// CHECK: stderr>>> *** [StdlibUnittest] Terminating due to uncaught exception Trogdor: Burnination
49+
// CHECK: stderr>>> *** [StdlibUnittest] Terminating due to uncaught exception Trogdor: Optional(Burnination)
4950
// CHECK: stderr>>> OK: saw expected "crashed: sig
5051
// CHECK: [ OK ] NSExceptionCrashes.crashesWithMessage
5152

@@ -56,7 +57,7 @@ TestSuiteCrashes.test("nonNSException")
5657
objc_exception_throw("countryside")
5758
}
5859
// CHECK-LABEL: stdout>>> nonNSException
59-
// CHECK: stderr>>> *** [StdlibUnittest] Terminating due to uncaught exception: countryside
60+
// CHECK: stderr>>> *** [StdlibUnittest] Terminating due to uncaught exception: Optional(countryside)
6061
// CHECK: stderr>>> OK: saw expected "crashed: sig
6162
// CHECK: [ OK ] NSExceptionCrashes.nonNSException
6263

validation-test/stdlib/Unicode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2263,7 +2263,7 @@ StringCookedViews.test("UTF8ForContiguousUTF16") {
22632263
backingStorage.withUnsafeBufferPointer {
22642264
(ptr) -> Void in
22652265
let cfstring = CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault,
2266-
ptr.baseAddress, backingStorage.count, kCFAllocatorNull)
2266+
ptr.baseAddress, backingStorage.count, kCFAllocatorNull)!
22672267
expectFalse(CFStringGetCStringPtr(cfstring,
22682268
CFStringBuiltInEncodings.ASCII.rawValue) != nil)
22692269
expectTrue(CFStringGetCharactersPtr(cfstring) != nil)

0 commit comments

Comments
 (0)