mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fix unit tests that relied on nontrivial to raw conversion.
This commit is contained in:
@@ -84,14 +84,17 @@ func nsEncode<CodeUnit>(
|
||||
length: 4,
|
||||
encoding: String.Encoding.utf32LittleEndian.rawValue)!
|
||||
|
||||
s.getBytes(
|
||||
&buffer,
|
||||
maxLength: buffer.count,
|
||||
usedLength: &used,
|
||||
encoding: encoding.rawValue,
|
||||
options: [],
|
||||
range: NSRange(location: 0, length: s.length),
|
||||
remaining: nil)
|
||||
let count = buffer.count
|
||||
_ = buffer.withUnsafeMutableBytes { bufferBytes in
|
||||
s.getBytes(
|
||||
bufferBytes.baseAddress,
|
||||
maxLength: count,
|
||||
usedLength: &used,
|
||||
encoding: encoding.rawValue,
|
||||
options: [],
|
||||
range: NSRange(location: 0, length: s.length),
|
||||
remaining: nil)
|
||||
}
|
||||
}
|
||||
|
||||
final class CodecTest<Codec : TestableUnicodeCodec> {
|
||||
|
||||
Reference in New Issue
Block a user