Skip to content

Commit

Permalink
Testing: add some force unwraps for Android
Browse files Browse the repository at this point in the history
Add some force unwraps to address nullability differences on Android
from other platforms.

(cherry picked from commit d080ee2)
  • Loading branch information
compnerd authored and hyp committed Nov 14, 2024
1 parent 5e6c8a6 commit eaa9dac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Testing/Support/FileHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ extension FileHandle {
try withUnsafeCFILEHandle { file in
try withUnsafeTemporaryAllocation(byteCount: 1024, alignment: 1) { buffer in
repeat {
let countRead = fread(buffer.baseAddress, 1, buffer.count, file)
let countRead = fread(buffer.baseAddress!, 1, buffer.count, file)
if 0 != ferror(file) {
throw CError(rawValue: swt_errno())
}
Expand Down Expand Up @@ -295,7 +295,7 @@ extension FileHandle {
}
}

let countWritten = fwrite(bytes.baseAddress, MemoryLayout<UInt8>.stride, bytes.count, file)
let countWritten = fwrite(bytes.baseAddress!, MemoryLayout<UInt8>.stride, bytes.count, file)
if countWritten < bytes.count {
throw CError(rawValue: swt_errno())
}
Expand Down

0 comments on commit eaa9dac

Please sign in to comment.