Skip to content

Commit d109ed0

Browse files
authored
Don't use memcpy() in a unit test. (swiftlang#423)
This PR changes from `memcpy()` to the Swiftier `UnsafeMutableRawBufferPointer.copyMemory(from:)`. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent c6a92a1 commit d109ed0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tests/TestingTests/ABIEntryPointTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct ABIEntryPointTests {
4040
arguments.verbosity = .min
4141
let argumentsJSON = try JSON.withEncoding(of: arguments) { argumentsJSON in
4242
let result = UnsafeMutableRawBufferPointer.allocate(byteCount: argumentsJSON.count, alignment: 1)
43-
_ = memcpy(result.baseAddress!, argumentsJSON.baseAddress!, argumentsJSON.count)
43+
result.copyMemory(from: argumentsJSON)
4444
return result
4545
}
4646
defer {

0 commit comments

Comments
 (0)