Skip to content

Revert #916 and apply a slightly different change. #917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 17, 2025
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