Stephen Canon
3841a7531f
Add some notes explaining what invariants are violated.
2024-07-17 13:49:15 -04:00
Stephen Canon
c64775ef71
Another invariant to check
2024-07-17 12:25:34 -04:00
Stephen Canon
4c96faa6d8
Insure that FilePath and SystemString's invariants are enforced when decoding.
2024-07-17 12:14:43 -04:00
Guillaume Lessard
2ce971a831
Merge pull request #155 from glessard/system-string-api-consistency
...
SystemString api consistency improvements
2024-07-05 14:26:21 -07:00
Alastair Houghton
abc0a6d26f
[Windows] Fix tests.
...
We need to use `@testable` when importing `SystemPackage` in order to
let us test the `internal` functions.
Also, use `NUL` instead of `/dev/null`, and generate random bytes in a
file instead of reading from `/dev/random`.
2024-05-13 15:13:31 +01:00
Alastair Houghton
2357d6932c
Refactor FilePathTemp, add tests for permission code.
...
Broke `FilePathTemp.swift` into separate files for POSIX and
Windows.
Added tests for permissions code on Windows.
Added leading underscores to some function names.
Made some other functions `fileprivate`.
rdar://125087707
2024-05-08 16:09:56 +01:00
Alastair Houghton
c6456a9c03
Use the proper temporary directory on Darwin.
...
It seems we can get the temporary directory from confstr().
rdar://125087707
2024-05-08 16:09:56 +01:00
Alastair Houghton
cfd3f9da90
Fix swift-system to work on Windows.
...
The swift-system tests were not passing, for various reasons, mostly
to do with path related confusion.
As part of this, add a function to create a temporary directory, as that
was one of the problems.
Also add Windows support for pipe() and ftruncate(), which was missing.
rdar://125087707
2024-05-08 16:09:54 +01:00
Guillaume Lessard
dae787c199
Merge pull request #148 from finagolfin/droid
...
Android: update pread/pwrite for nullability annotations in NDK 26
2024-03-19 18:23:38 -07:00
Guillaume Lessard
14597334dc
[test] test reading and writing empty, nil-based buffers
2024-03-08 16:28:11 -08:00
Guillaume Lessard
6609a401b9
Update copyright notices
2024-03-08 12:16:44 -08:00
Guillaume Lessard
17e9790792
Rename withSystemChars
...
- `withNullTerminatedSystemChars` makes it clear that the null-termination is included. Operations where the null-termination is included should be obvious.
2024-03-08 12:16:43 -08:00
Guillaume Lessard
c86758849a
Test SystemString.string property consistency
2024-03-08 12:13:04 -08:00
Sketch
f59a0b73ce
Add support for visionOS
2024-03-08 10:39:54 -05:00
Guillaume Lessard
882466a730
apply missing availability attributes to Mach.Port
2023-10-13 18:55:23 -07:00
Guillaume Lessard
8a8552f617
Merge pull request #129 from glessard/reenable-mach-port
...
Re-enable Mach.Port
2023-08-16 16:04:53 -07:00
Guillaume Lessard
ad407249fe
make test expression return Void
...
- It can’t return `Mach.Port<SendRight>`, because a noncopyable type cannot currently be a generic type argument.
2023-08-16 13:34:41 -07:00
Guillaume Lessard and loffgren
faffb9a15a
Apply suggestions from code review
...
This better communicates the intention.
Co-authored-by: loffgren <117697138+loffgren@users.noreply.github.com >
2023-08-16 13:19:52 -07:00
Guillaume Lessard
f32faad415
remove code depending on Swift older than 5.6
2023-08-16 11:02:51 -07:00
Guillaume Lessard
f5edd720bd
clarify some tests
2023-08-11 18:03:24 -07:00
Guillaume Lessard
6189c1f553
fix copySendRight() for send rights that become dead names
2023-08-11 14:09:44 -07:00
Guillaume Lessard
e4d06ae3ea
simplify deinit
2023-08-10 15:35:27 -07:00
Guillaume Lessard
d259ef476e
test two-parameter withBorrowedName
2023-08-10 15:35:27 -07:00
Guillaume Lessard
5e03246e4e
test copies of dead mach port names
2023-08-10 15:32:19 -07:00
Guillaume Lessard
40b5b3068b
test all the relinquish() methods
2023-08-10 15:32:19 -07:00
Guillaume Lessard
e8bb779909
use inout conversion
...
- this is the situation where it is appropriate
2023-08-10 15:32:19 -07:00
Guillaume Lessard
6ee96ffdb5
modify consuming methods to call discard self
2023-08-09 15:58:56 -07:00
Guillaume Lessard
0539daa364
fix test of receive-right deallocation
2023-08-09 15:58:56 -07:00
Guillaume Lessard
669dcf2c25
ensure Mach.Port lives until the function returns
2023-08-09 15:58:56 -07:00
Guillaume Lessard
bf16d3da30
[test] use XCTAssertEqual or XCTAssertNotEqual
2023-08-09 15:58:56 -07:00
Guillaume Lessard
af4544c869
Re-enable Mach.Port
2023-08-09 15:58:56 -07:00
Saleem Abdulrasool
e1ab868059
Tests: avoid unnecessary duplication (NFCI)
...
Rather than specialising the function with the same implementation,
prefer to use the `CInterop.PlatformUnicodeEncoding` to determine the
correct code point encoding. This allows us to share the implementation
across the platforms.
2023-07-13 10:00:45 -07:00
Saleem Abdulrasool
32026456ba
Tests: adjust the FilePathTest.testFilePath to build on Windows
...
UTF-8 is not the universal encoding for file systems. Use a platform
specific invalid string encoding for testing the sequence. The internal
representation of a `FilePath` is dependent on the system, and Windows
uses UTF-16 as the base encoding for C interoperability. Adjust the
test to use an invalid sequence in the proper encoding. This allows the
tests to now build on Windows once again.
2023-07-13 08:42:12 -07:00
Guillaume Lessard
7bcc01f0bf
deactivate Mach.Port
...
Will reactivate when the following issue is fixed:
https://github.com/apple/swift/issues/66299 (rdar://110496872)
2023-06-09 16:46:48 -07:00
Guillaume Lessard
2d6c6a82b3
import module correctly in test file
2023-06-09 16:40:32 -07:00
Daniel Loffgren
5b1b4cab56
Remove allocatePortRightPair(), as move only types are not permitted in tuples
2023-06-09 16:40:32 -07:00
Karoy Lorentey
bb6ab43e44
Update availability declarations
2023-03-01 18:10:40 -08:00
Karoy Lorentey
cc96d40bee
Merge pull request #76 from apple/lorentey/post-back-ios15-system
...
Update package with changes from recent ABI stable releases
2023-02-28 16:13:44 -08:00
Alex Martini
2c2a831f66
Remove blank lines at the end of doc comments.
2023-01-31 12:35:33 -08:00
Max Desiatov
b5e330163a
MachPortTests: fix build issues with Swift 5.7
2023-01-05 14:35:22 +00:00
Daniel Loffgren
47feb93a38
Add a test that ensures makeSendOnce is creating unique send-once rights
2022-12-21 13:43:26 -08:00
Daniel Loffgren
304ccc3abb
Add Mach.Port
2022-12-07 17:24:26 -08:00
Saleem Abdulrasool
348b4de820
Merge pull request #99 from compnerd/file-flags
...
Tests: remove some flags from file tests
2022-06-18 09:44:43 -07:00
Saleem Abdulrasool
e378fb2f0d
Tests: ignore XCTest manifest on newer Swift ( #91 )
...
This is motivated by the desire to build the test suite on Windows.
Newer versions of SPM have test discovery which obviates the test
manifest, which incidentally repairs the build on Windows while adopting
newer functionality and reducing management complexity.
2022-06-15 10:00:23 -06:00
Karoy Lorentey
e9886bf251
Merge branch 'main' into lorentey/post-back-ios15-system
...
# Conflicts:
# Sources/System/FilePath/FilePathString.swift
2022-06-13 16:45:25 -07:00
Karoy Lorentey
63cdebeff6
Merge pull request #95 from compnerd/chartype
...
Tests: explicitly convert the character type
2022-06-13 16:32:28 -07:00
Karoy Lorentey
97a03f97c8
Merge pull request #103 from compnerd/array
...
Tests: change the conversion for string to array
2022-06-13 16:30:40 -07:00
Karoy Lorentey
0a7e8e121b
Merge pull request #100 from compnerd/utf16
...
Tests: explicitly convert to UTF16 on Windows
2022-06-13 16:14:41 -07:00
Karoy Lorentey
a102156af3
Merge pull request #96 from compnerd/not-errno
...
Tests: remove error codes that are unavailable on windows
2022-06-13 14:59:59 -07:00
Karoy Lorentey
dc5a3107c0
Merge pull request #102 from compnerd/underlying
...
Tests: adjust the Windows error codes
2022-06-13 14:55:14 -07:00