Update validation tests for id-as-Any.

This commit is contained in:
Joe Groff
2016-07-24 20:16:47 -07:00
parent 5bfd6cc0c7
commit 21c15d8fe9
13 changed files with 114 additions and 111 deletions

View File

@@ -31,9 +31,11 @@ struct ErrorAsNSErrorRaceTest : RaceTestWithPerTrialData {
let ns = raceData.error as NSError
// Use valueForKey to bypass bridging, so we can verify that the identity
// of the unbridged NSString object is stable.
let domainInt: Int = unsafeBitCast(ns.value(forKey: "domain"), to: Int.self)
let domainInt: Int = unsafeBitCast(ns.value(forKey: "domain").map { $0 as AnyObject },
to: Int.self)
let code: Int = ns.code
let userInfoInt: Int = unsafeBitCast(ns.value(forKey: "userInfo"), to: Int.self)
let userInfoInt: Int = unsafeBitCast(ns.value(forKey: "userInfo").map { $0 as AnyObject },
to: Int.self)
return Observation3Int(domainInt, code, userInfoInt)
}