Skip to content

Commit df393de

Browse files
committed
Fix Float80 errors
1 parent 6083e5d commit df393de

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Tests/BinaryParsingTests/FloatingPointTests.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,13 @@ struct FloatingPointTests {
196196
#if !(os(Windows) || os(Android) || ($Embedded && !os(Linux) && !(os(macOS) || os(iOS) || os(watchOS) || os(tvOS)))) && (arch(i386) || arch(x86_64))
197197
@Test(arguments: Interesting.float80s)
198198
func testFloat80RoundTrip(_ value: Float80) throws {
199-
let bytesLE = Array(littleEndian: value.bitPattern)
200-
let bytesBE = Array(bigEndian: value.bitPattern)
199+
let bytesLE = Array(littleEndian: value)
200+
let bytesBE = Array(bigEndian: value)
201201

202202
do {
203-
let value1 = try bytesLE.withParserSpan(Double.init(parsingLittleEndian:))
203+
let value1 = try bytesLE.withParserSpan(Float80.init(parsingLittleEndian:))
204204
let value2 = try bytesLE.withParserSpan { input in
205-
try Double(parsing: &input, endianness: .little)
205+
try Float80(parsing: &input, endianness: .little)
206206
}
207207

208208
if value.isNaN {
@@ -219,9 +219,9 @@ struct FloatingPointTests {
219219
}
220220

221221
do {
222-
let value1 = try bytesBE.withParserSpan(Double.init(parsingBigEndian:))
222+
let value1 = try bytesBE.withParserSpan(Float80.init(parsingBigEndian:))
223223
let value2 = try bytesBE.withParserSpan { input in
224-
try Double(parsing: &input, endianness: .big)
224+
try Float80(parsing: &input, endianness: .big)
225225
}
226226

227227
if value.isNaN {
@@ -239,7 +239,7 @@ struct FloatingPointTests {
239239

240240
// Check negative version of all values as well.
241241
if value.sign == .plus {
242-
try testDoubleRoundTrip(-value)
242+
try testFloat80RoundTrip(-value)
243243
}
244244
}
245245
#endif

0 commit comments

Comments
 (0)