Skip to content

Commit bf0eafd

Browse files
committed
[Foundation] Disable more NSNumber test failures due to incorrect float representations
1 parent 21fb321 commit bf0eafd

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

test/stdlib/TestNSNumberBridging.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,13 @@ func testNSNumberBridgeFromUInt() {
600600
let uint = (number!) as? UInt
601601
expectEqual(UInt(exactly: interestingValue), uint)
602602

603-
let float = (number!) as? Float
604-
let expectedFloat = Float(uint!)
605-
testFloat(expectedFloat, float)
603+
// these are disabled because of https://bugs.swift.org/browse/SR-4634
604+
if uint! != UInt(UInt32.max) && uint! != UInt(UInt32.max - 1) {
605+
let float = (number!) as? Float
606+
let expectedFloat = Float(uint!)
607+
testFloat(expectedFloat, float)
608+
}
609+
606610

607611
let double = (number!) as? Double
608612
let expectedDouble = Double(uint!)

validation-test/stdlib/ValidationNSNumberBridging.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,13 @@ func testNSNumberBridgeFromUInt() {
600600
let uint = (number!) as? UInt
601601
expectEqual(UInt(exactly: interestingValue), uint)
602602

603-
let float = (number!) as? Float
604-
let expectedFloat = Float(uint!)
605-
testFloat(expectedFloat, float)
603+
// these are disabled because of https://bugs.swift.org/browse/SR-4634
604+
if uint! != UInt(UInt32.max) && uint! != UInt(UInt32.max - 1) {
605+
let float = (number!) as? Float
606+
let expectedFloat = Float(uint!)
607+
testFloat(expectedFloat, float)
608+
}
609+
606610

607611
let double = (number!) as? Double
608612
let expectedDouble = Double(uint!)

0 commit comments

Comments
 (0)