Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions Sources/Testing/Discovery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,29 +78,19 @@ protocol TestContent: ~Copyable {
struct TestContentRecord<T>: Sendable where T: ~Copyable {
/// The base address of the image containing this instance, if known.
///
/// This property is not available on platforms such as WASI that statically
/// link to the testing library.
/// On platforms such as WASI that statically link to the testing library, the
/// value of this property is always `nil`.
///
/// - Note: The value of this property is distinct from the pointer returned
/// by `dlopen()` (on platforms that have that function) and cannot be used
/// with interfaces such as `dlsym()` that expect such a pointer.
#if SWT_NO_DYNAMIC_LINKING
@available(*, unavailable, message: "Image addresses are not available on this platform.")
nonisolated(unsafe) var imageAddress: UnsafeRawPointer? {
get { fatalError() }
set { fatalError() }
}
#else
nonisolated(unsafe) var imageAddress: UnsafeRawPointer?
#endif

/// The underlying test content record loaded from a metadata section.
private var _record: __TestContentRecord

fileprivate init(imageAddress: UnsafeRawPointer?, record: __TestContentRecord) {
#if !SWT_NO_DYNAMIC_LINKING
self.imageAddress = imageAddress
#endif
self._record = record
}
}
Expand Down