Skip to content

Commit d080ee2

Browse files
committed
Testing: add some force unwraps for Android
Add some force unwraps to address nullability differences on Android from other platforms.
1 parent 2e3ed1f commit d080ee2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Testing/Support/FileHandle.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ extension FileHandle {
257257
try withUnsafeCFILEHandle { file in
258258
try withUnsafeTemporaryAllocation(byteCount: 1024, alignment: 1) { buffer in
259259
repeat {
260-
let countRead = fread(buffer.baseAddress, 1, buffer.count, file)
260+
let countRead = fread(buffer.baseAddress!, 1, buffer.count, file)
261261
if 0 != ferror(file) {
262262
throw CError(rawValue: swt_errno())
263263
}
@@ -295,7 +295,7 @@ extension FileHandle {
295295
}
296296
}
297297

298-
let countWritten = fwrite(bytes.baseAddress, MemoryLayout<UInt8>.stride, bytes.count, file)
298+
let countWritten = fwrite(bytes.baseAddress!, MemoryLayout<UInt8>.stride, bytes.count, file)
299299
if countWritten < bytes.count {
300300
throw CError(rawValue: swt_errno())
301301
}

0 commit comments

Comments
 (0)